storage: add network-dir as new storage volume type

In the 'directory' and 'netfs' storage pools, a user can see
both 'file' and 'dir' storage volume types, to know when they
can descend into a subdirectory.  But in a network-based storage
pool, such as the upcoming 'gluster' pool, we use 'network'
instead of 'file', and did not have any counterpart for a
directory until this patch.  Adding a new volume type
'network-dir' is better than reusing 'dir', because it makes
it clear that the only way to access 'network' volumes within
that container is through the network mounting (leaving 'dir'
for something accessible in the local file system).

* include/libvirt/libvirt.h.in (virStorageVolType): Expand enum.
* docs/formatstorage.html.in: Document it.
* docs/schemasa/storagevol.rng (vol): Allow new value.
* src/conf/storage_conf.c (virStorageVol): Use new value.
* src/qemu/qemu_command.c (qemuBuildVolumeString): Fix client.
* src/qemu/qemu_conf.c (qemuTranslateDiskSourcePool): Likewise.
* tools/virsh-volume.c (vshVolumeTypeToString): Likewise.
* src/storage/storage_backend_fs.c
(virStorageBackendFileSystemVolDelete): Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
Eric Blake committed 2013-11-25 12:29:49 -07:00
1 parent efee1af54a
commit ecd881b7a7
8 files changed
+19 -8

No files matched your search

+4 -1
View File
@@ -947,7 +947,7 @@ out:
static const char *
vshVolumeTypeToString(int type)
{
switch (type) {
switch ((virStorageVolType) type) {
case VIR_STORAGE_VOL_FILE:
return N_("file");
@@ -960,6 +960,9 @@ vshVolumeTypeToString(int type)
case VIR_STORAGE_VOL_NETWORK:
return N_("network");
case VIR_STORAGE_VOL_NETDIR:
return N_("netdir");
case VIR_STORAGE_VOL_LAST:
break;
}