]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
conf: require target for external virtiofsd
authorJán Tomko <jtomko@redhat.com>
Wed, 16 Jun 2021 13:35:16 +0000 (15:35 +0200)
committerJán Tomko <jtomko@redhat.com>
Thu, 17 Jun 2021 08:51:24 +0000 (10:51 +0200)
When adding support for externally launched virtiofsd,
I was too liberal and did not require a target.

But the target is required, because it's passed to the
QEMU device, not to virtiofsd.

https://bugzilla.redhat.com/show_bug.cgi?id=1969232

Fixes: 12967c3e1333a6e106110f449ccb1e96279b9527
Fixes: 56dcdec1ac8104f94371c210585bab91eb36395d
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
docs/formatdomain.rst
docs/kbase/virtiofs.rst
src/conf/domain_validate.c
tests/qemuxml2argvdata/vhost-user-fs-sock.xml

index da4d93a7875d2e404354ffb7c1a0d6d2dfab64bc..c6dede053f67dad8175118badbaca31a05e533b6 100644 (file)
@@ -3261,6 +3261,7 @@ A directory on the host that can be accessed directly from the guest.
      <filesystem type='mount'>
          <driver type='virtiofs' queue='1024'/>
          <source socket='/tmp/sock'/>
+         <target dir='tag'/>
      </filesystem>
      ...
    </devices>
index 8cf7567bf8c435b36ca0a4e1e1cbe909637dc415..6ba7299a72071f1287d4f175ef3df56edc75747c 100644 (file)
@@ -180,4 +180,5 @@ control and need to be set by the application running virtiofsd.
   <filesystem type='mount'/>
     <driver type='virtiofs' queue='1024'/>
     <source socket='/var/virtiofsd.sock'/>
+    <target dir='tag'/>
   </filesystem>
index bba5a856574dd4874e04a1f7bcf5a4240b22117b..2124d25d16b3dfcd1f573d2eff74fece236b8996 100644 (file)
@@ -2036,8 +2036,10 @@ virDomainShmemDefValidate(const virDomainShmemDef *shmem)
 static int
 virDomainFSDefValidate(const virDomainFSDef *fs)
 {
-    if (fs->dst == NULL && !fs->sock) {
+    if (fs->dst == NULL) {
         const char *source = fs->src->path;
+        if (!source)
+            source = fs->sock;
 
         virReportError(VIR_ERR_NO_TARGET,
                        source ? "%s" : NULL, source);
index aef005d3fd25c28b251146359f26a4bfca798b0b..e5a380c9b6c7fa13619d8a3dcdd426c02439229c 100644 (file)
@@ -29,6 +29,7 @@
     <filesystem type='mount'>
       <driver type='virtiofs' queue='1024'/>
       <source socket='/tmp/sock'/>
+      <target dir='tag'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
     </filesystem>
     <input type='mouse' bus='ps2'/>