diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 1aa7c7adc34618238d459e6c601bbc8007325278..4fc3176ad3cef58e9e8e6391207a7c8206a14da0 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4663,7 +4663,9 @@ qemuBuildSCSIiSCSIHostdevDrvStr(virDomainHostdevDefPtr dev, if (!(netsource = qemuBuildNetworkDriveStr(iscsisrc->src, srcPriv ? srcPriv->secinfo : NULL))) goto cleanup; - virBufferAsprintf(&buf, "file=%s,if=none,format=raw", netsource); + virBufferAddLit(&buf, "file="); + virQEMUBuildBufferEscapeComma(&buf, netsource); + virBufferAddLit(&buf, ",if=none,format=raw"); } if (virBufferCheckError(&buf) < 0) diff --git a/tests/qemuxml2argvdata/name-escape.args b/tests/qemuxml2argvdata/name-escape.args index aef7c238ca6a35a929b6a3da7e26e217031606bb..382b8a1a9ef95c14eb8e182cd326246aa7345822 100644 --- a/tests/qemuxml2argvdata/name-escape.args +++ b/tests/qemuxml2argvdata/name-escape.args @@ -22,6 +22,7 @@ bar=2/monitor.sock,server,nowait \ -no-shutdown \ -no-acpi \ -boot c \ +-device virtio-scsi-pci,id=scsi0,bus=pci.0,addr=0x3 \ -device usb-ccid,id=ccid0,bus=usb.0,port=1 \ -usb \ -drive file=/dev/HostVG/QEMUGuest1,format=qcow2,if=none,id=drive-ide0-0-0,\ @@ -41,4 +42,8 @@ cert3=cert3,db=/etc/pki/nssdb,,foo,id=smartcard0,bus=ccid0.0 \ -spice unix,addr=/tmp/lib/domain--1-foo=1,,bar=2/spice.sock,gl=on,\ rendernode=/dev/dri/foo,,bar \ -device cirrus-vga,id=video0,bus=pci.0,addr=0x2 \ --device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 +-drive file=iscsi://example.foo.org:3260/iqn.1992-01.com.example%3Amy,,\ +storage/1,if=none,format=raw,id=drive-hostdev0 \ +-device scsi-generic,bus=scsi0.0,channel=0,scsi-id=0,lun=4,\ +drive=drive-hostdev0,id=hostdev0 \ +-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4 diff --git a/tests/qemuxml2argvdata/name-escape.xml b/tests/qemuxml2argvdata/name-escape.xml index 70a1ce09d301545bbcdf3f78f79b88b066bbbb83..fab2a77547b117fec337e0ebdd312893d613a6ef 100644 --- a/tests/qemuxml2argvdata/name-escape.xml +++ b/tests/qemuxml2argvdata/name-escape.xml @@ -27,6 +27,13 @@
+ + + + + +
+ diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index ac9593acbeb53dba157185af767ff51489a6fc88..c279ac4975cf039a16827335f5d39f1fc1aa65dc 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2773,7 +2773,9 @@ mymain(void) QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_DEVICE_ISA_SERIAL, QEMU_CAPS_CHARDEV_FILE_APPEND, - QEMU_CAPS_CCID_EMULATED); + QEMU_CAPS_CCID_EMULATED, + QEMU_CAPS_VIRTIO_SCSI, + QEMU_CAPS_DEVICE_SCSI_GENERIC); DO_TEST("debug-threads", QEMU_CAPS_NAME_DEBUG_THREADS); DO_TEST("master-key", QEMU_CAPS_OBJECT_SECRET);