xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: "Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>
To: Ian Jackson <ian.jackson@citrix.com>
Cc: Simon Gaiser <simon@invisiblethingslab.com>,
	xen-devel@lists.xenproject.org,
	Anthony PERARD <anthony.perard@citrix.com>,
	Wei Liu <wei.liu2@citrix.com>, Eric Shelton <eshelton@pobox.com>
Subject: Re: [RFC PATCH v2 00/17] Add support for qemu-xen runnning in a Linux-based stubdomain.
Date: Thu, 1 Nov 2018 18:32:07 +0100	[thread overview]
Message-ID: <20181101173207.GB1638@mail-itl> (raw)
In-Reply-To: <23515.12398.298018.490061@mariner.uk.xensource.com>


[-- Attachment #1.1: Type: text/plain, Size: 4707 bytes --]

On Thu, Nov 01, 2018 at 04:57:18PM +0000, Ian Jackson wrote:
> Marek Marczykowski-Górecki writes ("Re: [RFC PATCH v2 00/17] Add support for qemu-xen runnning in a Linux-based stubdomain."):
> > All the xenconsoled stuff is unchanged (and unlikely to change), so it
> > should be safe to review it. Patches 06 and 07 also shouldn't change.
> 
> Sorry, I missed this reply.  I will go on to review those.
> 
> > The thing that will change is qemu cmdline and qmp handling. TBH I'm not sure
> > if its better to touch qmp now, or after reworked qmp handling by
> > Anthony will be merged. There will definitely be some conflicts and it
> > may even affects what underlying mechanism is chosen for qmp transport.
> > Based on discussion here, and in libxl__ev_qmp_* thread, I see two
> > viable options:
> > 
> > 1. libvchan
> >   pros:
> >    - out of band reset support, so qmp capabilities negotiation can be
> >      handled gracefully
> >   cons:
> >    - more work, require patching qemu (or adding vchan->socket proxy),
> >      adds dependency on libvchan to libxl (probably not a problem)
> >    - possibly more complex libxl__ev_qmp_* handling, or at least needs
> >      separate handling of send/receive for stubdomain case
> 
> I think that the changes to libxl__ev_qmp_* will be relatively
> self-contained, particularly after Anthony's async rework.  There's
> one place where the communication occurs.
> 
> Does libvchan offer asynchronous connection (ie, connect/disconnect
> calls which cannot be stalled by the peer, but which instead allow
> poll/select-based async) ?  I think it may not, in which case we need
> a vchan to socket proxy anyway.

libxenvchan_server_init is asynchronous. libxenvchan_client_init is too,
but it fails if called before server is ready. I have a
wrapper[1] around libxenvchan_client_init in Qubes code which solve this
problem with xs_watch. "libvchan: create xenstore entries in one
transaction" patch is related to that wrapper.

Maybe it should be also added to libxenvchan? Right now it only waits
(synchronously) for server to appear (using while(...) xs_read_watch()).
This is slightly more complex, as it also handle remote domain death
before establishing connection as well as save+restore local domain.
But it can be provided as a separate function like
libxenvchan_client_wait_for_server or such.

Providing a function that could be used in libxl would be more complex,
as it needs to integrate with libxl async API. Maybe it could use
good old trick with separate thread + pipe() for signaling readiness?
This way, the libxenvchan_client_wait_for_server would start separate
thread (using own xenstore connection) and return fd that libxl can wait
on. No need to convert libxenvchan_client_wait_for_server into callback
hell...

[1] https://github.com/QubesOS/qubes-core-vchan-xen/blob/master/vchan/init.c#L58-L168

> Aside from that the libxl dependency is untroublesome.
> 
> > 2. pv console
> >   pros:
> >    - no qemu modifications
> >    - same read()/write() on libxl side
> >   cons:
> >    - no out of band reset, needs libxl handling for that (skipping
> >      negotiation)
> 
> Doesn't this potentially mean that the qmp console connection can
> become irrecoverably desynchronised ?  I don't know how you would
> recover from the situation where another libxl process had got halfway
> through some qmp stuff and been terminated (for whatever reason; maybe
> the calling toolstack crashed).

That's right, it could result in irrecoverably desynchronised
connection. So, we need out of band reset.

> >    - possibly other problems from that (events filling up some buffers
> >      when no one is listening?)
> 
> xenconsole drops things in this situation.  I think that may result in
> desynchronisation.
> 
> > BTW Does libxl listed for qmp events?
> 
> Not right now.  It may want to in future.  Anthony's qmp series
> discards events.
> 
> > There is also third option: xenstore, but that would probably require
> > totally separate libxl__ev_qmp_* implementation, so I'd rule it out.
> 
> That's not a terrible idea but I can't see it being popular with qemu
> upstream, so you'd end up writing a kind of bidirectional
> qmp<->xenstore proxy.  Urgh.

Well, I do that already (for pci-ins). In bash.

> > If problems with pv console could be solved, I'd go this way. But
> > otherwise libvchan seems like a good alternative.
> 
> Yes.
> 
> 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 #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 157 bytes --]

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

  reply	other threads:[~2018-11-01 17:32 UTC|newest]

Thread overview: 85+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-07  2:16 [RFC PATCH v2 00/17] Add support for qemu-xen runnning in a Linux-based stubdomain Marek Marczykowski-Górecki
2018-08-07  2:16 ` [RFC PATCH v2 01/17] libxl: fix qemu-trad cmdline for no sdl/vnc case Marek Marczykowski-Górecki
2018-08-09  9:19   ` Wei Liu
2018-10-16 16:55   ` Ian Jackson
2018-08-07  2:16 ` [RFC PATCH v2 02/17] libxl: Add "stubdomain_version" to domain_build_info Marek Marczykowski-Górecki
2018-08-09  9:25   ` Wei Liu
2018-09-03 22:25     ` Marek Marczykowski-Górecki
2018-10-16 16:43       ` Ian Jackson
2018-10-16 17:36         ` Marek Marczykowski-Górecki
2018-08-07  2:16 ` [RFC PATCH v2 03/17] libxl: Handle Linux stubdomain specific QEMU options Marek Marczykowski-Górecki
2018-08-09  9:31   ` Wei Liu
2018-08-09 16:23   ` Jason Andryuk
2018-10-16 17:16   ` Ian Jackson
2018-10-16 17:51     ` Marek Marczykowski-Górecki
2018-10-19  9:32     ` Roger Pau Monné
2018-08-07  2:16 ` [RFC PATCH v2 04/17] libxl: Build the domain with a Linux based stubdomain Marek Marczykowski-Górecki
2018-08-07  2:16 ` [RFC PATCH v2 05/17] libxl: use xenstore for pci hotplug qemu-in-linux-stubdom commands Marek Marczykowski-Górecki
2018-08-07  2:16 ` [RFC PATCH v2 06/17] libxl: create vkb device only for guests with graphics output Marek Marczykowski-Górecki
2018-11-01 17:05   ` Ian Jackson
2018-11-01 20:24     ` Stefano Stabellini
2018-08-07  2:16 ` [RFC PATCH v2 07/17] libxl: add save/restore support for qemu-xen in stubdomain Marek Marczykowski-Górecki
2018-11-01 17:11   ` Ian Jackson
2018-11-01 17:16     ` Marek Marczykowski-Górecki
2018-11-01 17:41       ` Ian Jackson
2018-08-07  2:16 ` [RFC PATCH v2 08/17] xl: add stubdomain related options to xl config parser Marek Marczykowski-Górecki
2018-08-07  2:16 ` [RFC PATCH v2 09/17] libxl: use \x1b to separate qemu arguments for linux stubdomain Marek Marczykowski-Górecki
2018-08-07  2:16 ` [RFC PATCH v2 10/17] xenconsoled: install xenstore watch for all supported consoles Marek Marczykowski-Górecki
2018-09-19 17:43   ` Wei Liu
2018-08-07  2:16 ` [RFC PATCH v2 11/17] xenconsoled: add support for consoles using 'state' xenstore entry Marek Marczykowski-Górecki
2018-11-01 17:21   ` Ian Jackson
2019-01-09 12:21     ` Marek Marczykowski-Górecki
2018-08-07  2:16 ` [RFC PATCH v2 12/17] xenconsoled: make console_type->use_gnttab less confusing Marek Marczykowski-Górecki
2018-11-01 17:25   ` Ian Jackson
2018-08-07  2:16 ` [RFC PATCH v2 13/17] xenconsoled: add support for up to 3 secondary consoles Marek Marczykowski-Górecki
2018-11-01 17:31   ` Ian Jackson
2018-11-01 18:25     ` Marek Marczykowski-Górecki
2018-11-02 17:50       ` [RFC PATCH v2 13/17] xenconsoled: add support for up to 3 secondary consoles [and 1 more messages] Ian Jackson
2018-11-01 20:27     ` [RFC PATCH v2 13/17] xenconsoled: add support for up to 3 secondary consoles Stefano Stabellini
2018-08-07  2:16 ` [RFC PATCH v2 14/17] xenconsoled: deduplicate error handling Marek Marczykowski-Górecki
2018-11-01 17:31   ` Ian Jackson
2018-08-07  2:16 ` [RFC PATCH v2 15/17] xenconsoled: add support for non-pty output Marek Marczykowski-Górecki
2018-11-01 17:35   ` Ian Jackson
2018-11-01 17:54     ` Marek Marczykowski-Górecki
2018-08-07  2:16 ` [RFC PATCH v2 16/17] libxl: access QMP socket via console for qemu-in-stubdomain Marek Marczykowski-Górecki
2018-11-01 17:38   ` Ian Jackson
2018-08-07  2:16 ` [RFC PATCH v2 17/17] libxl: use xenconsoled even for multiple stubdomain's consoles Marek Marczykowski-Górecki
2018-10-16 16:53 ` [RFC PATCH v2 00/17] Add support for qemu-xen runnning in a Linux-based stubdomain Ian Jackson
2018-10-16 17:32   ` Marek Marczykowski-Górecki
2018-10-16 17:52     ` Ian Jackson
2018-10-16 20:46       ` Marek Marczykowski-Górecki
2018-10-17 10:17         ` Ian Jackson
2018-10-17 15:16         ` Ian Jackson
2018-10-17 16:05           ` Marek Marczykowski-Górecki
2018-11-01 16:57             ` Ian Jackson
2018-11-01 17:32               ` Marek Marczykowski-Górecki [this message]
2018-11-01 17:48                 ` Ian Jackson
2018-11-01 18:04                   ` Marek Marczykowski-Górecki
2018-11-02 16:53                     ` Ian Jackson
2018-11-02 17:01                       ` [PATCH 0/8] libvchan: Minor improvements Ian Jackson
2018-11-02 17:01                         ` [PATCH 1/8] tools/libvchan: Initialise xs_transaction_t to XBT_NULL, not NULL Ian Jackson
2018-11-06  9:40                           ` Wei Liu
2018-11-02 17:01                         ` [PATCH 2/8] tools/xenstore: Document that xs_close(0) is OK Ian Jackson
2018-11-06  9:41                           ` Wei Liu
2018-11-28 11:41                             ` Wei Liu
2018-11-02 17:01                         ` [PATCH 3/8] tools/libvchan: init_xs_srv: Simplify error handling (1) Ian Jackson
2018-11-06  9:47                           ` Wei Liu
2018-11-02 17:01                         ` [PATCH 4/8] tools/libvchan: init_xs_srv: Simplify error handling (2) Ian Jackson
2018-11-06  9:48                           ` Wei Liu
2018-11-06 11:42                             ` Ian Jackson
2018-11-02 17:01                         ` [PATCH 5/8] tools/libvchan: init_xs_srv: Turn xs retry from goto into for (; ; ) Ian Jackson
2018-11-06  9:48                           ` Wei Liu
2018-11-02 17:01                         ` [PATCH 6/8] tools/libvchan: Add xentoollog to direct dependencies Ian Jackson
2018-11-06  9:48                           ` Wei Liu
2018-11-02 17:01                         ` [PATCH 7/8] tools/libvchan: libxenvchan_*_init: Promise an errno Ian Jackson
2018-11-06  9:49                           ` Wei Liu
2018-11-02 17:01                         ` [PATCH 8/8] tools/libvchan: libxenvchan_client_init: use ENOENT for no server Ian Jackson
2018-11-06 10:00                           ` Wei Liu
2018-11-06 11:45                             ` Ian Jackson
2018-11-06 12:15                               ` Marek Marczykowski-Górecki
2018-11-06 15:57                                 ` Ian Jackson
2018-11-15 17:41                 ` [RFC PATCH v2 00/17] Add support for qemu-xen runnning in a Linux-based stubdomain Anthony PERARD
2018-11-15 18:57                   ` Marek Marczykowski-Górecki
2018-11-16 10:39                     ` Anthony PERARD
2018-11-18 17:25                       ` Marek Marczykowski-Górecki
2018-11-19 12:03                         ` Anthony PERARD

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=20181101173207.GB1638@mail-itl \
    --to=marmarek@invisiblethingslab.com \
    --cc=anthony.perard@citrix.com \
    --cc=eshelton@pobox.com \
    --cc=ian.jackson@citrix.com \
    --cc=simon@invisiblethingslab.com \
    --cc=wei.liu2@citrix.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).