[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [OSSTEST PATCH 1/3] cs-adjust-flight: Provide runvar-set-default


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
  • Date: Mon, 21 Oct 2019 16:16:13 +0100
  • Authentication-results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=ian.jackson@xxxxxxxxxxxxx; spf=Pass smtp.mailfrom=Ian.Jackson@xxxxxxxxxx; spf=None smtp.helo=postmaster@xxxxxxxxxxxxxxx
  • Cc: Jürgen Groß <jgross@xxxxxxxx>, Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
  • Delivery-date: Mon, 21 Oct 2019 15:16:26 +0000
  • Ironport-sdr: DR7DT9+pKKOPfiGGEXLZIaFJoOZ4TjrDxyWVBJ6wwyZ213A0w/lXV0uhUEiuDRb/FjwGs3SXPR I5eHKhJWOPaBtGjZWGfDnLBuPW7rb1CAMJO8R6gv22cMJuHMiSaNHVVGpGb/tIAgFQ9mkVDUCN dQOhe+piEAfDEc3mWsBxhdm1BHiviBS0bbsoDOLjditJw2AmjE85jbbZIe9S3aH4UzJ3+iNYCJ 4GYq8fpyNoYRjGGcihfjqkWd9ZHrx82xUcOZkAL6GEqMmxRBNP6cVFhJcG1tFTu28P53XNq0df gtQ=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

No change to existing code.

Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 cs-adjust-flight | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/cs-adjust-flight b/cs-adjust-flight
index ae342506..98d40891 100755
--- a/cs-adjust-flight
+++ b/cs-adjust-flight
@@ -11,6 +11,7 @@
 #   jobs-list <job-spec>
 #   jobs-del <job-spec>
 #   runvar-set <job-spec> <var-spec> <value>
+#   runvar-set-default <job-spec> <var-spec> <value>
 #   runvar-del <job-spec> <var-spec>
 #   runvar-change <job-spec> <var-spec> <old-value> <new-value>
 #   runvar-perlop <job-spec> <var-spec> <perl-expr>
@@ -260,6 +261,10 @@ our $runvar_rm_q = db_prepare
 our $runvar_insert_q = db_prepare
     ("INSERT INTO runvars (flight, job, name, val, synth)".
      " VALUES (?, ?, ?, ?, 'f')");
+our $runvar_insert_default_q = db_prepare
+    ("INSERT INTO runvars (flight, job, name, val, synth)".
+     " VALUES (?, ?, ?, ?, 'f')".
+     " ON CONFLICT DO NOTHING");
 
 sub runvar_set ($$$;$) {
     my ($job, $name, $val, $xwhat) = @_;
@@ -270,6 +275,16 @@ sub runvar_set ($$$;$) {
     verbose "\n";
 }
 
+sub runvar_set_default ($$$;$) {
+    my ($job, $name, $val, $xwhat) = @_;
+    my $y = $runvar_insert_default_q->execute($dstflight, $job, $name, $val);
+    if ($y) {
+       verbose "$dstflight.$job $name := \`$val'";
+       verbose $xwhat if defined $xwhat;
+       verbose "\n";
+    }
+}
+
 sub for_runvars ($$$$) {
     my ($jobspec, $varspec, $fn, $ifnone) = @_;
     # calls $fn->($jobname, $varname, $varrow)
@@ -306,6 +321,18 @@ sub change__runvar_set {
     }, 'ANYWAY');
 }
 
+sub change__runvar_set_default {
+    die unless @changes >= 3;
+    my $jobs = shift @changes;
+    my $name = shift @changes;
+    my $val = shift @changes;
+
+    for_jobs($dstflight, $jobs, sub {
+        my ($job) = @_;
+        runvar_set_default($job, $name, $val);
+    }, 'ANYWAY');
+}
+
 sub change__runvar_del {
     die unless @changes >= 2;
     my $jobs = shift @changes;
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.