[libvirt] [PATCHv4 4/8] storage: add network-dir as new storage volume type

Daniel P. Berrange berrange at redhat.com
Mon Nov 25 10:42:30 UTC 2013


On Fri, Nov 22, 2013 at 08:20:26PM -0700, Eric Blake wrote:
> 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.
> * 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 at redhat.com>
> ---
>  include/libvirt/libvirt.h.in     | 2 ++
>  src/conf/storage_conf.c          | 2 +-
>  src/qemu/qemu_command.c          | 6 ++++--
>  src/qemu/qemu_conf.c             | 4 +++-
>  src/storage/storage_backend_fs.c | 5 +++--
>  tools/virsh-volume.c             | 5 ++++-
>  6 files changed, 17 insertions(+), 7 deletions(-)
> 
> diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in
> index 146a59b..5e8cba6 100644
> --- a/include/libvirt/libvirt.h.in
> +++ b/include/libvirt/libvirt.h.in
> @@ -2951,6 +2951,8 @@ typedef enum {
>      VIR_STORAGE_VOL_BLOCK = 1,    /* Block based volumes */
>      VIR_STORAGE_VOL_DIR = 2,      /* Directory-passthrough based volume */
>      VIR_STORAGE_VOL_NETWORK = 3,  /* Network volumes like RBD (RADOS Block Device) */
> +    VIR_STORAGE_VOL_NETWORK_DIR = 4, /* Network accessible directory that can
> +                                      * contain other network volumes */
> 
>  #ifdef VIR_ENUM_SENTINELS
>      VIR_STORAGE_VOL_LAST
> diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c
> index add2ae1..493a874 100644
> --- a/src/conf/storage_conf.c
> +++ b/src/conf/storage_conf.c
> @@ -53,7 +53,7 @@
> 
>  VIR_ENUM_IMPL(virStorageVol,
>                VIR_STORAGE_VOL_LAST,
> -              "file", "block", "dir", "network")
> +              "file", "block", "dir", "network", "network-dir")

I've got to say I really don't like this naming but not
got a better suggestion yet.

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the libvir-list mailing list