Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Step:15-SP4
xen.32204
libxl-85760c03d664400368a3f76ae0225307c25049a7....
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File libxl-85760c03d664400368a3f76ae0225307c25049a7.patch of Package xen.32204
From: Anthony PERARD <anthony.perard@citrix.com> Date: Tue, 11 May 2021 10:28:06 +0100 Subject: libxl 85760c03d664400368a3f76ae0225307c25049a7 References: bsc#1180350 libxl: Use -device for cd-rom drives This allows to set an `id` on the device instead of only the drive. We are going to need the `id` with the "eject" and "blockdev-change-media" QMP command as using `device` parameter on those is deprecated. (`device` is the `id` of the `-drive` on the command line). We set the same `id` on both -device and -drive as QEMU doesn't complain and we can then either do "eject id=$id" or "eject device=$id". Using "-drive + -device" instead of only "-drive" has been available since at least QEMU 0.15, and seems to be the preferred way as it separates the host part (-drive which describe the disk image location and format) from the guest part (-device which describe the emulated device). More information in qemu.git/docs/qdev-device-use.txt . Changing the command line during migration for the cdrom seems fine. Also the documentation about migration in QEMU explains that the device state ID is "been formed from a bus name and device address", so second IDE bus and first device address on bus is still thus and doesn't matter if written "-drive if=ide,index=2" or "-drive ide-cd,bus=ide.1,unit=0". See qemu.git/docs/devel/migration.rst . Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Reviewed-by: Jason Andryuk <jandryuk@gmail.com> --- tools/libxl/libxl_dm.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) --- a/tools/libxl/libxl_dm.c +++ b/tools/libxl/libxl_dm.c @@ -1894,6 +1894,7 @@ static int libxl__build_device_model_arg } if (disks[i].is_cdrom) { + const char *drive_id; if (disk > 4) { LOGD(WARN, guest_domid, "Emulated CDROM can be only one of the first 4 disks.\n" "Disk %s will be available via PV drivers but not as an " @@ -1901,13 +1902,22 @@ static int libxl__build_device_model_arg disks[i].vdev); continue; } - drive = libxl__sprintf(gc, - "if=ide,index=%d,readonly=on,media=cdrom,id=ide-%i", - disk, dev_number); + + drive_id = GCSPRINTF("ide-%i", dev_number); + drive = GCSPRINTF("if=none,readonly=on,id=%s", drive_id); if (target_path) drive = libxl__sprintf(gc, "%s,file=%s,format=%s", drive, target_path, format); + + flexarray_vappend(dm_args, + "-drive", drive, + "-device", + GCSPRINTF("ide-cd,id=%s,drive=%s,bus=ide.%u,unit=%u", + drive_id, drive_id, + disk / 2, disk % 2), + NULL); + continue; } else { /* * Explicit sd disks are passed through as is.
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor