All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Andryuk <jandryuk@gmail.com>
To: Ian Jackson <ian.jackson@citrix.com>
Cc: "Anthony Perard" <anthony.perard@citrix.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	"Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>,
	"Wei Liu" <wl@xen.org>
Subject: Re: [PATCH v5 09/21] libxl: add save/restore support for qemu-xen in stubdomain [and 1 more messages]
Date: Mon, 18 May 2020 11:48:44 -0400	[thread overview]
Message-ID: <CAKf6xpvdSb=fSebzpHaLb1F9zNqsUn3dA03wYoXaZtxSLn0K+w@mail.gmail.com> (raw)
In-Reply-To: <24258.42794.136081.367565@mariner.uk.xensource.com>

On Mon, May 18, 2020 at 11:18 AM Ian Jackson <ian.jackson@citrix.com> wrote:
>
> >
> Marek Marczykowski-Górecki writes ("Re: [PATCH v5 09/21] libxl: add save/restore support for qemu-xen in stubdomain"):
> > On Mon, May 18, 2020 at 03:15:17PM +0100, Ian Jackson wrote:
> > > Err, by "the qemu savefile pathname" I meant the pathname in dom0.
> > > I assume your wrapper script opens that and feeds it to the console.
> > > Is that right ?
> >
> > Not really a wrapper script. On dom0 side it is console backend (qemu)
> > instructed to connect the console to a file, instead of pty. I have
> > implemented similar feature in my xenconsoled patch series sent a while
> > ago (sent along with v2 of this series), but that series needs some more
> > love.
> >
> > On the stubdomain side, it is a script that launches qemu - opens a
> > /dev/hvc2, then pass the FD to qemu via -incoming option (which is
> > really constructed by libxl).
>
> Hi.  Thanks for trying to help me understand.  I was still confused
> though.  I tried to explain another way and that helped me see what's
> going on.
>
> I think I understand now.
>
> For reference, my confusion was this:
>
> Jason Andryuk writes ("[PATCH v5 09/21] libxl: add save/restore support for qemu-xen in stubdomain"):
> > index bdc23554eb..45d0dd56f5 100644
> > --- a/tools/libxl/libxl_dm.c
> > +++ b/tools/libxl/libxl_dm.c
> > @@ -1744,10 +1744,17 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
> >      }
> >
> >      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");
> > +        } else {
> > +            /* 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));
> > +        }
>
> In this hunk, the call
>            *dm_state_fd = open(state->saved_state, O_RDONLY);
> becomes conditional.  It is no longer executed in the stubdomain
> case.
>
> So then, who opens state->saved_state ?  And how do they get told
> where it is ?  If it's somewhere else in libxl, why doesn't it show up
> in this patch ?
>
> Posing the question liked that allowed me to see that the answer is
>
>            console[i].output = GCSPRINTF("file:%s",
>                            libxl__device_model_savefile(gc, guest_domid));
>
> in spawn_stub_launch_dm.  And it doesn't appear in the patch because
> it's already used for minios stub trad qemu and the same code is
> now going to be executed for linux stub moderm qemu.

Do you want the commit message to add a blurb about this?  So the
message becomes:
"""
Rely on a wrapper script in stubdomain to attach relevant consoles to
qemu.  The save console (1) must be attached to fdset/1.  When
performing a restore, $STUBDOM_RESTORE_INCOMING_ARG must be replaced on
the qemu command line by "fd:$FD", where $FD is an open file descriptor
number to the restore console (2).

Existing libxl code (for dom0) already connects the stubdom's save &
restore console outputs to the save & restore files.
"""

-Jason


  reply	other threads:[~2020-05-18 15:49 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-28  4:04 [PATCH v5 00/21] Add support for qemu-xen runnning in a Linux-based stubdomain Jason Andryuk
2020-04-28  4:04 ` [PATCH v5 01/21] Document ioemu MiniOS stubdomain protocol Jason Andryuk
2020-05-14 16:08   ` Ian Jackson
2020-04-28  4:04 ` [PATCH v5 02/21] Document ioemu Linux " Jason Andryuk
2020-05-14 16:08   ` Ian Jackson
2020-04-28  4:04 ` [PATCH v5 03/21] libxl: fix qemu-trad cmdline for no sdl/vnc case Jason Andryuk
2020-04-28  4:04 ` [PATCH v5 04/21] libxl: Allow running qemu-xen in stubdomain Jason Andryuk
2020-05-14 16:10   ` Ian Jackson
2020-04-28  4:04 ` [PATCH v5 05/21] libxl: Handle Linux stubdomain specific QEMU options Jason Andryuk
2020-05-14 16:19   ` Ian Jackson
2020-05-17 13:55     ` Jason Andryuk
2020-04-28  4:04 ` [PATCH v5 06/21] libxl: write qemu arguments into separate xenstore keys Jason Andryuk
2020-05-14 16:25   ` Ian Jackson
2020-05-17 14:29     ` Jason Andryuk
2020-04-28  4:04 ` [PATCH v5 07/21] xl: add stubdomain related options to xl config parser Jason Andryuk
2020-05-14 16:26   ` Ian Jackson
2020-04-28  4:04 ` [PATCH v5 08/21] tools/libvchan: notify server when client is connected Jason Andryuk
2020-05-14 16:27   ` Ian Jackson
2020-04-28  4:04 ` [PATCH v5 09/21] libxl: add save/restore support for qemu-xen in stubdomain Jason Andryuk
2020-05-14 16:35   ` Ian Jackson
2020-05-17 13:55     ` Jason Andryuk
2020-05-18 14:15       ` Ian Jackson
2020-05-18 14:50         ` Marek Marczykowski-Górecki
2020-05-18 15:18           ` [PATCH v5 09/21] libxl: add save/restore support for qemu-xen in stubdomain [and 1 more messages] Ian Jackson
2020-05-18 15:48             ` Jason Andryuk [this message]
2020-05-18 16:37               ` Ian Jackson
2020-04-28  4:04 ` [PATCH v5 10/21] tools: add missing libxenvchan cflags Jason Andryuk
2020-05-14 16:35   ` Ian Jackson
2020-04-28  4:04 ` [PATCH v5 11/21] tools: add simple vchan-socket-proxy Jason Andryuk
2020-05-14 16:37   ` Ian Jackson
2020-04-28  4:04 ` [PATCH v5 12/21] libxl: use vchan for QMP access with Linux stubdomain Jason Andryuk
2020-05-14 16:39   ` Ian Jackson
2020-04-28  4:04 ` [PATCH v5 13/21] Regenerate autotools files Jason Andryuk
2020-05-14 16:41   ` Ian Jackson
2020-04-28  4:04 ` [PATCH v5 14/21] libxl: require qemu in dom0 even if stubdomain is in use Jason Andryuk
2020-05-14 16:42   ` Ian Jackson
2020-05-14 17:36     ` Marek Marczykowski-Górecki
2020-04-28  4:04 ` [PATCH v5 15/21] libxl: ignore emulated IDE disks beyond the first 4 Jason Andryuk
2020-05-14 16:43   ` Ian Jackson
2020-04-28  4:04 ` [PATCH v5 16/21] libxl: consider also qemu in stubdomain in libxl__dm_active check Jason Andryuk
2020-05-14 16:43   ` Ian Jackson
2020-04-28  4:04 ` [PATCH v5 17/21] docs: Add device-model-domid to xenstore-paths Jason Andryuk
2020-05-14 16:44   ` Ian Jackson
2020-04-28  4:04 ` [PATCH v5 18/21] libxl: Check stubdomain kernel & ramdisk presence Jason Andryuk
2020-05-14 16:45   ` Ian Jackson
2020-04-28  4:04 ` [PATCH v5 19/21] libxl: Refactor kill_device_model to libxl__kill_xs_path Jason Andryuk
2020-05-14 16:45   ` Ian Jackson
2020-04-28  4:04 ` [PATCH v5 20/21] libxl: Kill vchan-socket-proxy when cleaning up qmp Jason Andryuk
2020-05-14 16:47   ` Ian Jackson
2020-04-28  4:04 ` [PATCH v5 21/21] tools: Clean up vchan-socket-proxy socket Jason Andryuk
2020-05-14 16:48   ` Ian Jackson
2020-05-11 20:19 ` [PATCH v5 00/21] Add support for qemu-xen runnning in a Linux-based stubdomain Jason Andryuk
2020-05-14 16:07 ` Ian Jackson
2020-05-14 16:55 ` Ian Jackson
2020-05-14 19:10   ` Jason Andryuk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAKf6xpvdSb=fSebzpHaLb1F9zNqsUn3dA03wYoXaZtxSLn0K+w@mail.gmail.com' \
    --to=jandryuk@gmail.com \
    --cc=anthony.perard@citrix.com \
    --cc=ian.jackson@citrix.com \
    --cc=marmarek@invisiblethingslab.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.