From: Christian Schoenebeck
Date: Mon, 30 Mar 2020 18:05:33 +0000 (+0200)
Subject: conf: add 'multidevs' option
X-Git-Tag: v6.3.0-rc1~243
X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c3a1856890b9d75df08a66a95ac5a217b3aadc89;p=thirdparty%2Flibvirt.git
conf: add 'multidevs' option
Introduce new 'multidevs' option for filesystem.
This option prevents misbehaviours on guest if a qemu 9pfs export
contains multiple devices, due to the potential file ID collisions
this otherwise may cause.
Signed-off-by: Christian Schoenebeck
Signed-off-by: Ján Tomko
Reviewed-by: Ján Tomko
---
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index aaeb05961f..fbffb16866 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -3973,7 +3973,7 @@
<source name='my-vm-template'/>
<target dir='/'/>
</filesystem>
- <filesystem type='mount' accessmode='passthrough'>
+ <filesystem type='mount' accessmode='passthrough' multidevs='remap'>
<driver type='path' wrpolicy='immediate'/>
<source dir='/export/to/guest'/>
<target dir='/import/from/host'/>
@@ -4098,6 +4098,44 @@
for more details.
+
+ The filesystem element has an optional attribute multidevs
+ which specifies how to deal with a filesystem export containing more than
+ one device, in order to avoid file ID collisions on guest when using 9pfs
+ (since 6.3.0, requires QEMU 4.2).
+ This attribute is not available for virtiofs. The possible values are:
+
+
+
+
default
+
+ Use QEMU's default setting (which currently is warn).
+
+
remap
+
+ This setting allows guest to access multiple devices per export without
+ encountering misbehaviours. Inode numbers from host are automatically
+ remapped on guest to actively prevent file ID collisions if guest
+ accesses one export containing multiple devices.
+
+
forbid
+
+ Only allow to access one device per export by guest. Attempts to access
+ additional devices on the same export will cause the individual
+ filesystem access by guest to fail with an error and being logged (once)
+ as error on host side.
+
+
warn
+
+ This setting resembles the behaviour of 9pfs prior to QEMU 4.2, that is
+ no action is performed to prevent any potential file ID collisions if an
+ export contains multiple devices, with the only exception: a warning is
+ logged (once) on host side now. This setting may lead to misbehaviours
+ on guest side if more than one device is exported per export, due to the
+ potential file ID collisions this may cause on guest side in that case.
+