On Mon, Feb 04, 2019 at 04:46:59PM +0100, Peter Krempa wrote:
Attempting to create an empty virtio-blk drive results into:
-device
virtio-blk-pci,scsi=off,bus=pci.0,addr=0xc,drive=drive-virtio-disk1,id=virtio-disk1:
Device needs media, but drive is empty
Attempting to eject media from virtio-blk based drive results into:
error: internal error: unable to execute QEMU command 'eject': Device
'drive-virtio-disk0' is not removable
Forbid configurations where users would attempt to use cdroms in virtio
bus.
Test fallout apart from the recently added case contains one more wrong
example which is not really relevant to the tested code, thus I've
changed the type.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/qemu/qemu_domain.c | 8 ++++++++
.../disk-cdrom-bus-other.x86_64-latest.args | 7 -------
tests/qemuxml2argvdata/disk-cdrom-bus-other.xml | 11 -----------
.../disk-scsi-disk-vpd-build-error.xml | 2 +-
tests/qemuxml2argvdata/pci-autofill-addr.args | 4 ++--
tests/qemuxml2argvdata/pci-autofill-addr.xml | 2 +-
tests/qemuxml2xmloutdata/disk-cdrom-bus-other.xml | 13 -------------
tests/qemuxml2xmloutdata/pci-autofill-addr.xml | 2 +-
8 files changed, 13 insertions(+), 36 deletions(-)
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 9dd45133fc..a64da3edd6 100644
--- a/tests/qemuxml2argvdata/disk-cdrom-bus-other.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/disk-cdrom-bus-other.x86_64-latest.args
@@ -31,13 +31,6 @@ removable=off \
-drive if=none,id=drive-usb-disk1,media=cdrom,readonly=on \
-device usb-storage,bus=usb.0,port=2,drive=drive-usb-disk1,id=usb-disk1,\
removable=off \
--drive file=/root/boot1.iso,format=raw,if=none,id=drive-virtio-disk0,\
-media=cdrom,readonly=on,cache=none \
--device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x2,drive=drive-virtio-disk0,\
-id=virtio-disk0,write-cache=on \
--drive if=none,id=drive-virtio-disk1,media=cdrom,readonly=on \
--device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x3,drive=drive-virtio-disk1,\
-id=virtio-disk1,write-cache=on \
-drive file=/root/boot2.iso,format=raw,if=sd,index=2,media=cdrom,readonly=on \
-drive if=sd,index=3,media=cdrom,readonly=on \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
diff --git a/tests/qemuxml2argvdata/disk-cdrom-bus-other.xml
b/tests/qemuxml2argvdata/disk-cdrom-bus-other.xml
index 2ed86b0900..a142373afb 100644
--- a/tests/qemuxml2argvdata/disk-cdrom-bus-other.xml
+++ b/tests/qemuxml2argvdata/disk-cdrom-bus-other.xml
@@ -26,17 +26,6 @@
<target dev='sdb' bus='usb'/>
<readonly/>
</disk>
- <disk type='file' device='cdrom'>
- <driver name='qemu' type='raw' cache='none'/>
- <source file='/root/boot1.iso'/>
- <target dev='vda' bus='virtio'/>
- <readonly/>
- </disk>
- <disk type='file' device='cdrom'>
- <driver name='qemu' type='raw' cache='none'/>
- <target dev='vdb' bus='virtio'/>
- <readonly/>
- </disk>
<disk type='file' device='cdrom'>
<driver name='qemu' type='raw'/>
<source file='/root/boot2.iso'/>
Consider squashing these hunks into the previous patch.
Reviewed-by: Ján Tomko <jtomko(a)redhat.com>
Jano