[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [OSSTEST PATCH 1/2] Executive: Break out task_spec_desc (no functional change)



Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
---
 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@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.