[PATCH 0/2] libxl: Stubdom cd-rom changing support

Jason Andryuk posted 2 patches 3 months, 3 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/20240109204655.72063-1-jandryuk@gmail.com
There is a newer version of this series
docs/misc/stubdom.txt         |  16 ++
tools/libs/light/libxl_disk.c | 302 ++++++++++++++++++++++++++++++----
2 files changed, 287 insertions(+), 31 deletions(-)
[PATCH 0/2] libxl: Stubdom cd-rom changing support
Posted by Jason Andryuk 3 months, 3 weeks ago
These two patches enable cd-rom media changing for an HVM with a
linux stubdom.

The first patch allows use of non-QDISK drives with a stubdom.  The
second expands the cd-rom changing code to support the stubdom case.

To change the cd-rom medium, libxl will:
 - QMP eject the medium from QEMU
 - block-detach the old PV disk
 - block-attach the new PV disk
 - QMP change the medium to the new PV disk by fdset-id

The QMP change insert uses fdset-id STUBDOM_FDSET_CD + $disk - 'a'.
That is, hda -> 'a', so
STUBDOM_FDSET_CD + 'a' - 'a' = STUBDOM_FDSET_CD.
For hdc:
STUBDOM_FDSET_CD + 'c' - 'a' = STUBDOM_FDSET_CD + 2.

The stubdom must internally handle adding /dev/xvdc to the appropriate
fdset inside QEMU.

A script like this:
https://github.com/OpenXT/xenclient-oe/blob/master/recipes-core/initrdscripts/initramfs-stubdomain/qemu-xvdc-add-fd.sh

Can be called by busybox mdev configured like this:
https://github.com/OpenXT/xenclient-oe/blob/master/recipes-core/busybox/files/mdev.conf

Jason Andryuk (2):
  libxl: Remove cdrom forced QDISK w/ stubdom
  libxl: Enable stubdom cdrom changing

 docs/misc/stubdom.txt         |  16 ++
 tools/libs/light/libxl_disk.c | 302 ++++++++++++++++++++++++++++++----
 2 files changed, 287 insertions(+), 31 deletions(-)

-- 
2.43.0