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, 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: Tue, 16 Oct 2018 19:32:40 +0200	[thread overview]
Message-ID: <20181016173240.GA1563@mail-itl> (raw)
In-Reply-To: <23494.5998.10340.694382@mariner.uk.xensource.com>


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

On Tue, Oct 16, 2018 at 05:53:02PM +0100, Ian Jackson wrote:
> Marek Marczykowski-Górecki writes ("[RFC PATCH v2 00/17] Add support for qemu-xen runnning in a Linux-based stubdomain."):
> > [stuff]
> 
> Thanks for this.  I'm very keen on this approach and keen on getting
> it upstream.  Sorry for the delay reviewing it!  I have been away a
> lot.
> 
> > General idea is to allow freely set device_model_version and
> > device_model_stubdomain_override and choose the right options based on this choice.
> > Also, allow to specific path to stubdomain kernel/ramdisk, for greater flexibility.
> > Right now when qemu-xen in stubdomain is selected, it is assumed it's
> > Linux-based and few decisions are based on it, specifically:
> 
> That sounds sensible.
> 
> >  - qemu args encoding (\x1b as separator, to allow spaces in arguments)
> 
> What if the arguments contain \x1b ? 

Well, here I've changed "What if the arguments contain a space" to "What
if the arguments contain \x1b" ;)

> I think you may need a quoting
> scheme, or to use nul.

The main reason for this over alternatives (including nul) is using
shell script on the stubdomain side to handle this. Handling nul char in
shell is major PITA.

> > It may be a good idea to document "stubdomain API" somewhere. Is there such
> > document for MiniOS one?
> 
> No.
> 
> >  Here is an initial version for Linux one:
> > 
> >     Assumptions about Linux-based stubdomain for qemu-xen:
> >     * qemu command line is stored by toolstack in
> >       /vm/<target-uuid>/image/dmargs xenstore entry, arguments are separated
> >       with \x1b character
> 
> Oh, xenstore.  From docs/misc/xenstore.txt:
> 
> | xenstore values should normally be 7-bit ASCII text strings
> | containing bytes 0x20..0x7f only
> 
> I think you could have separate xenstore keys for the seperate
> arguments, or you could encode it somehow.

What "normally" means in this context? For me it doesn't mean other
characters are prohibited.

> >     * qemu can access saved state (if any) at its FD 3
> >     * qemu can write its state (for save/migration) to its FD 4
> 
> That's a description of the protocol to *qemu*.  Is the toolstack then
> responsible for the protocol across the domain boundary ?  I think it
> would be nice to specify that here too.

Well, toolstack is responsible for qemu command line (and QMP), so it is
part of the stubdomain protocol...

> 
> >     * qemu expects backend for serial console at /dev/hvc3
> >     * disks configured for the target are available as /dev/xvd*, in
> >       configuration order
> >     * qemu can call /etc/qemu-ifup and /etc/qemu-ifdown to connect/disconnect
> >       network interface to appropriate network

Actually, after recent changes in our linux stubdomain, this last point
wouldn't be needed. It's handled internally by observing qmp events.

> Please can we put this in-tree and not in a 00/ cover letter :-).

Sure.

> > Initial version has no QMP support - in initial patches it is completely
> > disabled, which means no suspend/restore. QMP normally would be used for PCI
> > passthrough setup, but it is worked around with MiniOS-like control protocol
> > over xenstore, which then is translated to QMP on stubdomain side.
> 
> How unpleasant.  But better than nothing.
>
> > Some option is to use separate console for that, but that require
> > xenstoled supporting multiple consoles per domain (the goal is to not have qemu
> > in dom0 at all). Also, it would be preferable to evaluate how libxl
> > handle potentially malicious QMP responses.
> 
> We are working on that latter point anyway.
> 
> > Another option is to use xenstore - either translate everything needed to
> > MiniOS-like thing, or write already json-formatted requests to xenstore and
> > watch there for responses. When using separate xenstore dir for that, with
> > per-command entries (command id as a key name?) that would solve concurrency
> > problem.
> 
> That would be fine too.
> 
> > QMP support over separate console: patch "libxl: access QMP socket via console
> > for qemu-in-stubdomain" implements some early PoC of this.
> > Major limitation: only one connection at a time and no means of out of
> > band reset (and re-negotiate). I've tried adding very simple `qmp_reset`
> > command for in-band connection reset, but it is unreliable because of the
> > first limitation - xl process running in background hold this connection open
> > and every other xl instance interfere with it. On the other hand, for libvirt
> > use case one connection could be enough (leaving alone libvirtd restart).
> 
> This is awkward, isn't it.  The Xen PV console protocol has no reset
> mechanism.  Can we use libvchan here and provide qmp vchans ?

That would be an option too. Require (trivial) vchan->unix socket proxy.

> > Xenconsoled patches add support for multiple consoles in xenconsoled, to avoid the need
> > for qemu in dom0 for this to work. Multiple consoles for a stubdomain are used for:
> >  - logs (console 0)
> >  - save + restore (console 1, 2)
> >  - qmp (console 3)
> >  - serial terminal to target domU (console 4)
> > Xenconsoled patches are in fact a separate series, but I'm sending them here to
> > ease dependencies handling (latter libxl patches use that).
> 
> That sounds reasonable.
> 
> > What qmp-libxenstat socket is for?
> > 
> > PCI passthrough support require some more love. Right now, libxl tries to setup
> > pcifront for both target HVM and stubdomain and the former fails (race
> > condition):
> >     xen-pciback pci-259-0: 22 Couldn't locate PCI device (0000:00:1b.0)! perhaps already in-use?
> > Fortunately it isn't needed. There is also a PCI related problem on
> > domain shutdown - it looks like first stubdomain is paused and then libxl waits
> > for pcifront there.
> > Also, MSI doesn't work (qemu output):
> > 
> >     [00:05.0] xen_pt_msgctrl_reg_write: setup MSI (register: 81).
> >     [00:05.0] msi_msix_setup: requested pirq 55 for MSI (vec: 0, entry: 0)
> >     [00:05.0] msi_msix_setup: Error: Mapping of MSI (err: 1, vec: 0, entry 0)
> >     [00:05.0] xen_pt_msgctrl_reg_write: Warning: Can not map MSI (register: 80)!
> >     [00:05.0] Write-back to unknown field 0x44 (partially) inhibited (0x00)
> >     [00:05.0] If the device doesn't work, try enabling permissive mode
> >     [00:05.0] (unsafe) and if it helps report the problem to xen-devel
> 
> I confess I don't understand PCI passthrough but it would be nice for
> this to work.  I think a starting point might be to write down who is
> supposed to do what...
> 
> > This patch series is third (fourth?) attempt to get rid of limitation
> > "if you want to use stubdomain, you're stuck with qemu-traditional", done over
> > years, by many people.
> > I think it should be acceptable plan to gradually add features to
> > qemu-xen+stubdomain configuration - not necessary waiting with committing any
> > of those patches until full feature set of qemu-xen is supported. After all,
> > right now "feature set supported by qemu-xen+stubdom" is empty, so wouldn't be
> > worse.
> 
> Absolutely.
> 
> 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-10-16 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 [this message]
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
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=20181016173240.GA1563@mail-itl \
    --to=marmarek@invisiblethingslab.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).