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 1/2] Executive: Break out task_spec_desc (no functional change)
Date: Thu, 6 Oct 2016 17:35:49 +0100	[thread overview]
Message-ID: <1475771750-12776-1-git-send-email-ian.jackson@eu.citrix.com> (raw)

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 Osstest/Executive.pm | 25 +++++++++++++++++--------
 1 file changed, 17 insertions(+), 8 deletions(-)

diff --git a/Osstest/Executive.pm b/Osstest/Executive.pm
index 137eb44..14f75b3 100644
--- a/Osstest/Executive.pm
+++ b/Osstest/Executive.pm
@@ -45,7 +45,7 @@ BEGIN {
     $VERSION     = 1.00;
     @ISA         = qw(Exporter);
     @EXPORT      = qw(grabrepolock_reexec
-                      findtask findtask_spec @all_lock_tables
+                      task_spec_desc findtask findtask_spec @all_lock_tables
                       restrictflight_arg restrictflight_cond
                       report_run_getinfo report_altcolour
                       report_altchangecolour
@@ -524,6 +524,20 @@ END
 
 our $taskid;
 
+sub task_spec_desc ($) {
+    my ($row) = @_; # NB row maybe modifed, to fill in username and comment
+    # => ($newspec, $desc);
+
+    foreach my $k (qw(username comment)) {
+        next if defined $row->{$k};
+        $row->{$k}= "[no $k]";
+    }
+
+    my $newspec = "$row->{taskid} $row->{type} $row->{refkey}";
+    my $desc = "$row->{username} $row->{comment}";
+    return ($newspec,$desc);
+}
+
 sub findtask_spec ($$) {
     my ($spec, $why) = @_;
 
@@ -556,13 +570,8 @@ END
     die "task $what dead" unless $row->{live};
     $q->finish();
 
-    foreach my $k (qw(username comment)) {
-        next if defined $row->{$k};
-        $row->{$k}= "[no $k]";
-    }
-
-    my $newspec= "$row->{taskid} $row->{type} $row->{refkey}";
-    logm("${why}task $newspec: $row->{username} $row->{comment}");
+    my ($newspec, $desc) = task_spec_desc($row);
+    logm("${why}task $newspec: $desc");
 
     $taskid= $row->{taskid};
 
-- 
2.1.4


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

             reply	other threads:[~2016-10-06 16:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-06 16:35 Ian Jackson [this message]
2016-10-06 16:35 ` [OSSTEST PATCH 2/2] mg-allocate: Provide command line way to list allocated resources 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=1475771750-12776-1-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).