xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Jason Andryuk <jandryuk@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: "Stefano Stabellini" <sstabellini@kernel.org>,
	"Julien Grall" <julien@xen.org>, "Wei Liu" <wl@xen.org>,
	"Jason Andryuk" <jandryuk@gmail.com>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Ian Jackson" <ian.jackson@eu.citrix.com>,
	"Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>,
	"George Dunlap" <george.dunlap@citrix.com>,
	"Jan Beulich" <jbeulich@suse.com>,
	"Ian Jackson" <ian.jackson@citrix.com>
Subject: [PATCH v7 01/19] Document ioemu MiniOS stubdomain protocol
Date: Mon, 18 May 2020 21:54:45 -0400	[thread overview]
Message-ID: <20200519015503.115236-2-jandryuk@gmail.com> (raw)
In-Reply-To: <20200519015503.115236-1-jandryuk@gmail.com>

From: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>

Add documentation based on reverse-engineered toolstack-ioemu stubdomain
protocol.

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

---
Changes in v6:
 - Add Acked-by: Ian Jackson
---
 docs/misc/stubdom.txt | 53 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 53 insertions(+)

diff --git a/docs/misc/stubdom.txt b/docs/misc/stubdom.txt
index 882a18cab4..64c77d9b64 100644
--- a/docs/misc/stubdom.txt
+++ b/docs/misc/stubdom.txt
@@ -23,6 +23,59 @@ and https://wiki.xen.org/wiki/Device_Model_Stub_Domains for more
 information on device model stub domains
 
 
+Toolstack to MiniOS ioemu stubdomain protocol
+---------------------------------------------
+
+This section describe communication protocol between toolstack and
+qemu-traditional running in MiniOS stubdomain. The protocol include
+expectations of both qemu and stubdomain itself.
+
+Setup (done by toolstack, expected by stubdomain):
+ - Block devices for target domain are connected as PV disks to stubdomain,
+   according to configuration order, starting with xvda
+ - Network devices for target domain are connected as PV nics to stubdomain,
+   according to configuration order, starting with 0
+ - if graphics output is expected, VFB and VKB devices are set for stubdomain
+   (its backend is responsible for exposing them using appropriate protocol
+   like VNC or Spice)
+ - other target domain's devices are not connected at this point to stubdomain
+   (may be hot-plugged later)
+ - QEMU command line (space separated arguments) is stored in
+   /vm/<target-uuid>/image/dmargs xenstore path
+ - target domain id is stored in /local/domain/<stubdom-id>/target xenstore path
+?? - bios type is stored in /local/domain/<target-id>/hvmloader/bios
+ - stubdomain's console 0 is connected to qemu log file
+ - stubdomain's console 1 is connected to qemu save file (for saving state)
+ - stubdomain's console 2 is connected to qemu save file (for restoring state)
+ - next consoles are connected according to target guest's serial console configuration
+
+Startup:
+1. PV stubdomain is started with ioemu-stubdom.gz kernel and no initrd
+2. stubdomain initialize relevant devices
+3. stubdomain signal readiness by writing "running" to /local/domain/<stubdom-id>/device-model/<target-id>/state xenstore path
+4. now stubdomain is considered running
+
+Runtime control (hotplug etc):
+Toolstack can issue command through xenstore. The sequence is (from toolstack POV):
+1. Write parameter to /local/domain/<stubdom-id>/device-model/<target-id>/parameter.
+2. Write command to /local/domain/<stubdom-id>/device-model/<target-id>/command.
+3. Wait for command result in /local/domain/<stubdom-id>/device-model/<target-id>/state (command specific value).
+4. Write "running" back to /local/domain/<stubdom-id>/device-model/<target-id>/state.
+
+Defined commands:
+ - "pci-ins" - PCI hot plug, results:
+   - "pci-inserted" - success
+   - "pci-insert-failed" - failure
+ - "pci-rem" - PCI hot remove, results:
+   - "pci-removed" - success
+   - ??
+ - "save" - save domain state to console 1, results:
+   - "paused" - success
+ - "continue" - resume domain execution, after loading state from console 2 (require -loadvm command argument), results:
+   - "running" - success
+
+
+
                                    PV-GRUB
                                    =======
 
-- 
2.25.1



  parent reply	other threads:[~2020-05-19  1:56 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-19  1:54 [PATCH v7 00/19] Add support for qemu-xen runnning in a Linux-based stubdomain Jason Andryuk
2020-05-18 22:24 ` Wei Liu
2020-05-19  1:54 ` Jason Andryuk [this message]
2020-05-19  1:54 ` [PATCH v7 02/19] Document ioemu Linux stubdomain protocol Jason Andryuk
2020-05-19  1:54 ` [PATCH v7 03/19] libxl: fix qemu-trad cmdline for no sdl/vnc case Jason Andryuk
2020-05-19  1:54 ` [PATCH v7 04/19] libxl: Allow running qemu-xen in stubdomain Jason Andryuk
2020-05-19  1:54 ` [PATCH v7 05/19] libxl: Handle Linux stubdomain specific QEMU options Jason Andryuk
2020-05-19  1:54 ` [PATCH v7 06/19] libxl: Use libxl__xs_* in libxl__write_stub_dmargs Jason Andryuk
2020-05-19 15:09   ` Ian Jackson
2020-05-19  1:54 ` [PATCH v7 07/19] libxl: write qemu arguments into separate xenstore keys Jason Andryuk
2020-05-19 15:10   ` Ian Jackson
2020-05-19 15:21     ` Wei Liu
2020-05-19 15:33       ` Jason Andryuk
2020-05-19  1:54 ` [PATCH v7 08/19] xl: add stubdomain related options to xl config parser Jason Andryuk
2020-05-19  1:54 ` [PATCH v7 09/19] tools/libvchan: notify server when client is connected Jason Andryuk
2020-05-19  1:54 ` [PATCH v7 10/19] libxl: add save/restore support for qemu-xen in stubdomain Jason Andryuk
2020-05-19  1:54 ` [PATCH v7 11/19] tools: add missing libxenvchan cflags Jason Andryuk
2020-05-19  1:54 ` [PATCH v7 12/19] tools: add simple vchan-socket-proxy Jason Andryuk
2020-05-21 11:09   ` Andrew Cooper
2020-05-21 13:12     ` Jason Andryuk
2020-05-19  1:54 ` [PATCH v7 13/19] libxl: Refactor kill_device_model to libxl__kill_xs_path Jason Andryuk
2020-05-19  1:54 ` [PATCH v7 14/19] libxl: use vchan for QMP access with Linux stubdomain Jason Andryuk
2020-05-19  1:54 ` [PATCH v7 15/19] libxl: require qemu in dom0 for multiple stubdomain consoles Jason Andryuk
2020-05-19  1:55 ` [PATCH v7 16/19] libxl: ignore emulated IDE disks beyond the first 4 Jason Andryuk
2020-05-19  1:55 ` [PATCH v7 17/19] libxl: consider also qemu in stubdomain in libxl__dm_active check Jason Andryuk
2020-05-19  1:55 ` [PATCH v7 18/19] docs: Add device-model-domid to xenstore-paths Jason Andryuk
2020-05-19  1:55 ` [PATCH v7 19/19] libxl: Check stubdomain kernel & ramdisk presence Jason Andryuk
2020-05-22  9:10 ` [PATCH v7 00/19] Add support for qemu-xen runnning in a Linux-based stubdomain George Dunlap
2020-05-22  9:54   ` Paul Durrant
2020-05-22 13:30     ` Jason Andryuk
2020-05-22 13:37       ` Ian Jackson

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=20200519015503.115236-2-jandryuk@gmail.com \
    --to=jandryuk@gmail.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=george.dunlap@citrix.com \
    --cc=ian.jackson@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=marmarek@invisiblethingslab.com \
    --cc=sstabellini@kernel.org \
    --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 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).