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

Re: [Xen-devel] [RFC PATCH v2 07/17] libxl: add save/restore support for qemu-xen in stubdomain



On Thu, Nov 01, 2018 at 05:11:21PM +0000, Ian Jackson wrote:
> Marek Marczykowski-Górecki writes ("[RFC PATCH v2 07/17] libxl: add 
> save/restore support for qemu-xen in stubdomain"):
> > Rely on a wrapper script in stubdomain to attach FD 3/4 of qemu to
> > relevant consoles.
> ...
> >      if (state->saved_state) {
> > -        /* This file descriptor is meant to be used by QEMU */
> > -        *dm_state_fd = open(state->saved_state, O_RDONLY);
> > -        flexarray_append(dm_args, "-incoming");
> > -        flexarray_append(dm_args, GCSPRINTF("fd:%d",*dm_state_fd));
> > +        if (is_stubdom) {
> > +            /* Linux stubdomain connects specific FD to 
> > STUBDOM_CONSOLE_RESTORE
> > +             */
> > +            flexarray_append(dm_args, "-incoming");
> > +            flexarray_append(dm_args, "fd:3");
> 
> I think this hardcoded fd is troublesome.  For example, we don't have
> anywhere to write down the list of hardcoded fds being used like this.
> I mean, libxl and the Linux qemu stubdom wrapper script are allowed to
> cooperate, but at least this needs a clear comment in the wrapper
> script, and a reference here to the in-tree location of the script.

This is exactly what I'm writing about in cover letter. And indeed some
#define would be helpful here.

> I'm missing the code which is transfers the data from the
> state->saved_state to the console.  Am I just being dim ?

This is done by existing code by connecting STUBDOM_CONSOLE_RESTORE to
that file. See libxl_dm.c:spawn_stub_launch_dm.

> > diff --git a/tools/libxl/libxl_dom_suspend.c 
> > b/tools/libxl/libxl_dom_suspend.c
> ...
> >          /* Save DM state into filename */
> > +        if (dm_domid) {
> > +            /* if DM is in stubdomain, instruct it to use console, which is
> > +             * connected to a file pointed by filename */
> > +            filename = "/proc/self/fd/4";
> 
> Same comment (mutatis mutandi).
> 
> Ian.

-- 
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

Attachment: signature.asc
Description: PGP signature

_______________________________________________
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®.