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