xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Ian Jackson <ian.jackson@eu.citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Subject: [OSSTEST PATCH 09/11] mg-allocate: Support --progress-fd
Date: Tue, 18 Apr 2017 16:56:50 +0100	[thread overview]
Message-ID: <1492531012-14315-10-git-send-email-ian.jackson@eu.citrix.com> (raw)
In-Reply-To: <1492531012-14315-1-git-send-email-ian.jackson@eu.citrix.com>

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 mg-allocate | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/mg-allocate b/mg-allocate
index 87a4e71..2dfbdb1 100755
--- a/mg-allocate
+++ b/mg-allocate
@@ -57,6 +57,8 @@
 #
 #   --info-base=<info>  Replaces `manual' at start of info put into plan.
 #
+#   --progress-fd=<fd>  Print some brief progress messages to <fd>.
+#
 # <task-spec> must exist (and be in a format valid for OSSTEST_TASK).
 
 # This is part of "osstest", an automated testing framework for Xen.
@@ -83,6 +85,7 @@ unshift @INC, qw(.);
 use Osstest;
 use Osstest::TestSupport;
 use Osstest::Executive;
+use IO::Handle;
 
 csreadconfig();
 
@@ -450,6 +453,12 @@ sub plan () {
 	logm("best at $planned->{Start} is ".showposs(\@reqlist));
 	die unless $planned;
 
+        printf MGA_PROGRESS "%s %s @%d %s\n",
+            (show_abs_time time),
+            ($mayalloc && !$planned->{Start} ? "allocating" : "planned"),
+            $planned->{Start},
+            showposs(\@reqlist);
+
         my $worstok=0;
         if ($mayalloc && !$planned->{Start}) {
             $worstok=1;
@@ -501,6 +510,8 @@ sub plan () {
     loggot(@got);
 }
 
+open MGA_PROGRESS, ">/dev/null" or die $!;
+
 while (@ARGV && $ARGV[0] =~ m/^[-0-9]/) {
     $_= shift @ARGV;
     last if m/^\-\-?$/;
@@ -528,6 +539,9 @@ while (@ARGV && $ARGV[0] =~ m/^[-0-9]/) {
 	    $allocinfo_base = $1;
 	} elsif (s/^--stdout-output$/-/) {
 	    $stdout_output = 1;
+	} elsif (s/^--progress-fd=(\d+)$/-/) {
+            open MGA_PROGRESS, ">&$1" or die $!;
+            MGA_PROGRESS->autoflush(1);
         } else {
             die "bad option \`$_'";
         }
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  parent reply	other threads:[~2017-04-18 15:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-18 15:56 [OSSTEST PATCH 00/11] Coverity fix and mg-repro-setup improvements Ian Jackson
2017-04-18 15:56 ` [OSSTEST PATCH 01/11] TestSupport: Provide stashfilecontents Ian Jackson
2017-04-18 15:56 ` [OSSTEST PATCH 02/11] ts-coverity-upload: Pass HttpsProxyMITMCert to curl Ian Jackson
2017-04-18 15:56 ` [OSSTEST PATCH 03/11] truncation: Support globs, and multiple patterns Ian Jackson
2017-04-18 15:56 ` [OSSTEST PATCH 04/11] sg-run-job: Break out testid_matches_globs Ian Jackson
2017-04-18 15:56 ` [OSSTEST PATCH 05/11] sg-run-job: Start step a bit later Ian Jackson
2017-04-18 15:56 ` [OSSTEST PATCH 06/11] sg-run-job: Honour skip_testids runvar Ian Jackson
2017-04-18 15:56 ` [OSSTEST PATCH 07/11] mg-repro-setup: skip log capture (by default) Ian Jackson
2017-04-18 15:56 ` [OSSTEST PATCH 08/11] mg-allocate: Document --info-base in head comment Ian Jackson
2017-04-18 15:56 ` Ian Jackson [this message]
2017-04-18 15:56 ` [OSSTEST PATCH 10/11] mg-execute-flight: Support --progress-fd Ian Jackson
2017-04-18 15:56 ` [OSSTEST PATCH 11/11] mg-repro-setup: Use --progress-fd Ian Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1492531012-14315-10-git-send-email-ian.jackson@eu.citrix.com \
    --to=ian.jackson@eu.citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).