In 7f49abaa0ff91d6dc1592ea80f10211c52fb03c4
  arch replumbing: Replace many $r{arch} with $[g]ho->{Arch}
I accidentally broke this, by not spotting that the perl fragment
did not call selecthost and has no $ho.

Fix this as follows:
  * Pass all of the -try-append arguments to the perl rune.
  * Include a simple replica of the arg parsing of
    ts-freebsd-host-install (notably, we don't parse options,
    and instead assume the host comes last).
  * Call selecthost.

Compared to the situation prior to 7f49abaa0ff9, we now check that the
host is allocated to us, etc., before looking at what arch the job
specifies.  Additionally, we would now honour host_arch if it were
different to arch.  (Currently, it isn't.)

CC: Roger Pau Monné <roy...@freebsd.org>
Signed-off-by: Ian Jackson <ian.jack...@eu.citrix.com>
---
 ts-memdisk-try-append | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/ts-memdisk-try-append b/ts-memdisk-try-append
index 2fe18f45..4b54eff0 100755
--- a/ts-memdisk-try-append
+++ b/ts-memdisk-try-append
@@ -23,8 +23,13 @@ arch=`perl -I. -e '
                 use Osstest::TestSupport;
 
                 tsreadconfig();
+
+               our $whhost = pop @ARGV; # arg parsing bodge
+               $whhost ||= "host";
+               our $ho = selecthost($whhost);
+
                 print $ho->{Arch} or die $!;
-              '`
+              ' "$@"`
 
 case "$arch" in
 amd64)
-- 
2.11.0


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

Reply via email to