* [OSSTEST PATCH 1/5] mfi-common: Break out set_hostos_runvars @ 2016-07-20 13:19 Ian Jackson 2016-07-20 13:19 ` [OSSTEST PATCH 2/5] mfi-common: Do not set di_version runvar to empty string in build jobs Ian Jackson ` (3 more replies) 0 siblings, 4 replies; 5+ messages in thread From: Ian Jackson @ 2016-07-20 13:19 UTC (permalink / raw) To: xen-devel; +Cc: Ian Jackson We are going to want to reuse this. No functional change. (NB shell `local' variables have dynamic rather than lexical scope.) Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com> --- mfi-common | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/mfi-common b/mfi-common index ca1e0dd..93cc3da 100644 --- a/mfi-common +++ b/mfi-common @@ -76,6 +76,17 @@ job_create_build () { ./cs-job-create $flight $job $recipe $global_runvars "$@" } +set_hostos_runvars () { + # caller should have done + # local hostos_runvars + # suite=.... + # di_version=.... # perhaps + hostos_runvars="all_host_suite=$suite" + case "$di_version" in + ?*) hostos_runvars+=" all_host_di_version=$di_version" + esac +} + create_build_jobs () { local arch @@ -414,10 +425,7 @@ test_matrix_iterate () { ;; esac - hostos_runvars="all_host_suite=$suite" - case "$di_version" in - ?*) hostos_runvars+=" all_host_di_version=$di_version" - esac + set_hostos_runvars for kern in ''; do -- 2.1.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel ^ permalink raw reply related [flat|nested] 5+ messages in thread
* [OSSTEST PATCH 2/5] mfi-common: Do not set di_version runvar to empty string in build jobs 2016-07-20 13:19 [OSSTEST PATCH 1/5] mfi-common: Break out set_hostos_runvars Ian Jackson @ 2016-07-20 13:19 ` Ian Jackson 2016-07-20 13:19 ` [OSSTEST PATCH 3/5] cr-ensure-disk-space: Break out check_space Ian Jackson ` (2 subsequent siblings) 3 siblings, 0 replies; 5+ messages in thread From: Ian Jackson @ 2016-07-20 13:19 UTC (permalink / raw) To: xen-devel; +Cc: Ian Jackson 2601498df77c "mfi-common: Do not set di_version runvar to empty string" fixed the test jobs but not the build jobs, because the setting of hostos_runvars was (it seems) cloned-and-hacked, and it fixed only one instance. Now that we have set_hostos_runvars, use it in create_build_jobs too. Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com> --- mfi-common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mfi-common b/mfi-common index 93cc3da..971ded3 100644 --- a/mfi-common +++ b/mfi-common @@ -134,7 +134,7 @@ create_build_jobs () { *) suite=$defsuite; di_version=$defdi_version;; esac - hostos_runvars="all_host_suite=$suite all_host_di_version=$di_version" + set_hostos_runvars # In 4.4 onwards xend is off by default. If necessary we build a # separate set of binaries with xend enabled in order to run those -- 2.1.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel ^ permalink raw reply related [flat|nested] 5+ messages in thread
* [OSSTEST PATCH 3/5] cr-ensure-disk-space: Break out check_space 2016-07-20 13:19 [OSSTEST PATCH 1/5] mfi-common: Break out set_hostos_runvars Ian Jackson 2016-07-20 13:19 ` [OSSTEST PATCH 2/5] mfi-common: Do not set di_version runvar to empty string in build jobs Ian Jackson @ 2016-07-20 13:19 ` Ian Jackson 2016-07-20 13:19 ` [OSSTEST PATCH 4/5] cr-ensure-disk-space: Run check_space before taking lock Ian Jackson 2016-07-20 13:19 ` [OSSTEST PATCH 5/5] mg-list-all-branches: Do not match ${BRANCHES+= ... } Ian Jackson 3 siblings, 0 replies; 5+ messages in thread From: Ian Jackson @ 2016-07-20 13:19 UTC (permalink / raw) To: xen-devel; +Cc: Ian Jackson Break out the df check into its own subroutine. iteration_proceed now becomes iteration_continue and doesn't return a booleanish. No functional change. Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com> --- cr-ensure-disk-space | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/cr-ensure-disk-space b/cr-ensure-disk-space index a1f838f..63e92f4 100755 --- a/cr-ensure-disk-space +++ b/cr-ensure-disk-space @@ -49,7 +49,20 @@ csreadconfig(); logs_select $cfgbase or exit 0; -open LOCK, "> $c{GlobalLockDir}/publish-lock" or die $!; +sub check_space () { + open P, "-|", onloghost "df --block-size=1M -P $logdir" or die $!; + $_= <P>; + m/^filesystem/i or die "$_ ?"; + $_= <P>; + m,^\S+\s+\d+\s+\d+\s+(\d+)\s+, or die "$_ ?"; + $!=0; $?=0; close P or die "$! $?"; + my $space= $1; + printf "space: %8d, wanted: %8d ", $space, logcfg('MinSpaceMby'); + return $space >= logcfg('MinSpaceMby'); +} + +my $lock = "$c{GlobalLockDir}/publish-lock"; +open LOCK, "> $lock" or die "$lock $!"; flock LOCK, LOCK_EX or die $!; $|=1; @@ -67,17 +80,7 @@ END our @flights; our %latestref; -sub iteration_continue () { - open P, "-|", onloghost "df --block-size=1M -P $logdir" or die $!; - $_= <P>; - m/^filesystem/i or die "$_ ?"; - $_= <P>; - m,^\S+\s+\d+\s+\d+\s+(\d+)\s+, or die "$_ ?"; - $!=0; $?=0; close P or die "$! $?"; - my $space= $1; - printf "space: %8d, wanted: %8d ", $space, logcfg('MinSpaceMby'); - return 0 if $space >= logcfg('MinSpaceMby'); - +sub iteration_proceed () { if (!@flights) { %latestref = (); open P, "-|", onloghost "ls -1 $logdir" or die $!; @@ -141,15 +144,13 @@ sub iteration_continue () { END printf "done.\n"; - - return 1; } db_retry($dbh_tests,[], sub { @flights = (); for (;;) { - iteration_continue() - or last; + last if check_space(); + iteration_continue(); } }); -- 2.1.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel ^ permalink raw reply related [flat|nested] 5+ messages in thread
* [OSSTEST PATCH 4/5] cr-ensure-disk-space: Run check_space before taking lock 2016-07-20 13:19 [OSSTEST PATCH 1/5] mfi-common: Break out set_hostos_runvars Ian Jackson 2016-07-20 13:19 ` [OSSTEST PATCH 2/5] mfi-common: Do not set di_version runvar to empty string in build jobs Ian Jackson 2016-07-20 13:19 ` [OSSTEST PATCH 3/5] cr-ensure-disk-space: Break out check_space Ian Jackson @ 2016-07-20 13:19 ` Ian Jackson 2016-07-20 13:19 ` [OSSTEST PATCH 5/5] mg-list-all-branches: Do not match ${BRANCHES+= ... } Ian Jackson 3 siblings, 0 replies; 5+ messages in thread From: Ian Jackson @ 2016-07-20 13:19 UTC (permalink / raw) To: xen-devel; +Cc: Ian Jackson This allows cr-ensure-disk-space to be a noop if there is enough space, even if run on a host which doesn't have access to the relevant lock directory. Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com> --- cr-ensure-disk-space | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cr-ensure-disk-space b/cr-ensure-disk-space index 63e92f4..2d299dd 100755 --- a/cr-ensure-disk-space +++ b/cr-ensure-disk-space @@ -61,6 +61,8 @@ sub check_space () { return $space >= logcfg('MinSpaceMby'); } +exit 0 if check_space; + my $lock = "$c{GlobalLockDir}/publish-lock"; open LOCK, "> $lock" or die "$lock $!"; flock LOCK, LOCK_EX or die $!; -- 2.1.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel ^ permalink raw reply related [flat|nested] 5+ messages in thread
* [OSSTEST PATCH 5/5] mg-list-all-branches: Do not match ${BRANCHES+= ... } 2016-07-20 13:19 [OSSTEST PATCH 1/5] mfi-common: Break out set_hostos_runvars Ian Jackson ` (2 preceding siblings ...) 2016-07-20 13:19 ` [OSSTEST PATCH 4/5] cr-ensure-disk-space: Run check_space before taking lock Ian Jackson @ 2016-07-20 13:19 ` Ian Jackson 3 siblings, 0 replies; 5+ messages in thread From: Ian Jackson @ 2016-07-20 13:19 UTC (permalink / raw) To: xen-devel; +Cc: Ian Jackson This is not valid shell syntax and should not appear. The confusion seems to have arisen because of the need for to match BRANCHES+=... (without the surrounding { }). This results in no change to the output. (I seem to have collected this patch some time ago as part of some fixes to mg-list-all-branches which have by now been applied, but not managed to write up and post this specific change.) Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> --- mg-list-all-branches | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mg-list-all-branches b/mg-list-all-branches index 62d3ff1..989b5ae 100755 --- a/mg-list-all-branches +++ b/mg-list-all-branches @@ -14,7 +14,7 @@ foreach my $f (qw(cr-for-branches crontab)) { open C, $f or die $!; while (<C>) { next unless - m/\$\{$branchvar_re[:+]?=()($branchchr_re+)\b/ || + m/\$\{$branchvar_re:=()($branchchr_re+)\b/ || m/$branchvar_re[:+]?=('?)($branchchr_re+?)\1\s/; $branches{$_}=1 foreach split /\s+/, $2; } -- 2.1.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel ^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-07-20 13:19 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2016-07-20 13:19 [OSSTEST PATCH 1/5] mfi-common: Break out set_hostos_runvars Ian Jackson 2016-07-20 13:19 ` [OSSTEST PATCH 2/5] mfi-common: Do not set di_version runvar to empty string in build jobs Ian Jackson 2016-07-20 13:19 ` [OSSTEST PATCH 3/5] cr-ensure-disk-space: Break out check_space Ian Jackson 2016-07-20 13:19 ` [OSSTEST PATCH 4/5] cr-ensure-disk-space: Run check_space before taking lock Ian Jackson 2016-07-20 13:19 ` [OSSTEST PATCH 5/5] mg-list-all-branches: Do not match ${BRANCHES+= ... } Ian Jackson
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).