From nobody Sun Feb 8 21:33:43 2026
Delivered-To: importer@patchew.org
Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28
as permitted sender) client-ip=209.132.183.28;
envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com;
Authentication-Results: mx.zohomail.com;
spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as
permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com;
dmarc=pass(p=none dis=none) header.from=redhat.com
Return-Path:
Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by
mx.zohomail.com
with SMTPS id 15487861605031015.2776217799557;
Tue, 29 Jan 2019 10:22:40 -0800 (PST)
Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com
[10.5.11.22])
(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
(No client certificate requested)
by mx1.redhat.com (Postfix) with ESMTPS id 3C82023E6F4;
Tue, 29 Jan 2019 18:22:37 +0000 (UTC)
Received: from colo-mx.corp.redhat.com
(colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21])
by smtp.corp.redhat.com (Postfix) with ESMTPS id D781C112C1B1;
Tue, 29 Jan 2019 18:22:36 +0000 (UTC)
Received: from lists01.pubmisc.prod.ext.phx2.redhat.com
(lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33])
by colo-mx.corp.redhat.com (Postfix) with ESMTP id 848943F608;
Tue, 29 Jan 2019 18:22:36 +0000 (UTC)
Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com
[10.5.11.23])
by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP
id x0TIMF7S002136 for ;
Tue, 29 Jan 2019 13:22:15 -0500
Received: by smtp.corp.redhat.com (Postfix)
id 40C3B28D28; Tue, 29 Jan 2019 18:22:15 +0000 (UTC)
Received: from unknown0050b6a41c42.attlocal.net.com
(ovpn-116-45.phx2.redhat.com [10.3.116.45])
by smtp.corp.redhat.com (Postfix) with ESMTP id DCB4B177AB
for ; Tue, 29 Jan 2019 18:22:14 +0000 (UTC)
From: John Ferlan
To: libvir-list@redhat.com
Date: Tue, 29 Jan 2019 13:22:06 -0500
Message-Id: <20190129182208.23788-8-jferlan@redhat.com>
In-Reply-To: <20190129182208.23788-1-jferlan@redhat.com>
References: <20190129182208.23788-1-jferlan@redhat.com>
MIME-Version: 1.0
X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23
X-loop: libvir-list@redhat.com
Subject: [libvirt] [PATCH v5 7/9] storage: Add infrastructure to manage XML
namespace options
X-BeenThere: libvir-list@redhat.com
X-Mailman-Version: 2.1.12
Precedence: junk
List-Id: Development discussions about the libvirt library & tools
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
Content-Transfer-Encoding: quoted-printable
Sender: libvir-list-bounces@redhat.com
Errors-To: libvir-list-bounces@redhat.com
X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22
X-Greylist: Sender IP whitelisted,
not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]);
Tue, 29 Jan 2019 18:22:38 +0000 (UTC)
Content-Type: text/plain; charset="utf-8"
Introduce the virStoragePoolFSMountOptionsDef to be used to
manage the Storage Pool XML Namespace for mount options.
Using a new virStorageBackendNamespaceInit function, set the
virStoragePoolXMLNamespace into the _virStoragePoolOptions when
the storage backend is loaded.
Modify the storagepool.rng to allow for the usage of a different
XML namespace to parse the fs_mount_opts to be included with
the fs and netfs storage pool definitions.
Modify the storagepoolxml2xmltest to utilize a properly modified
XML file to parse and format the namespace for a netfs storage pool.
Signed-off-by: John Ferlan
Reviewed-by: Daniel P. Berrang=C3=A9
---
docs/formatstorage.html.in | 63 +++++++++
docs/schemas/storagepool.rng | 23 +++
src/storage/storage_backend_fs.c | 132 ++++++++++++++++++
src/storage/storage_util.c | 16 +++
src/storage/storage_util.h | 14 ++
tests/Makefile.am | 4 +-
.../pool-netfs-ns-mountopts.xml | 25 ++++
.../pool-netfs-ns-mountopts.xml | 25 ++++
tests/storagepoolxml2xmltest.c | 6 +
9 files changed, 307 insertions(+), 1 deletion(-)
create mode 100644 tests/storagepoolxml2xmlin/pool-netfs-ns-mountopts.xml
create mode 100644 tests/storagepoolxml2xmlout/pool-netfs-ns-mountopts.xml
diff --git a/docs/formatstorage.html.in b/docs/formatstorage.html.in
index 85107c85ae..7a79ec82d8 100644
--- a/docs/formatstorage.html.in
+++ b/docs/formatstorage.html.in
@@ -508,6 +508,69 @@
device, measured in bytes. Since 0.4.1
+ Usage of Storage Pool Namespaces provides a mechanism to provide
+ pool type specific data in a free form or arbitrary manner via
+ XML syntax targeted solely for the needs of the specific pool type
+ which is not otherwise supported in standard XML. For the "fs" and
+ "netfs" pool types this provides a mechanism to provide additional
+ mount options on the command line.
+
+
+ Usage of namespaces comes with no support guarantees. It is intended
+ for developers testing out a concept prior to requesting an explicit=
ly
+ supported XML option in libvirt, and thus should never be used in
+ production.
+
+
+
fs:mount_opts
+
Provides an XML namespace mechanism to optionally utilize
+ specifically named options for the mount command via the "-o"
+ option for the fs or netfs type storage
+ pools. In order to designate that the Storage Pool will be using
+ the mechanism, the pool element must be modified to
+ provide the XML namespace attribute syntax as follows:
+
+
+ The fs:mount_opts defines the mount options by
+ specifying multiple fs:option subelements with
+ the attribute name specifying the mount option to
+ be added. The value of the named option is not checked since
+ it's possible options don't exist on all distributions. It is
+ expected that proper and valid options will be supplied for the
+ target host.
+
+
+ The following XML snippet shows the syntax required in order to
+ utilize for a netfs pool:
+