From: Olga Krishtal Date: Mon, 11 Apr 2016 16:16:19 +0000 (+0300) Subject: storage: add ploop volume type X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=ee36975597bf9153eb82d2d83bd47d1b6b7499ab;p=libvirt.git storage: add ploop volume type Ploop image consists of directory with two files: ploop image itself, called root.hds and DiskDescriptor.xml that contains information about ploop device: https://openvz.org/Ploop/format. Such volume are difficult to manipulate in terms of existing volume types because they are neither a single files nor a directory. This patch introduces new volume type - ploop. This volume type is used by ploop volume's exclusively. Signed-off-by: Olga Krishtal Signed-off-by: Ján Tomko --- diff --git a/docs/formatstorage.html.in b/docs/formatstorage.html.in index 4965a4c7e1..0356182127 100644 --- a/docs/formatstorage.html.in +++ b/docs/formatstorage.html.in @@ -494,7 +494,7 @@ A storage volume will generally be either a file or a device node; since 1.2.0, an optional output-only attribute type lists the actual type - (file, block, dir, network, or netdir), which is also available + (file, block, dir, network, netdir or ploop), which is also available from virStorageVolGetInfo(). The storage volume XML format is available since 0.4.1

diff --git a/include/libvirt/libvirt-storage.h b/include/libvirt/libvirt-storage.h index 1a868ccddd..db6f2b498f 100644 --- a/include/libvirt/libvirt-storage.h +++ b/include/libvirt/libvirt-storage.h @@ -122,6 +122,7 @@ typedef enum { VIR_STORAGE_VOL_NETWORK = 3, /* Network volumes like RBD (RADOS Block Device) */ VIR_STORAGE_VOL_NETDIR = 4, /* Network accessible directory that can * contain other network volumes */ + VIR_STORAGE_VOL_PLOOP = 5, /* Ploop based volumes */ # ifdef VIR_ENUM_SENTINELS VIR_STORAGE_VOL_LAST diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index 497c65f460..daf8f99285 100644 --- a/src/conf/storage_conf.c +++ b/src/conf/storage_conf.c @@ -52,7 +52,8 @@ VIR_LOG_INIT("conf.storage_conf"); VIR_ENUM_IMPL(virStorageVol, VIR_STORAGE_VOL_LAST, - "file", "block", "dir", "network", "netdir") + "file", "block", "dir", "network", + "netdir", "ploop") VIR_ENUM_IMPL(virStoragePool, VIR_STORAGE_POOL_LAST, diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend_fs.c index 692c9ff179..d54dbfae45 100644 --- a/src/storage/storage_backend_fs.c +++ b/src/storage/storage_backend_fs.c @@ -1085,6 +1085,8 @@ virStorageBackendFileSystemVolCreate(virConnectPtr conn ATTRIBUTE_UNUSED, if (vol->target.format == VIR_STORAGE_FILE_DIR) vol->type = VIR_STORAGE_VOL_DIR; + else if (vol->target.format == VIR_STORAGE_FILE_PLOOP) + vol->type = VIR_STORAGE_VOL_PLOOP; else vol->type = VIR_STORAGE_VOL_FILE; @@ -1259,6 +1261,7 @@ virStorageBackendFileSystemVolDelete(virConnectPtr conn ATTRIBUTE_UNUSED, } } break; + case VIR_STORAGE_VOL_PLOOP: case VIR_STORAGE_VOL_BLOCK: case VIR_STORAGE_VOL_NETWORK: case VIR_STORAGE_VOL_NETDIR: diff --git a/tools/virsh-volume.c b/tools/virsh-volume.c index cfb8cfcedd..36dd0ed8e5 100644 --- a/tools/virsh-volume.c +++ b/tools/virsh-volume.c @@ -965,7 +965,8 @@ VIR_ENUM_IMPL(virshStorageVol, N_("block"), N_("dir"), N_("network"), - N_("netdir")) + N_("netdir"), + N_("ploop")) static const char * virshVolumeTypeToString(int type)