[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
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
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |