]> xenbits.xensource.com Git - libvirt.git/commitdiff
storage: add ploop volume type
authorOlga Krishtal <okrishtal@virtuozzo.com>
Mon, 11 Apr 2016 16:16:19 +0000 (19:16 +0300)
committerJán Tomko <jtomko@redhat.com>
Fri, 15 Apr 2016 15:27:32 +0000 (17:27 +0200)
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 <okrishtal@virtuozzo.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
docs/formatstorage.html.in
include/libvirt/libvirt-storage.h
src/conf/storage_conf.c
src/storage/storage_backend_fs.c
tools/virsh-volume.c

index 4965a4c7e1768145d0dd07cd92acec58e7098d13..0356182127614f6a51c0383f66af100668e3926c 100644 (file)
       A storage volume will generally be either a file or a device
       node; <span class="since">since 1.2.0</span>, an optional
       output-only attribute <code>type</code> 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 <code>virStorageVolGetInfo()</code>.  The storage volume
       XML format is available <span class="since">since 0.4.1</span>
     </p>
index 1a868ccddd632ecc195c675b94270dc66583fb9c..db6f2b498f89a8bd3a78ce3e87ebe06f4e37127f 100644 (file)
@@ -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
index 497c65f46015d9cdc801b3243c53f6197f09bb00..daf8f99285b9764cb41267d7192e332b8f083f97 100644 (file)
@@ -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,
index 692c9ff17989541efced0596cd1bfa5403bcf288..d54dbfae45d7721c78624afd45213d4997050813 100644 (file)
@@ -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:
index cfb8cfceddcbaa1ab3a0c9a876103053bd6c27db..36dd0ed8e53ba63e49f22b7de35222190595719f 100644 (file)
@@ -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)