cr-ensure-disk-space: Fix reference to iteration_proceed
PATCH 1/3 cr-ensure-disk-space: Fix reference to iteration_proceed
8738d60622c1 "cr-ensure-disk-space: Break out check_space" renamed iteration_continue to iteration_proceed but did not change the call site.
Signed-off-by Ian Jackson <[email protected]>
--- cr-ensure-disk-space | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
cr-ensure-disk-space +1 -1
@@ -152,7 +152,7 @@ db_retry($dbh_tests,[], sub { @flights = (); for (;;) { last if check_space(); - iteration_continue(); + iteration_proceed(); } });
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
PATCH 2/3 cr-ensure-disk-space: Break out quit_ok
We are going to want another call site.
No functional change.
Signed-off-by Ian Jackson <[email protected]>
--- cr-ensure-disk-space | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
cr-ensure-disk-space +8 -2
@@ -61,6 +61,13 @@ sub check_space () { return $space >= logcfg('MinSpaceMby'); } +sub quit_ok () { + printf "ok.\n"; + exit 0; +} + +$|=1; + exit 0 if check_space; my $lock = "$c{GlobalLockDir}/publish-lock";
@@ -156,5 +163,4 @@ db_retry($dbh_tests,[], sub { } }); -printf "ok.\n"; -exit 0; +quit_ok();
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
PATCH 3/3 cr-ensure-disk-space: Correct stdout output
In reply to Ian Jacksond221996eea64 "cr-ensure-disk-space: Run check_space before taking lock" introduced an additional call to check_space but check_space prints the start of a message (with no newline) expecting iteration_proceed to print the rest.
Move $|=1 up appropriately and add a couple of messages in the right place. This involves calling quit_ok rather than exit 0.
Signed-off-by Ian Jackson <[email protected]>
--- cr-ensure-disk-space | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
cr-ensure-disk-space +4 -2
@@ -68,13 +68,15 @@ sub quit_ok () { $|=1; -exit 0 if check_space; +check_space if check_space; + +print "taking lock..."; my $lock = "$c{GlobalLockDir}/publish-lock"; open LOCK, "> $lock" or die "$lock $!"; flock LOCK, LOCK_EX or die $!; -$|=1; +print "proceeding...\n"; my $chkq= db_prepare("SELECT * FROM flights WHERE flight=?");
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel