]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
conf: allow virtio driver attributes for vhostuser disk
authorPavel Hrdina <phrdina@redhat.com>
Fri, 5 Feb 2021 12:05:54 +0000 (13:05 +0100)
committerPavel Hrdina <phrdina@redhat.com>
Mon, 8 Feb 2021 09:49:59 +0000 (10:49 +0100)
All of these options are actually supported by vhostuser disk so
we should allow them to be usable.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
src/conf/domain_validate.c
tests/qemuxml2argvdata/disk-vhostuser.x86_64-latest.args
tests/qemuxml2argvdata/disk-vhostuser.xml
tests/qemuxml2xmloutdata/disk-vhostuser.x86_64-latest.xml

index 222a9386f632034ab7c6d880f8020faac5106da7..6b3e892332417c753b935b43c12526d69d386261 100644 (file)
@@ -322,26 +322,6 @@ virDomainDiskVhostUserValidate(const virDomainDiskDef *disk)
 
     /* Unsupported driver elements */
 
-    if (disk->virtio) {
-        if (disk->virtio->iommu != VIR_TRISTATE_SWITCH_ABSENT) {
-            virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                           _("iommu is not supported with vhostuser disk"));
-            return -1;
-        }
-
-        if (disk->virtio->ats != VIR_TRISTATE_SWITCH_ABSENT) {
-            virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                           _("ats is not supported with vhostuser disk"));
-            return -1;
-        }
-
-        if (disk->virtio->packed != VIR_TRISTATE_SWITCH_ABSENT) {
-            virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                           _("packed is not supported with vhostuser disk"));
-            return -1;
-        }
-    }
-
     if (disk->src->metadataCacheMaxSize > 0) {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
                        _("metadata_cache is not supported with vhostuser disk"));
index b24b2c0b4f0922b570f701536e266ee395720bcb..30acd7c78bfe153e476cec2d105ebc9aa7b68f1c 100644 (file)
@@ -33,8 +33,8 @@ file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
 -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,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 \
 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4 \
 -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
 resourcecontrol=deny \
index c96ef9119cd9e6a23b92277e2ce2d24b4c0f9a86..cbe2804e3948049b8aace59336ff6d35e1d53042 100644 (file)
@@ -20,7 +20,7 @@
       <boot order='1'/>
     </disk>
     <disk type='vhostuser' device='disk'>
-      <driver name='qemu' type='raw'/>
+      <driver name='qemu' type='raw' iommu='on' ats='on' packed='on'/>
       <source type='unix' path='/tmp/vhost1.sock'>
         <reconnect enabled='yes' timeout='10'/>
       </source>
index 9712dc0b125d0ca8d979577ea743a9be93d90dc6..87f5ec46ac752c636087195177b5e4877112af19 100644 (file)
@@ -28,7 +28,7 @@
       <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
     </disk>
     <disk type='vhostuser' device='disk' snapshot='no'>
-      <driver name='qemu' type='raw'/>
+      <driver name='qemu' type='raw' iommu='on' ats='on' packed='on'/>
       <source type='unix' path='/tmp/vhost1.sock'>
         <reconnect enabled='yes' timeout='10'/>
       </source>