From 4c4aa20a098af9b1daf1e674ded8e863dfa513aa Mon Sep 17 00:00:00 2001 From: Roger Pau Monne Date: Wed, 13 Jun 2018 09:40:13 +0200 Subject: [PATCH] osstest: introduce host_shared_mark_ready MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit That allows marking a host as ready to be shared. Replace the current callers that open-code it. This commit also fixes a bug where Ident was used instead of 'host' as resource. Signed-off-by: Roger Pau Monné Acked-by: Ian Jackson --- Changes since v4: - New in this version. --- Osstest/TestSupport.pm | 9 ++++++++- ts-freebsd-host-install | 4 ++-- ts-xen-build-prep | 4 ++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm index 8799712..69aed2f 100644 --- a/Osstest/TestSupport.pm +++ b/Osstest/TestSupport.pm @@ -136,7 +136,7 @@ BEGIN { guest_editconfig_nocd host_install_postboot_complete target_core_dump_setup - sha256file + sha256file host_shared_mark_ready ); %EXPORT_TAGS = ( ); @@ -2844,4 +2844,11 @@ sub sha256file ($;$) { return $truncate ? substr($digest, 0, $truncate) : $digest; } +sub host_shared_mark_ready($$) { + my ($ho,$sharetype) = @_; + + $mjobdb->jobdb_resource_shared_mark_ready('host', $ho->{Name}, + $sharetype); +} + 1; diff --git a/ts-freebsd-host-install b/ts-freebsd-host-install index 984bdf0..357c0b7 100755 --- a/ts-freebsd-host-install +++ b/ts-freebsd-host-install @@ -279,5 +279,5 @@ setup_netboot_local($ho); # Proceed with the install install(); -resource_shared_mark_ready($ho, "build-freebsd-". - sha256file("$path_prefix/install.img", 16)); +host_shared_mark_ready($ho, "build-freebsd-". + sha256file("$path_prefix/install.img", 16)); diff --git a/ts-xen-build-prep b/ts-xen-build-prep index 3309216..bff5c92 100755 --- a/ts-xen-build-prep +++ b/ts-xen-build-prep @@ -274,5 +274,5 @@ if (!$ho->{Flags}{'no-reinstall'}) { ccache_setup(); gitcache_setup(); } -$mjobdb->jobdb_resource_shared_mark_ready - ($ho->{Ident}, $ho->{Name}, "build-".$ho->{Suite}."-".$r{arch}); + +host_shared_mark_ready($ho, "build-".$ho->{Suite}."-".$r{arch}); -- 2.39.5