diff mbox series

[v5,14/21] libxl: require qemu in dom0 even if stubdomain is in use

Message ID 20200428040433.23504-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 April 28, 2020, 4:04 a.m. UTC
From: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>

Until xenconsoled learns how to handle multiple consoles, this is needed
for save/restore support (qemu state is transferred over secondary
consoles).
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>
Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
---
 tools/libxl/libxl_dm.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

Comments

Ian Jackson May 14, 2020, 4:42 p.m. UTC | #1
Jason Andryuk writes ("[PATCH v5 14/21] libxl: require qemu in dom0 even if stubdomain is in use"):
> From: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
> 
> Until xenconsoled learns how to handle multiple consoles, this is needed
> for save/restore support (qemu state is transferred over secondary
> consoles).
> 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>
> Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
> ---
>  tools/libxl/libxl_dm.c | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
> index e420c3fc7b..5e5e7a27b3 100644
> --- a/tools/libxl/libxl_dm.c
> +++ b/tools/libxl/libxl_dm.c
> @@ -2484,7 +2484,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);

But I don't think this is true for a trad non-linux stubdm ?
So I think this ought to be conditional.

What am I missing ?

Regards,
Ian.
Marek Marczykowski-Górecki May 14, 2020, 5:36 p.m. UTC | #2
On Thu, May 14, 2020 at 05:42:36PM +0100, Ian Jackson wrote:
> Jason Andryuk writes ("[PATCH v5 14/21] libxl: require qemu in dom0 even if stubdomain is in use"):
> > From: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
> > 
> > Until xenconsoled learns how to handle multiple consoles, this is needed
> > for save/restore support (qemu state is transferred over secondary
> > consoles).
> > 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>
> > Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
> > ---
> >  tools/libxl/libxl_dm.c | 12 ++++++++++--
> >  1 file changed, 10 insertions(+), 2 deletions(-)
> > 
> > diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
> > index e420c3fc7b..5e5e7a27b3 100644
> > --- a/tools/libxl/libxl_dm.c
> > +++ b/tools/libxl/libxl_dm.c
> > @@ -2484,7 +2484,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);
> 
> But I don't think this is true for a trad non-linux stubdm ?
> So I think this ought to be conditional.

For qemu-trad is true too. Stubdomain (mini-os + qemu-trad and linux +
qemu-xen) is always started with at least 3 consoles: log, save,
restore. Which currently requires qemu in dom0. So, yes, technically it
is a bug in the current libxl for qemu-trad. 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.
diff mbox series

Patch

diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index e420c3fc7b..5e5e7a27b3 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -2484,7 +2484,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;
@@ -2616,7 +2620,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;