From 20030393a5302c5bf7a003d0005fddaedb8bfbe9 Mon Sep 17 00:00:00 2001 Message-Id: <20030393a5302c5bf7a003d0005fddaedb8bfbe9@dist-git> From: Eric Blake Date: Wed, 26 Feb 2014 14:54:14 +0100 Subject: [PATCH] storage: fix RNG validation of gluster via netfs https://bugzilla.redhat.com/show_bug.cgi?id=1032370 While trying to compare netfs against my new gluster pool, I discovered two things: virt-xml-validate chokes on valid xml produced by 'virsh pool-dumpxml' [yet another reason that ALL patches that add new xml should be adding corresponding tests] When using glusterfs FUSE mounts, you cannot access a subdirectory of a gluster volume. The recommended workaround in the gluster community is to mount the volume to an intermediate location, then bind-mount the desired subdirectory to the final location. Maybe we should teach libvirt to do bind-mounting, but for now I chose to just document the limitation. * docs/storage.html.in: Improve documentation. * docs/schemas/storagepool.rng (sourcefmtnetfs): Allow all formats, and drop redundant info-vendor. * tests/storagepoolxml2xmltest.c (mymain): New test. * tests/storagepoolxml2xmlin/pool-netfs-gluster.xml: New file. * tests/storagepoolxml2xmlout/pool-netfs-gluster.xml: Likewise. Signed-off-by: Eric Blake (cherry picked from commit 887dd3625b71e6d71aa362a46cf6075b13cb1bb5) Signed-off-by: Jiri Denemark --- docs/schemas/storagepool.rng | 5 ++--- docs/storage.html.in | 11 ++++++++--- tests/storagepoolxml2xmlin/pool-netfs-gluster.xml | 12 ++++++++++++ tests/storagepoolxml2xmlout/pool-netfs-gluster.xml | 20 ++++++++++++++++++++ tests/storagepoolxml2xmltest.c | 1 + 5 files changed, 43 insertions(+), 6 deletions(-) create mode 100644 tests/storagepoolxml2xmlin/pool-netfs-gluster.xml create mode 100644 tests/storagepoolxml2xmlout/pool-netfs-gluster.xml diff --git a/docs/schemas/storagepool.rng b/docs/schemas/storagepool.rng index a4ef5af..72c4fd6 100644 --- a/docs/schemas/storagepool.rng +++ b/docs/schemas/storagepool.rng @@ -349,11 +349,10 @@ auto nfs + cifs + glusterfs - - - diff --git a/docs/storage.html.in b/docs/storage.html.in index 1181444..0464565 100644 --- a/docs/storage.html.in +++ b/docs/storage.html.in @@ -249,7 +249,8 @@ a local block device as the source, it requires the name of a host and path of an exported directory. It will mount this network filesystem and manage files within the directory of its mount - point. It will default to using NFS as the protocol. + point. It will default to using auto as the + protocol, which generally tries a mount via NFS first.

Example pool input

@@ -259,6 +260,7 @@ <source> <host name="nfs.example.com"/> <dir path="/var/lib/virt/images"/> + <format type='nfs'/> </source> <target> <path>/var/lib/virt/images</path> @@ -275,10 +277,13 @@ nfs
  • - glusterfs + glusterfs - use the glusterfs FUSE file system. + For now, the dir specified as the source can only + be a gluster volume name, as gluster does not provide a way to + directly mount subdirectories within a volume.
  • - cifs + cifs - use the SMB (samba) or CIFS file system
  • diff --git a/tests/storagepoolxml2xmlin/pool-netfs-gluster.xml b/tests/storagepoolxml2xmlin/pool-netfs-gluster.xml new file mode 100644 index 0000000..9b39e87 --- /dev/null +++ b/tests/storagepoolxml2xmlin/pool-netfs-gluster.xml @@ -0,0 +1,12 @@ + + + + + + + netfs-gluster + d5609ced-94b1-489e-b218-eff35c30336a + + /mnt/gluster + + diff --git a/tests/storagepoolxml2xmlout/pool-netfs-gluster.xml b/tests/storagepoolxml2xmlout/pool-netfs-gluster.xml new file mode 100644 index 0000000..bab2a15 --- /dev/null +++ b/tests/storagepoolxml2xmlout/pool-netfs-gluster.xml @@ -0,0 +1,20 @@ + + netfs-gluster + d5609ced-94b1-489e-b218-eff35c30336a + 0 + 0 + 0 + + + + + + + /mnt/gluster + + 0755 + -1 + -1 + + + diff --git a/tests/storagepoolxml2xmltest.c b/tests/storagepoolxml2xmltest.c index d59cff9..8e4ea42 100644 --- a/tests/storagepoolxml2xmltest.c +++ b/tests/storagepoolxml2xmltest.c @@ -93,6 +93,7 @@ mymain(void) DO_TEST("pool-iscsi"); DO_TEST("pool-iscsi-auth"); DO_TEST("pool-netfs"); + DO_TEST("pool-netfs-gluster"); DO_TEST("pool-scsi"); DO_TEST("pool-scsi-type-scsi-host"); DO_TEST("pool-scsi-type-fc-host"); -- 1.9.0