diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index b6806f017b..4205c42a56 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -10481,6 +10481,12 @@ qemuDomainDefValidateDiskLunSource(const virStorageSource *src) return -1; } + if (src->format != VIR_STORAGE_FILE_RAW) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("disk device 'lun' must use 'raw' format")); + return -1; + } + return 0; } diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 2cde678ca0..f789ed075a 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -1997,14 +1997,6 @@ qemuValidateDomainDeviceDefDiskFrontend(const virDomainDiskDef *disk, return -1; } - if (disk->bus == VIR_DOMAIN_DISK_BUS_SCSI && - disk->src->format != VIR_STORAGE_FILE_RAW) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("disk device 'lun' using target 'scsi' must use " - "'raw' format")); - return -1; - } - if (qemuDomainDefValidateDiskLunSource(disk->src) < 0) return -1; diff --git a/tests/qemuxml2argvdata/virtio-lun.args b/tests/qemuxml2argvdata/virtio-lun.args index 7df1512b9b..850501142a 100644 --- a/tests/qemuxml2argvdata/virtio-lun.args +++ b/tests/qemuxml2argvdata/virtio-lun.args @@ -27,10 +27,10 @@ server,nowait \ -boot menu=on \ -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x6 \ -usb \ --drive file=/dev/sdfake,format=qcow2,if=none,id=drive-virtio-disk0 \ +-drive file=/dev/sdfake,format=raw,if=none,id=drive-virtio-disk0 \ -device virtio-blk-pci,scsi=on,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,\ id=virtio-disk0,bootindex=2 \ --drive file=/dev/sdfake2,format=qcow2,if=none,id=drive-virtio-disk1 \ +-drive file=/dev/sdfake2,format=raw,if=none,id=drive-virtio-disk1 \ -device virtio-blk-pci,scsi=on,bus=pci.0,addr=0x5,drive=drive-virtio-disk1,\ id=virtio-disk1 \ -netdev user,id=hostnet0 \ diff --git a/tests/qemuxml2argvdata/virtio-lun.xml b/tests/qemuxml2argvdata/virtio-lun.xml index 303131fb61..c802da1838 100644 --- a/tests/qemuxml2argvdata/virtio-lun.xml +++ b/tests/qemuxml2argvdata/virtio-lun.xml @@ -17,13 +17,13 @@ /usr/bin/qemu-system-x86_64 - +
- +
diff --git a/tests/qemuxml2xmloutdata/virtio-lun.xml b/tests/qemuxml2xmloutdata/virtio-lun.xml index dbedd4edc0..23052cd519 100644 --- a/tests/qemuxml2xmloutdata/virtio-lun.xml +++ b/tests/qemuxml2xmloutdata/virtio-lun.xml @@ -17,13 +17,13 @@ /usr/bin/qemu-system-x86_64 - +
- +