From nobody Sun Feb 8 16:24:28 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 1547760179587612.8891985843669; Thu, 17 Jan 2019 13:22:59 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 58417461F8; Thu, 17 Jan 2019 21:22:57 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2AA23600C9; Thu, 17 Jan 2019 21:22:57 +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 E2F041803399; Thu, 17 Jan 2019 21:22:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x0HLMRNN004140 for ; Thu, 17 Jan 2019 16:22:27 -0500 Received: by smtp.corp.redhat.com (Postfix) id 2459460BE8; Thu, 17 Jan 2019 21:22:27 +0000 (UTC) Received: from unknown0050b6a41c42.attlocal.net.com (ovpn-116-60.phx2.redhat.com [10.3.116.60]) by smtp.corp.redhat.com (Postfix) with ESMTP id D2A9060BE5 for ; Thu, 17 Jan 2019 21:22:26 +0000 (UTC) From: John Ferlan To: libvir-list@redhat.com Date: Thu, 17 Jan 2019 16:22:14 -0500 Message-Id: <20190117212216.28316-9-jferlan@redhat.com> In-Reply-To: <20190117212216.28316-1-jferlan@redhat.com> References: <20190117212216.28316-1-jferlan@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v4 08/10] docs, tests: Add schema, description, and tests for NFS namespace 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.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 17 Jan 2019 21:22:57 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Modify the storagepool.rng to allow for the usage of a different XML namespace to parse the netfs_mount_opts to be included with the netfs storage pool definition. 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 --- docs/formatstorage.html.in | 57 +++++++++++++++++++ docs/schemas/storagepool.rng | 20 +++++++ tests/Makefile.am | 4 +- .../pool-netfs-ns-mountopts.xml | 25 ++++++++ .../pool-netfs-ns-mountopts.xml | 25 ++++++++ tests/storagepoolxml2xmltest.c | 6 ++ 6 files changed, 136 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 b1b76a1dda..7a5a38de9e 100644 --- a/docs/formatstorage.html.in +++ b/docs/formatstorage.html.in @@ -497,6 +497,63 @@ device, measured in bytes. Since 0.4.1

=20 +

Storage Pool Namespaces

+ +

+ Usage of Storage Pool Namespaces provides a mechanism to provide + pool type specific data in a free form or abitrary manner via + XML syntax targeted solely for the needs of the specific pool type + which is not otherwise supportable via XML. For the "netfs" pool + this provides a mechanism to provide additional mount options on the + command line. +

+
+
netfs:mount_opts
+
Provides an XML namespace mechanism to optionally utilize + specifically named options for the mount command via the "-o" + option for the 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: + +

+ xmlns:netfs=3D'http://libvirt.org/schemas/storagepool/source/netfs= /1.0' +

+ +

+ The netfs:mount_opts defines the mount options by + specifying multiple netfs: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 +
+<pool type=3D"netfs" xmlns:netfs=3D'http://libvirt.org/schemas/storagep=
ool/source/netfs/1.0'>
+  <name>nfsimages</name>
+...
+  <source>
+...
+  </source>
+...
+  <target>
+...
+  </target>
+  <netfs:mount_opts>
+    <netfs:option name=3D'sync'/>
+    <netfs:option name=3D'lazytime'/>
+  </netfs:mount_opts>
+</pool>
+...
+ + Since 5.1.0.
+ +
+

Storage volume XML

A storage volume will generally be either a file or a device diff --git a/docs/schemas/storagepool.rng b/docs/schemas/storagepool.rng index f9a16422cc..cea4bb474a 100644 --- a/docs/schemas/storagepool.rng +++ b/docs/schemas/storagepool.rng @@ -64,6 +64,9 @@ + + + =20 @@ -682,4 +685,21 @@ =20 + + + + + + + + + + + + + + diff --git a/tests/Makefile.am b/tests/Makefile.am index f74d8463b6..ab4c716529 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -937,7 +937,9 @@ storagevolxml2xmltest_LDADD =3D $(LDADDS) storagepoolxml2xmltest_SOURCES =3D \ storagepoolxml2xmltest.c \ testutils.c testutils.h -storagepoolxml2xmltest_LDADD =3D $(LDADDS) +storagepoolxml2xmltest_LDADD =3D $(LDADDS) \ + ../src/libvirt_driver_storage_impl.la \ + $(GNULIB_LIBS) =20 nodedevxml2xmltest_SOURCES =3D \ nodedevxml2xmltest.c \ diff --git a/tests/storagepoolxml2xmlin/pool-netfs-ns-mountopts.xml b/tests= /storagepoolxml2xmlin/pool-netfs-ns-mountopts.xml new file mode 100644 index 0000000000..6295edd6ee --- /dev/null +++ b/tests/storagepoolxml2xmlin/pool-netfs-ns-mountopts.xml @@ -0,0 +1,25 @@ + + nfsimages + 7641d5a8-af11-f730-a34e-0a7dfcede71f + 0 + 0 + 0 + + +

+ + + + + /mnt + + 0700 + 0 + 0 + + + + + + + diff --git a/tests/storagepoolxml2xmlout/pool-netfs-ns-mountopts.xml b/test= s/storagepoolxml2xmlout/pool-netfs-ns-mountopts.xml new file mode 100644 index 0000000000..efa7b07f31 --- /dev/null +++ b/tests/storagepoolxml2xmlout/pool-netfs-ns-mountopts.xml @@ -0,0 +1,25 @@ + + nfsimages + 7641d5a8-af11-f730-a34e-0a7dfcede71f + 0 + 0 + 0 + + + + + + + + /mnt + + 0700 + 0 + 0 + + + + + + + diff --git a/tests/storagepoolxml2xmltest.c b/tests/storagepoolxml2xmltest.c index d18390034f..aff9ff160c 100644 --- a/tests/storagepoolxml2xmltest.c +++ b/tests/storagepoolxml2xmltest.c @@ -11,6 +11,8 @@ #include "testutilsqemu.h" #include "virstring.h" =20 +#include "storage/storage_util.h" + #define VIR_FROM_THIS VIR_FROM_NONE =20 static int @@ -70,6 +72,9 @@ mymain(void) testCompareXMLToXMLHelper, (name)) < 0) \ ret =3D -1 =20 + if (storageRegisterAll() < 0) + return EXIT_FAILURE; + DO_TEST("pool-dir"); DO_TEST("pool-dir-naming"); DO_TEST("pool-fs"); @@ -86,6 +91,7 @@ mymain(void) DO_TEST("pool-netfs-protocol-ver"); DO_TEST("pool-netfs-gluster"); DO_TEST("pool-netfs-cifs"); + DO_TEST("pool-netfs-ns-mountopts"); DO_TEST("pool-scsi"); DO_TEST("pool-scsi-type-scsi-host"); DO_TEST("pool-scsi-type-fc-host"); --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list