]> xenbits.xensource.com Git - people/iwj/osstest.git/commitdiff
selecthost: Minor cleanups
authorIan Jackson <ian.jackson@eu.citrix.com>
Fri, 25 Sep 2015 16:19:35 +0000 (17:19 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Fri, 13 Nov 2015 12:42:12 +0000 (12:42 +0000)
Document the syntax for $ident.

Log the ident as well as the selected hostname.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Tested-by: Robert Ho <robert.hu@intel.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
v17: Fix typo in doc message.
v14: New patch

Osstest/TestSupport.pm

index aa41952e0141ddd3169bf44345d58545d1dca50e..8c3612c872e22360d3c8a7b0236e2b95d6044967 100644 (file)
@@ -810,6 +810,20 @@ sub power_state ($$) {
 sub selecthost ($) {
     my ($ident) = @_;
     # must be run outside transaction
+
+    # $ident is <identspec>
+    #
+    # <identspec> can be <ident>, typically "host" or "xxx_host"
+    # which means look up the runvar $r{$ident} which
+    # contains <hostspec>
+    # OR
+    # <identspec> can be <ident>=<hostspec>
+    # which means ignore <ident> except for logging purposes etc.
+    # and use <hostspec>
+    #
+    # <hostspec> is <hostname> which means use that host (and all
+    # its flags and properties from the configuration and database)
+
     my $name;
     if ($ident =~ m/=/) {
         $ident= $`;
@@ -917,7 +931,7 @@ sub selecthost ($) {
 
     $mjobdb->host_check_allocated($ho);
 
-    logm("host: selected $ho->{Name} ".
+    logm("host $ho->{Ident}: selected $ho->{Name} ".
         (defined $ho->{Ether} ? $ho->{Ether} : '<unknown-ether>').
         " $ho->{Ip}".
          (!$ho->{Shared} ? '' :