[libvirt] [RFC PATCH 0/9] add virtiofs support (virtio-fs epopee)

Ján Tomko posted 9 patches 35 weeks ago
Test syntax-check passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/cover.1572609485.git.jtomko@redhat.com
docs/schemas/domaincommon.rng                 |   1 +
src/conf/domain_conf.c                        |   1 +
src/conf/domain_conf.h                        |   2 +
src/qemu/qemu_capabilities.c                  |   4 +
src/qemu/qemu_capabilities.h                  |   3 +
src/qemu/qemu_command.c                       |  67 +++++-
src/qemu/qemu_domain.c                        |   4 +
src/qemu/qemu_domain_address.c                |  35 +++-
src/qemu/qemu_extdevice.c                     | 191 ++++++++++++++++++
...vhost-user-fs-fd-memory.x86_64-latest.args |  38 ++++
.../vhost-user-fs-fd-memory.xml               |  38 ++++
...vhost-user-fs-hugepages.x86_64-latest.args |  42 ++++
.../vhost-user-fs-hugepages.xml               |  67 ++++++
tests/qemuxml2argvtest.c                      |   9 +
.../vhost-user-fs-fd-memory.x86_64-latest.xml |   1 +
.../vhost-user-fs-hugepages.x86_64-latest.xml |   1 +
tests/qemuxml2xmltest.c                       |   3 +
17 files changed, 493 insertions(+), 14 deletions(-)
create mode 100644 tests/qemuxml2argvdata/vhost-user-fs-fd-memory.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/vhost-user-fs-fd-memory.xml
create mode 100644 tests/qemuxml2argvdata/vhost-user-fs-hugepages.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/vhost-user-fs-hugepages.xml
create mode 120000 tests/qemuxml2xmloutdata/vhost-user-fs-fd-memory.x86_64-latest.xml
create mode 120000 tests/qemuxml2xmloutdata/vhost-user-fs-hugepages.x86_64-latest.xml

[libvirt] [RFC PATCH 0/9] add virtiofs support (virtio-fs epopee)

Posted by Ján Tomko 35 weeks ago
https://bugzilla.redhat.com/show_bug.cgi?id=1694166

A work in progress, but I'm sending it now to get the XML
bikesh^Wdiscussion out of the way.

TODO:
  * documentation
    (due to the requirement of shared memory and therefore
     a <numa> topology specification, this probably deserves
     a separate article on https://libvirt.org/kbase.html )
  * validation - refuse unsupported combinations and block
    migration
  * remove a few hardcoded values
    * figure out the binary path from qemu interop config
    * leave queue-size and cache-size on their default values
      or expose them in XML
  * use FD passing for vhost-user-fs device as well
  * clean up the code

Tested with:
  commit 320000e72ec0613e164ce9608d865396fb2da278
  Author: Linus Torvalds <torvalds@linux-foundation.org>
  Date:   Wed Oct 30 14:17:18 2019 +0100

    Merge tag 'iommu-fixes-v5.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu

  and

  commit d3d2efbb0e37494708dde359a9d0f492f84833e8
  Author:     Dr. David Alan Gilbert <dgilbert@redhat.com>
  CommitDate: 2019-10-24 11:50:55 +0100

    virtio-fs: Allow mapping of meta data version table

  from https://gitlab.com/virtio-fs/qemu/tree/virtio-fs-dev

  git fetch https://gitlab.com/virtio-fs/qemu.git virtio-fs-dev
  (not yet merged upstream)

Ján Tomko (9):
  qemu: address: take fsdriver type into account
  qemu: cmdline: take fsdriver into account
  qemu: add QEMU_CAPS_VHOST_USER_FS
  wip: tests: add xml2xml tests for virtio-fs
  wip: add XML -> ARGV tests for virtio-fs
  conf: qemu: add virtio-fs fsdriver type
  qemu: pass private data to qemuBuildFilesystemCommandLine
  wip: start virtiofsd
  wip: build vhost-user-fs device command line

 docs/schemas/domaincommon.rng                 |   1 +
 src/conf/domain_conf.c                        |   1 +
 src/conf/domain_conf.h                        |   2 +
 src/qemu/qemu_capabilities.c                  |   4 +
 src/qemu/qemu_capabilities.h                  |   3 +
 src/qemu/qemu_command.c                       |  67 +++++-
 src/qemu/qemu_domain.c                        |   4 +
 src/qemu/qemu_domain_address.c                |  35 +++-
 src/qemu/qemu_extdevice.c                     | 191 ++++++++++++++++++
 ...vhost-user-fs-fd-memory.x86_64-latest.args |  38 ++++
 .../vhost-user-fs-fd-memory.xml               |  38 ++++
 ...vhost-user-fs-hugepages.x86_64-latest.args |  42 ++++
 .../vhost-user-fs-hugepages.xml               |  67 ++++++
 tests/qemuxml2argvtest.c                      |   9 +
 .../vhost-user-fs-fd-memory.x86_64-latest.xml |   1 +
 .../vhost-user-fs-hugepages.x86_64-latest.xml |   1 +
 tests/qemuxml2xmltest.c                       |   3 +
 17 files changed, 493 insertions(+), 14 deletions(-)
 create mode 100644 tests/qemuxml2argvdata/vhost-user-fs-fd-memory.x86_64-latest.args
 create mode 100644 tests/qemuxml2argvdata/vhost-user-fs-fd-memory.xml
 create mode 100644 tests/qemuxml2argvdata/vhost-user-fs-hugepages.x86_64-latest.args
 create mode 100644 tests/qemuxml2argvdata/vhost-user-fs-hugepages.xml
 create mode 120000 tests/qemuxml2xmloutdata/vhost-user-fs-fd-memory.x86_64-latest.xml
 create mode 120000 tests/qemuxml2xmloutdata/vhost-user-fs-hugepages.x86_64-latest.xml

-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [RFC PATCH 0/9] add virtiofs support (virtio-fs epopee)

Posted by Stefan Hajnoczi 35 weeks ago
On Fri, Nov 1, 2019 at 1:15 PM Ján Tomko <jtomko@redhat.com> wrote:

Great, this looks like the right direction.

>     * leave queue-size and cache-size on their default values
>       or expose them in XML

Please support the following parameters:
 * virtiofsd path - useful for testing custom virtiofsd binaries or
alternative implementations (similar to setting <emulator> path)
 * DAX Window size: -device vhost-user-fs-device cache-size (in
megabytes and cache-size=0 means disable the DAX Window)
 * cache mode: virtiofsd -o cache=none|auto|always

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [RFC PATCH 0/9] add virtiofs support (virtio-fs epopee)

Posted by Masayoshi Mizuma 29 weeks ago
Hi Ján,

Could you add no_posix_lock and no_flock option for virtiofsd as well?
The sample patch is as follows:

---
 docs/schemas/domaincommon.rng | 10 ++++++++++
 src/conf/domain_conf.c        | 10 ++++++++++
 src/conf/domain_conf.h        |  2 ++
 src/qemu/qemu_extdevice.c     | 10 ++++++++++
 4 files changed, 32 insertions(+)

diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index f6479c9..6dd8e2a 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -2523,6 +2523,16 @@
             <empty/>
           </element>
         </optional>
+        <optional>
+          <element name='no_posix_lock'>
+            <empty/>
+          </element>
+        </optional>
+        <optional>
+          <element name='no_flock'>
+            <empty/>
+          </element>
+        </optional>
         <optional>
           <ref name="alias"/>
         </optional>
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 2694e4b..8223910 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -11055,6 +11055,10 @@ virDomainFSDefParseXML(virDomainXMLOptionPtr xmlopt,
                 target = virXMLPropString(cur, "dir");
             } else if (virXMLNodeNameEqual(cur, "readonly")) {
                 def->readonly = true;
+            } else if (virXMLNodeNameEqual(cur, "no_posix_lock")) {
+                def->no_posix_lock = true;
+            } else if (virXMLNodeNameEqual(cur, "no_flock")) {
+                def->no_flock = true;
             } else if (virXMLNodeNameEqual(cur, "driver")) {
                 if (!fsdriver)
                     fsdriver = virXMLPropString(cur, "type");
@@ -24899,6 +24903,12 @@ virDomainFSDefFormat(virBufferPtr buf,
     if (def->readonly)
         virBufferAddLit(buf, "<readonly/>\n");
 
+    if (def->no_posix_lock)
+        virBufferAddLit(buf, "<no_posix_lock/>\n");
+
+    if (def->no_flock)
+        virBufferAddLit(buf, "<no_flock/>\n");
+
     if (virDomainDeviceInfoFormat(buf, &def->info, flags) < 0)
         goto cleanup;
 
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 78f88a0..8a60c8c 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -812,6 +812,8 @@ struct _virDomainFSDef {
     virStorageSourcePtr src;
     char *dst;
     bool readonly;
+    bool no_posix_lock;
+    bool no_flock;
     virDomainDeviceInfo info;
     unsigned long long space_hard_limit; /* in bytes */
     unsigned long long space_soft_limit; /* in bytes */
diff --git a/src/qemu/qemu_extdevice.c b/src/qemu/qemu_extdevice.c
index 634a3fb..618a886 100644
--- a/src/qemu/qemu_extdevice.c
+++ b/src/qemu/qemu_extdevice.c
@@ -242,6 +242,16 @@ qemuExtVirtioFSdStart(virQEMUDriverPtr driver,
     virCommandAddArgFormat(cmd, "source=%s", fs->src->path);
     virCommandAddArg(cmd, "-d");
 
+    if (fs->no_posix_lock) {
+        virCommandAddArg(cmd, "-o");
+        virCommandAddArg(cmd, "no_posix_lock");
+    }
+
+    if (fs->no_flock) {
+        virCommandAddArg(cmd, "-o");
+        virCommandAddArg(cmd, "no_flock");
+    }
+
     if (qemuExtDeviceLogCommand(driver, vm, cmd, "virtiofsd") < 0)
         goto cleanup;
 
-- 
2.18.1


--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list