<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Feb 5, 2021 at 8:08 PM Pavel Hrdina <<a href="mailto:phrdina@redhat.com">phrdina@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">All of these options are actually supported by vhostuser disk so<br>
we should allow them to be usable.<br>
<br>
Signed-off-by: Pavel Hrdina <<a href="mailto:phrdina@redhat.com" target="_blank">phrdina@redhat.com</a>><br>
---<br>
 src/conf/domain_validate.c                    | 20 -------------------<br>
 .../disk-vhostuser.x86_64-latest.args         |  4 ++--<br>
 tests/qemuxml2argvdata/disk-vhostuser.xml     |  2 +-<br>
 .../disk-vhostuser.x86_64-latest.xml          |  2 +-<br>
 4 files changed, 4 insertions(+), 24 deletions(-)<br>
<br>
diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c<br>
index 222a9386f6..6b3e892332 100644<br>
--- a/src/conf/domain_validate.c<br>
+++ b/src/conf/domain_validate.c<br>
@@ -322,26 +322,6 @@ virDomainDiskVhostUserValidate(const virDomainDiskDef *disk)<br>
<br>
     /* Unsupported driver elements */<br>
<br>
-    if (disk->virtio) {<br>
-        if (disk->virtio->iommu != VIR_TRISTATE_SWITCH_ABSENT) {<br>
-            virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",<br>
-                           _("iommu is not supported with vhostuser disk"));<br>
-            return -1;<br>
-        }<br>
-<br>
-        if (disk->virtio->ats != VIR_TRISTATE_SWITCH_ABSENT) {<br>
-            virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",<br>
-                           _("ats is not supported with vhostuser disk"));<br>
-            return -1;<br>
-        }<br>
-<br>
-        if (disk->virtio->packed != VIR_TRISTATE_SWITCH_ABSENT) {<br>
-            virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",<br>
-                           _("packed is not supported with vhostuser disk"));<br>
-            return -1;<br>
-        }<br>
-    }<br>
-<br></blockquote><div> Tested on qemu-5.2.0-5.fc34.1.x86_64 libvirt v7.0.0-337-ga58edc602e</div><div>VM could be start with the virtio properties of vhostuser-blk:<br></div><div><disk type="vhostuser" device="disk" model="virtio-non-transitional" snapshot="no"><br>      <driver name="qemu" type="raw" iommu="on" ats="on" packed="on"/><br>      <source type="unix" path="/tmp/vhost-user-blk0.sock"><br>        <reconnect enabled="yes" timeout="10"/><br>      </source><br>      <target dev="vdb" bus="virtio"/><br>      <address type="pci" domain="0x0000" bus="0x00" slot="0x0b" function="0x0"/><br>    </disk></div><div><br></div><div>Note that the model="virtio-non-transitional" should be set otherwise it will report an error:</div><div>2021-02-07T05:33:25.737469Z qemu-system-x86_64: -device vhost-user-blk-pci,iommu_platform=on,ats=on,packed=on,bus=pci.0,addr=0xb,chardev=chr-vu-virtio-disk1,id=virtio-disk1: VIRTIO_F_IOMMU_P<br>LATFORM was supported by neither legacy nor transitional device</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
     if (disk->src->metadataCacheMaxSize > 0) {<br>
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",<br>
                        _("metadata_cache is not supported with vhostuser disk"));<br>
diff --git a/tests/qemuxml2argvdata/disk-vhostuser.x86_64-latest.args b/tests/qemuxml2argvdata/disk-vhostuser.x86_64-latest.args<br>
index b24b2c0b4f..30acd7c78b 100644<br>
--- a/tests/qemuxml2argvdata/disk-vhostuser.x86_64-latest.args<br>
+++ b/tests/qemuxml2argvdata/disk-vhostuser.x86_64-latest.args<br>
@@ -33,8 +33,8 @@ file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \<br>
 -device vhost-user-blk-pci,bus=pci.0,addr=0x2,chardev=chr-vu-virtio-disk0,\<br>
 id=virtio-disk0,bootindex=1 \<br>
 -chardev socket,id=chr-vu-virtio-disk1,path=/tmp/vhost1.sock,reconnect=10 \<br>
--device vhost-user-blk-pci,bus=pci.0,addr=0x3,chardev=chr-vu-virtio-disk1,\<br>
-id=virtio-disk1 \<br>
+-device vhost-user-blk-pci,iommu_platform=on,ats=on,packed=on,bus=pci.0,\<br>
+addr=0x3,chardev=chr-vu-virtio-disk1,id=virtio-disk1 \<br>
 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4 \<br>
 -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\<br>
 resourcecontrol=deny \<br>
diff --git a/tests/qemuxml2argvdata/disk-vhostuser.xml b/tests/qemuxml2argvdata/disk-vhostuser.xml<br>
index c96ef9119c..cbe2804e39 100644<br>
--- a/tests/qemuxml2argvdata/disk-vhostuser.xml<br>
+++ b/tests/qemuxml2argvdata/disk-vhostuser.xml<br>
@@ -20,7 +20,7 @@<br>
       <boot order='1'/><br>
     </disk><br>
     <disk type='vhostuser' device='disk'><br>
-      <driver name='qemu' type='raw'/><br>
+      <driver name='qemu' type='raw' iommu='on' ats='on' packed='on'/><br>
       <source type='unix' path='/tmp/vhost1.sock'><br>
         <reconnect enabled='yes' timeout='10'/><br>
       </source><br>
diff --git a/tests/qemuxml2xmloutdata/disk-vhostuser.x86_64-latest.xml b/tests/qemuxml2xmloutdata/disk-vhostuser.x86_64-latest.xml<br>
index 9712dc0b12..87f5ec46ac 100644<br>
--- a/tests/qemuxml2xmloutdata/disk-vhostuser.x86_64-latest.xml<br>
+++ b/tests/qemuxml2xmloutdata/disk-vhostuser.x86_64-latest.xml<br>
@@ -28,7 +28,7 @@<br>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/><br>
     </disk><br>
     <disk type='vhostuser' device='disk' snapshot='no'><br>
-      <driver name='qemu' type='raw'/><br>
+      <driver name='qemu' type='raw' iommu='on' ats='on' packed='on'/><br>
       <source type='unix' path='/tmp/vhost1.sock'><br>
         <reconnect enabled='yes' timeout='10'/><br>
       </source><br>
-- <br>
2.29.2<br>
<br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Reviewed-by: Han Han <<a href="mailto:hhan@redhat.com" target="_blank">hhan@redhat.com</a>></div><div>Tested-by: Han Han <<a href="mailto:hhan@redhat.com" target="_blank">hhan@redhat.com</a>></div></div></div></div>