Skip to content

add support for QEMU 9pfs 'multidevs' option

Christian Schoenebeck qemu-devel 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 0 repliesNew
  2. v11 patch 4 repliesSuperseded

Changes in v2 from the cover letter

* Unrelated docs/formatdomain.html.in changes to separate patch.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4docs: virtfs: add section separatorsdocs/formatdomain.html.in+7 -00 replies
2/4qemu: capabilities: add QEMU_CAPS_VIRTFS_MULTIDEVSsrc/qemu/qemu_capabilities.c src/qemu/qemu_capabilities.h tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml +2 more+9 -00 replies
3/4conf: add 'multidevs' optiondocs/formatdomain.html.in docs/schemas/domaincommon.rng src/conf/domain_conf.c +1 more+91 -10 replies
4/4qemu: add support for 'multidevs' optionsrc/qemu/qemu_command.c src/qemu/qemu_domain.c+19 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/4] add support for QEMU 9pfs 'multidevs' option

QEMU 4.2 added a new option 'multidevs' for 9pfs. The following patch adds support for this new option to libvirt.

In short, what is this about: to distinguish files uniquely from each other in general, numeric file IDs are typically used for comparison, which in practice is the combination of a file's device ID and the file's inode number. Unfortunately 9p protocol's QID field used for this purpose, currently is too small to fit both the device ID and inode number in, which hence is a problem if one 9pfs export contains multiple devices and may thus lead to misbheaviours on guest (e.g. with SAMBA file servers) in that case due to potential file ID collisions.

To mitigate this problem with 9pfs a 'multidevs' option was introduced in QEMU 4.2 for defining how to deal with this, e.g. multidevs=remap will cause QEMU's 9pfs implementation to remap all inodes from host side to different inode numbers on guest side in a way that prevents file ID collisions.

NOTE: In the libvirt docs changes of this libvirt patch I simply assumed "since 6.2.0". So the final libvirt version number would need to be adjusted in that text if necessary.

See QEMU discussion with following Message-ID for details:
8a2ffe17fda3a86b9a5a437e1245276881f1e235.1567680121.git.qemu_oss@crudebyte.com

v1->v2:

* Unrelated docs/formatdomain.html.in changes to separate patch.

    [patch 1]

* Added new capability QEMU_CAPS_VIRTFS_MULTIDEVS.

    [patch 2]

* XML changes as isolated patch.

    [patch 3]

* Code style fix.

    [patch 3]

* QEMU 'multidevs' command handling as isolated patch.

    [patch 4]

* Error out if not QEMU_CAPS_VIRTFS_MULTIDEVS capability.

    [patch 4]

* Error out on virtiofs (since it does not have the 'multidevs' option).

    [patch 4]

TODO:

* Capabilities test cases would fail if <flag name='virtfs-multidevs'/> was added to the other architectures' test case xml files, why? [patch 2]

* The requested test cases to add: Sorry, the libvirt test case environment is yet a mystery to me, I would not even know where to start here.

Message-ID of v1: [email protected]

Christian Schoenebeck (4):
docs: virtfs: add section separators
qemu: capabilities: add QEMU_CAPS_VIRTFS_MULTIDEVS
conf: add 'multidevs' option
qemu: add support for 'multidevs' option

 docs/formatdomain.html.in                     | 47 ++++++++++++++++++-
 docs/schemas/domaincommon.rng                 | 10 ++++
 src/conf/domain_conf.c                        | 29 ++++++++++++
 src/conf/domain_conf.h                        | 13 +++++
 src/qemu/qemu_capabilities.c                  |  5 ++
 src/qemu/qemu_capabilities.h                  |  1 +
 src/qemu/qemu_command.c                       |  7 +++
 src/qemu/qemu_domain.c                        | 12 +++++
 .../caps_4.2.0.x86_64.xml                     |  1 +
 .../caps_5.0.0.aarch64.xml                    |  1 +
 .../caps_5.0.0.x86_64.xml                     |  1 +
 11 files changed, 126 insertions(+), 1 deletion(-)
Signature · 1 line
2.20.1