[libvirt] [PATCH v2 1/5] add ploop fs driver type

Dmitry Guryanov dguryanov at parallels.com
Tue Jan 13 11:27:36 UTC 2015


Ploop is a pseudo device which makeit possible to access
to an image in a file as a block device. Like loop devices,
but with additional features, like snapshots, write tracker
and without double-caching.

It used in PCS for containers and in OpenVZ. You can manage
ploop devices and images with ploop utility
(http://git.openvz.org/?p=ploop).

Signed-off-by: Dmitry Guryanov <dguryanov at parallels.com>
---

Changes in v2:
    * extend domaincommon.rng and storagecommon.rng
    * add documentation note about ploop fs driver format
    * add fs with new type to domain-parallels-ct-simple.xml
      to check it in unit test

 docs/formatdomain.html.in                             | 3 ++-
 docs/schemas/domaincommon.rng                         | 1 +
 docs/schemas/storagecommon.rng                        | 1 +
 src/conf/domain_conf.c                                | 3 ++-
 src/conf/domain_conf.h                                | 1 +
 src/qemu/qemu_command.c                               | 1 +
 tests/domainschemadata/domain-parallels-ct-simple.xml | 5 +++++
 7 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 8fcbd29..39d661b 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -2607,7 +2607,8 @@
             attribute provides the format type. For example, LXC
             supports a type of "loop", with a format of "raw" or
             "nbd" with any format. QEMU supports a type of "path"
-            or "handle", but no formats.
+            or "handle", but no formats. Parallels driver supports
+            a type of "ploop" with a format of "ploop".
           </li>
         </ul>
       </dd>
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index cd35485..85cc3be 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -2003,6 +2003,7 @@
             <value>handle</value>
             <value>loop</value>
             <value>nbd</value>
+            <value>ploop</value>
           </choice>
         </attribute>
       </optional>
diff --git a/docs/schemas/storagecommon.rng b/docs/schemas/storagecommon.rng
index 629505f..5f71b10 100644
--- a/docs/schemas/storagecommon.rng
+++ b/docs/schemas/storagecommon.rng
@@ -75,6 +75,7 @@
       <value>vdi</value>
       <value>fat</value>
       <value>vhd</value>
+      <value>ploop</value>
       <ref name='storageFormatBacking'/>
     </choice>
   </define>
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index aafc05e..b502b50 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -374,7 +374,8 @@ VIR_ENUM_IMPL(virDomainFSDriver, VIR_DOMAIN_FS_DRIVER_TYPE_LAST,
               "path",
               "handle",
               "loop",
-              "nbd")
+              "nbd",
+              "ploop")
 
 VIR_ENUM_IMPL(virDomainFSAccessMode, VIR_DOMAIN_FS_ACCESSMODE_LAST,
               "passthrough",
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 57297cd..44f00a0 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -791,6 +791,7 @@ typedef enum {
     VIR_DOMAIN_FS_DRIVER_TYPE_HANDLE,
     VIR_DOMAIN_FS_DRIVER_TYPE_LOOP,
     VIR_DOMAIN_FS_DRIVER_TYPE_NBD,
+    VIR_DOMAIN_FS_DRIVER_TYPE_PLOOP,
 
     VIR_DOMAIN_FS_DRIVER_TYPE_LAST
 } virDomainFSDriverType;
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index d5679de..077962f 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -151,6 +151,7 @@ VIR_ENUM_IMPL(qemuDomainFSDriver, VIR_DOMAIN_FS_DRIVER_TYPE_LAST,
               "local",
               "handle",
               NULL,
+              NULL,
               NULL);
 
 VIR_ENUM_DECL(qemuNumaPolicy)
diff --git a/tests/domainschemadata/domain-parallels-ct-simple.xml b/tests/domainschemadata/domain-parallels-ct-simple.xml
index a2b87ce..b79e963 100644
--- a/tests/domainschemadata/domain-parallels-ct-simple.xml
+++ b/tests/domainschemadata/domain-parallels-ct-simple.xml
@@ -18,6 +18,11 @@
         <source name='centos-6-x86_64'/>
         <target dir='/'/>
     </filesystem>
+    <filesystem type='file' accessmode='passthrough'>
+      <driver type='ploop' format='ploop'/>
+      <source file='/path/to/ploop/dir'/>
+      <target dir='/mnt'/>
+    </filesystem>
     <video>
       <model type='vga' vram='16777216' heads='1'>
         <acceleration accel3d='no' accel2d='no'/>
-- 
2.1.0




More information about the libvir-list mailing list