diff mbox series

[v6,14/18] libxl: require qemu in dom0 for multiple stubdomain consoles

Message ID 20200518011353.326287-15-jandryuk@gmail.com (mailing list archive)
State Superseded
Headers show
Series Add support for qemu-xen runnning in a Linux-based stubdomain | expand

Commit Message

Jason Andryuk May 18, 2020, 1:13 a.m. UTC
From: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>

Device model stubdomains (both Mini-OS + qemu-trad and linux + qemu-xen)
are always started with at least 3 consoles: log, save, and restore.
Until xenconsoled learns how to handle multiple consoles, this is needed
for save/restore support.

For Mini-OS stubdoms, this is a bug.  In practice, it works in most
cases because there is something else that triggers qemu in dom0 too:
vfb/vkb added if vnc/sdl/spice is enabled.

Additionally, Linux-based stubdomain waits for all the backends to
initialize during boot. Lack of some console backends results in
stubdomain startup timeout.

This is a temporary patch until xenconsoled will be improved.

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
[Updated commit message with Marek's explanation from mailing list.]
Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
---
Changes in v6
 - Update commit message
---
 tools/libxl/libxl_dm.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

Comments

Ian Jackson May 18, 2020, 2:27 p.m. UTC | #1
Jason Andryuk writes ("[PATCH v6 14/18] libxl: require qemu in dom0 for multiple stubdomain consoles"):
> From: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
> 
> Device model stubdomains (both Mini-OS + qemu-trad and linux + qemu-xen)
> are always started with at least 3 consoles: log, save, and restore.
> Until xenconsoled learns how to handle multiple consoles, this is needed
> for save/restore support.
> 
> For Mini-OS stubdoms, this is a bug.  In practice, it works in most
> cases because there is something else that triggers qemu in dom0 too:
> vfb/vkb added if vnc/sdl/spice is enabled.
> 
> Additionally, Linux-based stubdomain waits for all the backends to
> initialize during boot. Lack of some console backends results in
> stubdomain startup timeout.
> 
> This is a temporary patch until xenconsoled will be improved.

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
diff mbox series

Patch

diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index c66e8ebc24..fb87deae91 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -2504,7 +2504,11 @@  static void spawn_stub_launch_dm(libxl__egc *egc,
         }
     }
 
-    need_qemu = libxl__need_xenpv_qemu(gc, dm_config);
+    /*
+     * Until xenconsoled learns how to handle multiple consoles, require qemu
+     * in dom0 to serve consoles for a stubdomain - it require at least 3 of them.
+     */
+    need_qemu = 1 || libxl__need_xenpv_qemu(gc, &sdss->dm_config);
 
     for (i = 0; i < num_console; i++) {
         libxl__device device;
@@ -2636,7 +2640,11 @@  static void qmp_proxy_spawn_outcome(libxl__egc *egc,
                                     int rc)
 {
     STATE_AO_GC(sdss->qmp_proxy_spawn.ao);
-    int need_pvqemu = libxl__need_xenpv_qemu(gc, &sdss->dm_config);
+    /*
+     * Until xenconsoled learns how to handle multiple consoles, require qemu
+     * in dom0 to serve consoles for a stubdomain - it require at least 3 of them.
+     */
+    int need_pvqemu = 1 || libxl__need_xenpv_qemu(gc, &sdss->dm_config);
 
     if (rc) goto out;