[PATCH 2/2] Remove scsi parameter for vhost-user-blk for qemu 4.2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: shenjiatong <yshxxsjt715@xxxxxxxxx>

When trying to attach vhost-user-blk device to virtual
machine using libvirt 7.8 and qemu 4.2. Libvirt mistakenly
add a scsi=off parameter which is not supported by Qemu

Signed-off-by: shenjiatong <yshxxsjt715@xxxxxxxxx>
---
 src/qemu/qemu_command.c                                     | 6 +++++-
 .../qemuxml2argvdata/disk-vhostuser-numa.x86_64-4.2.0.args  | 4 ++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 662d15e28e..cdf89fc74c 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -2253,11 +2253,15 @@ qemuBuildDiskDeviceProps(const virDomainDef *def,
                                   "S:iothread", iothread,
                                   "T:ioeventfd", disk->ioeventfd,
                                   "T:event_idx", disk->event_idx,
-                                  "T:scsi", scsi,
                                   "p:num-queues", disk->queues,
                                   "p:queue-size", disk->queue_size,
                                   NULL) < 0)
             return NULL;
+
+        if (virStorageSourceGetActualType(disk->src) != VIR_STORAGE_TYPE_VHOST_USER) {
+          if (virJSONValueObjectAdd(&props, "T:scsi", scsi, NULL) < 0)
+              return NULL;
+        }
     }
         break;
 
diff --git a/tests/qemuxml2argvdata/disk-vhostuser-numa.x86_64-4.2.0.args b/tests/qemuxml2argvdata/disk-vhostuser-numa.x86_64-4.2.0.args
index 6c5d6de46b..4480266e75 100644
--- a/tests/qemuxml2argvdata/disk-vhostuser-numa.x86_64-4.2.0.args
+++ b/tests/qemuxml2argvdata/disk-vhostuser-numa.x86_64-4.2.0.args
@@ -30,9 +30,9 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
 -boot strict=on \
 -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
 -chardev socket,id=chr-vu-virtio-disk0,path=/tmp/vhost1.sock \
--device vhost-user-blk-pci,scsi=off,bus=pci.0,addr=0x2,chardev=chr-vu-virtio-disk0,id=virtio-disk0,bootindex=1 \
+-device vhost-user-blk-pci,bus=pci.0,addr=0x2,chardev=chr-vu-virtio-disk0,id=virtio-disk0,bootindex=1 \
 -chardev socket,id=chr-vu-virtio-disk1,path=/tmp/vhost1.sock,reconnect=10 \
--device vhost-user-blk-pci,iommu_platform=on,ats=on,packed=on,scsi=off,bus=pci.0,addr=0x3,chardev=chr-vu-virtio-disk1,id=virtio-disk1 \
+-device vhost-user-blk-pci,iommu_platform=on,ats=on,packed=on,bus=pci.0,addr=0x3,chardev=chr-vu-virtio-disk1,id=virtio-disk1 \
 -audiodev '{"id":"audio1","driver":"none"}' \
 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4 \
 -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
-- 
2.25.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux