diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index a7c918e5fd9909b09506d45461f542eeb289ba75..f49181b639674d0c00535a7cfab9736f72ed0df0 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -1946,9 +1946,10 @@ qemuValidateDomainDeviceDefDiskFrontend(const virDomainDiskDef *disk, } if (disk->device == VIR_DOMAIN_DISK_DEVICE_CDROM && - disk->bus == VIR_DOMAIN_DISK_BUS_VIRTIO) { + (disk->bus == VIR_DOMAIN_DISK_BUS_VIRTIO || + disk->bus == VIR_DOMAIN_DISK_BUS_SD)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("disk type 'virtio' of '%s' does not support ejectable media"), + _("disk type of '%s' does not support ejectable media"), disk->dst); return -1; } diff --git a/tests/qemuxml2argvdata/disk-cdrom-bus-other.x86_64-latest.args b/tests/qemuxml2argvdata/disk-cdrom-bus-other.x86_64-latest.args index b1c30dd4d80b5638aecac96d4c2831fa8ca0957c..be091f150fb6b6582e2cf00bf467eedf25c1d29b 100644 --- a/tests/qemuxml2argvdata/disk-cdrom-bus-other.x86_64-latest.args +++ b/tests/qemuxml2argvdata/disk-cdrom-bus-other.x86_64-latest.args @@ -28,14 +28,13 @@ file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ -no-acpi \ -boot strict=on \ -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \ --drive file=/root/boot.iso,format=raw,if=none,id=drive-usb-disk0,readonly=on \ --device usb-storage,bus=usb.0,port=1,drive=drive-usb-disk0,id=usb-disk0,\ +-blockdev '{"driver":"file","filename":"/root/boot.iso",\ +"node-name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-2-format","read-only":true,"driver":"raw",\ +"file":"libvirt-2-storage"}' \ +-device usb-storage,bus=usb.0,port=1,drive=libvirt-2-format,id=usb-disk0,\ removable=off \ --drive if=none,id=drive-usb-disk1,readonly=on \ --device usb-storage,bus=usb.0,port=2,drive=drive-usb-disk1,id=usb-disk1,\ -removable=off \ --drive file=/root/boot2.iso,format=raw,if=sd,index=2,readonly=on \ --drive if=sd,index=3,readonly=on \ +-device usb-storage,bus=usb.0,port=2,id=usb-disk1,removable=off \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\ resourcecontrol=deny \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/disk-cdrom-bus-other.xml b/tests/qemuxml2argvdata/disk-cdrom-bus-other.xml index e73db8c6abf4746633cbffe8f8f68c6f435666df..e6bf1ea7974c5f4d5b20ae6740db967bfb1f2ab1 100644 --- a/tests/qemuxml2argvdata/disk-cdrom-bus-other.xml +++ b/tests/qemuxml2argvdata/disk-cdrom-bus-other.xml @@ -26,17 +26,6 @@ - - - - - - - - - - - diff --git a/tests/qemuxml2xmloutdata/disk-cdrom-bus-other.xml b/tests/qemuxml2xmloutdata/disk-cdrom-bus-other.xml index 10262e40d79aff323b091d0adc5284268de03545..ec86d19f1d3fdcd07337f60f6d83c199b81d4fde 100644 --- a/tests/qemuxml2xmloutdata/disk-cdrom-bus-other.xml +++ b/tests/qemuxml2xmloutdata/disk-cdrom-bus-other.xml @@ -26,17 +26,6 @@ - - - - - - - - - - -