From patchwork Fri Mar 20 16:51:35 2020
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Christian Schoenebeck
X-Patchwork-Id: 1259141
Return-Path:
X-Original-To: incoming@patchwork.ozlabs.org
Delivered-To: patchwork-incoming@bilbo.ozlabs.org
Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized)
smtp.mailfrom=nongnu.org (client-ip=209.51.188.17;
helo=lists.gnu.org;
envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;
receiver=)
Authentication-Results: ozlabs.org; dmarc=pass (p=quarantine dis=none)
header.from=crudebyte.com
Authentication-Results: ozlabs.org; dkim=pass (2048-bit key;
unprotected) header.d=crudebyte.com header.i=@crudebyte.com
header.a=rsa-sha256 header.s=lizzy header.b=cQXO7vK6;
dkim-atps=neutral
Received: from lists.gnu.org (lists.gnu.org [209.51.188.17])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256
bits)) (No client certificate requested)
by ozlabs.org (Postfix) with ESMTPS id 48kWlM6wJzz9sPF
for ;
Sat, 21 Mar 2020 05:00:15 +1100 (AEDT)
Received: from localhost ([::1]:57238 helo=lists1p.gnu.org)
by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from
)
id 1jFLwL-0002nP-UW
for incoming@patchwork.ozlabs.org; Fri, 20 Mar 2020 14:00:13 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:38958)
by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from
<680df3de98cf66c7637fec5274761b535b9f4918@lizzy.crudebyte.com>)
id 1jFLw1-0002n5-Mi
for qemu-devel@nongnu.org; Fri, 20 Mar 2020 13:59:55 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
(envelope-from
<680df3de98cf66c7637fec5274761b535b9f4918@lizzy.crudebyte.com>)
id 1jFLvz-0007Z2-Q8
for qemu-devel@nongnu.org; Fri, 20 Mar 2020 13:59:53 -0400
Received: from lizzy.crudebyte.com ([91.194.90.13]:53895)
by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
(Exim 4.71) (envelope-from
<680df3de98cf66c7637fec5274761b535b9f4918@lizzy.crudebyte.com>)
id 1jFLvz-0007FB-AW
for qemu-devel@nongnu.org; Fri, 20 Mar 2020 13:59:51 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
d=crudebyte.com; s=lizzy;
h=Cc:To:Subject:Date:From:References:In-Reply-To:
Message-Id:Content-Type:Content-Transfer-Encoding:MIME-Version:Content-ID:
Content-Description; bh=aSFPumI060vrsGGcam3KjHjMgS6gIvm9ZtHfi26NJs8=;
b=cQXO7
vK6ab9eDWETUGmfOuQKuFBGkqN5twrZXWMNV+DxbaaLMESY0zdXzEgJDSdV4TX1JqUJ03AyxL8EZm
1b87zJXMqYe39W5+bpBEtBN6TJclv/ues21sEVyFMjEyJmKNFLJT9G8bTd9Nspsq8daYEzyRW5ii6
4VQA0ywfuOtawV/jRG8vpRq9LIhJNtB+pmkbCDK6yWLoC7Ozan/uh3U8uuYfWGzE7jZuDjPk2ytzZ
HHWN6Rgg6AByIbkaP2cEAhDuO0a9cNL9JLeY8tZFRsAHUhvRM2Rh/oTdNGPRqD/YLxLuD33hwpvGb
PYep29VbE+46TIyeG0uZNPnstiw0w==;
Message-Id:
<680df3de98cf66c7637fec5274761b535b9f4918.1584723662.git.qemu_oss@crudebyte.com>
In-Reply-To:
References:
From: Christian Schoenebeck
Date: Fri, 20 Mar 2020 17:51:35 +0100
Subject: [PATCH v2 3/4] conf: add 'multidevs' option
To: libvir-list@redhat.com
Cc: qemu-devel@nongnu.org,
Greg Kurz
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 91.194.90.13
X-BeenThere: qemu-devel@nongnu.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id:
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org
Sender: "Qemu-devel"
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
---
docs/formatdomain.html.in | 40 ++++++++++++++++++++++++++++++++++-
docs/schemas/domaincommon.rng | 10 +++++++++
src/conf/domain_conf.c | 29 +++++++++++++++++++++++++
src/conf/domain_conf.h | 13 ++++++++++++
4 files changed, 91 insertions(+), 1 deletion(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index cc2c671c14..13c506988b 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -3967,7 +3967,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'/>
@@ -4092,6 +4092,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.2.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.
+