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

Re: [Xen-devel] [xen-unstable bisection] complete test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm



On Sun, Jan 19, 2020 at 03:17:13AM +0000, osstest service owner wrote:
> branch xen-unstable
> xenbranch xen-unstable
> job test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm
> testid debian-hvm-install
> 
> Tree: linux git://xenbits.xen.org/linux-pvops.git
> Tree: linuxfirmware git://xenbits.xen.org/osstest/linux-firmware.git
> Tree: qemu git://xenbits.xen.org/qemu-xen-traditional.git
> Tree: qemuu git://xenbits.xen.org/qemu-xen.git
> Tree: xen git://xenbits.xen.org/xen.git
> 
> *** Found and reproduced problem changeset ***
> 
>   Bug is in tree:  xen git://xenbits.xen.org/xen.git
>   Bug introduced:  aacc143006429de46932aabae17c13846c71fa45
>   Bug not present: 2572c7d76e1aee9b11a23c548cee69b15a35401f
>   Last fail repro: http://logs.test-lab.xenproject.org/osstest/logs/146234/
> 
> 
>   commit aacc143006429de46932aabae17c13846c71fa45
>   Author: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
>   Date:   Thu Jan 2 21:37:36 2020 +0000
>   
>       tools/libxl: Plumb domain_create_state down into libxl__build_pre()
>       
>       To fix CPUID handling, libxl__build_pre() is going to have to 
> distinguish
>       between a brand new VM vs one which is being migrated-in/resumed.
>       
>       No functional change.
>       
>       Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
>       Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>

The issue is that this change is passing the guest domain_create_state
to libxl__domain_build in libxl__spawn_stub_dm, and hence the
stubdomain doesn't get created. I have the following patch that fixes
it, but it's kind of dirty.

---8<---
From 688fde95992d07bb1123d324a68006dd08bc6512 Mon Sep 17 00:00:00 2001
From: Roger Pau Monne <roger.pau@xxxxxxxxxx>
Date: Tue, 21 Jan 2020 10:14:09 +0000
Subject: [PATCH] libxl: fix stubdomain creation after aacc143006429de
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

aacc143006429de broke stubdomain creation by passing the guest
domain_create_state to libxl__domain_build in libxl__spawn_stub_dm,
when it should instead be crafting a new domain_create_state for the
stubdomain.

Fixes: aacc143006429de ('tools/libxl: Plumb domain_create_state down into 
libxl__build_pre()')
Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
 tools/libxl/libxl_dm.c       | 22 +++++++++++++---------
 tools/libxl/libxl_internal.h |  3 +--
 2 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 3f08ccad1b..b1ddde77e8 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -2110,17 +2110,21 @@ void libxl__spawn_stub_dm(libxl__egc *egc, 
libxl__domain_create_state *dcs)
     xs_transaction_t t;
 
     /* convenience aliases */
-    libxl_domain_config *const dm_config = &sdss->dm_config;
     libxl_domain_config *const guest_config = sdss->dm.guest_config;
     const int guest_domid = sdss->dm.guest_domid;
     libxl__domain_build_state *const d_state = sdss->dm.build_state;
-    libxl__domain_build_state *const stubdom_state = &sdss->dm_state;
+    libxl__domain_build_state *stubdom_state;
+    libxl_domain_config *dm_config;
 
     /* Initialise private part of sdss */
-    libxl__domain_build_state_init(stubdom_state);
     dmss_init(&sdss->dm);
     dmss_init(&sdss->pvqemu);
     libxl__xswait_init(&sdss->xswait);
+    GCNEW(sdss->dcs);
+    stubdom_state = &sdss->dcs->build_state;
+    libxl__domain_build_state_init(stubdom_state);
+    GCNEW(sdss->dcs->guest_config);
+    dm_config = sdss->dcs->guest_config;
 
     if (guest_config->b_info.device_model_version !=
         LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL) {
@@ -2198,7 +2202,7 @@ void libxl__spawn_stub_dm(libxl__egc *egc, 
libxl__domain_create_state *dcs)
     if (ret)
         goto out;
     uint32_t dm_domid = sdss->pvqemu.guest_domid;
-    ret = libxl__domain_build(gc, dm_domid, dcs);
+    ret = libxl__domain_build(gc, dm_domid, sdss->dcs);
     if (ret)
         goto out;
 
@@ -2264,11 +2268,11 @@ static void spawn_stub_launch_dm(libxl__egc *egc,
     libxl__device_console *console;
 
     /* convenience aliases */
-    libxl_domain_config *const dm_config = &sdss->dm_config;
+    libxl_domain_config *const dm_config = sdss->dcs->guest_config;
     libxl_domain_config *const guest_config = sdss->dm.guest_config;
     const int guest_domid = sdss->dm.guest_domid;
     libxl__domain_build_state *const d_state = sdss->dm.build_state;
-    libxl__domain_build_state *const stubdom_state = &sdss->dm_state;
+    libxl__domain_build_state *const stubdom_state = &sdss->dcs->build_state;
     uint32_t dm_domid = sdss->pvqemu.guest_domid;
     int need_qemu;
 
@@ -2354,8 +2358,8 @@ static void spawn_stub_launch_dm(libxl__egc *egc,
 
     sdss->pvqemu.spawn.ao = ao;
     sdss->pvqemu.guest_domid = dm_domid;
-    sdss->pvqemu.guest_config = &sdss->dm_config;
-    sdss->pvqemu.build_state = &sdss->dm_state;
+    sdss->pvqemu.guest_config = sdss->dcs->guest_config;
+    sdss->pvqemu.build_state = &sdss->dcs->build_state;
     sdss->pvqemu.callback = spawn_stubdom_pvqemu_cb;
 
     if (!need_qemu) {
@@ -2464,7 +2468,7 @@ static void stubdom_xswait_cb(libxl__egc *egc, 
libxl__xswait_state *xswait,
     if (strcmp(p, "running"))
         return;
  out:
-    libxl__domain_build_state_dispose(&sdss->dm_state);
+    libxl__domain_build_state_dispose(&sdss->dcs->build_state);
     libxl__xswait_stop(gc, xswait);
     dmss_dispose(gc, &sdss->dm);
     dmss_dispose(gc, &sdss->pvqemu);
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index d919f91882..abf88dfd76 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -4102,8 +4102,7 @@ typedef struct {
     /* filled in by user, must remain valid: */
     libxl__dm_spawn_cb *callback; /* called as callback(,&sdss->dm,) */
     /* private to libxl__spawn_stub_dm: */
-    libxl_domain_config dm_config;
-    libxl__domain_build_state dm_state;
+    libxl__domain_create_state *dcs;
     libxl__dm_spawn_state pvqemu;
     libxl__destroy_domid_state dis;
     libxl__multidev multidev;
-- 
2.25.0


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

 


Rackspace

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