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

[Xen-devel] [PATCH v5 12/17] osstest: add support for runtime_IDENT_hostflags



This is required for FreeBSD, that will need to set some of the
hostflags at runtime. The current IDENT_hostflags will be keep as-is,
and they should only be set at job creation time.

Also introduce a helper to set the runtime hostflags.

Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
Changes since v4:
 - Allow runtime flags to be appended instead of overwritten.

Changes since v3:
 - New in this version.
---
 Osstest/TestSupport.pm | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index 2928a6fa..16cf1fe3 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -78,7 +78,7 @@ BEGIN {
 
                       selecthost get_hostflags get_host_property
                       get_target_property get_host_native_linux_console
-                      hostnamepath hostnamepath_list
+                      hostnamepath hostnamepath_list set_runtime_hostflag
                       power_state power_cycle power_cycle_sleep
                       serial_fetch_logs
                       propname_massage propname_check
@@ -1584,10 +1584,20 @@ sub get_hostflags ($) {
     my ($ident) = @_;
     # may be run outside transaction, or with flights locked
     my $flags= get_runvar_default('all_hostflags',     $job, '').','.
-               get_runvar_default("${ident}_hostflags", $job, '');
+               get_runvar_default("${ident}_hostflags", $job, '').','.
+               get_runvar_default("runtime_${ident}_hostflags", $job, '');
     return grep /./, split /\,/, $flags;
 }
 
+sub set_runtime_hostflag ($$) {
+    my ($ident,$value) = @_;
+    my @current = split /,/, get_runvar_default("runtime_${ident}_hostflags",
+                                                $job, '');
+
+    push @current, (split /,/, $value);
+    store_runvar("runtime_${ident}_hostflags", (join ',', @current));
+}
+
 sub host_involves_pcipassthrough ($) {
     my ($ho) = @_;
     return !!grep m/^pcipassthrough\-/, get_hostflags($ho->{Ident});
-- 
2.11.0 (Apple Git-81)


_______________________________________________
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®.