]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
storage: fix logical volume cloning
authorJán Tomko <jtomko@redhat.com>
Sun, 25 Nov 2012 01:59:33 +0000 (02:59 +0100)
committerCole Robinson <crobinso@redhat.com>
Sun, 9 Dec 2012 21:35:30 +0000 (16:35 -0500)
Commit 258e06c removed setting of the volume type to
VIR_STORAGE_VOL_BLOCK, which leads to failures in
storageVolumeCreateXMLFrom.

The type (and target.format) of the volume was set to zero. In
virStorageBackendGetBuildVolFromFunction, this gets interpreted as
VIR_STORAGE_FILE_NONE and the qemu-img tool is called with unknown
"none" format.

Bug: https://bugzilla.redhat.com/show_bug.cgi?id=879780
(cherry picked from commit 70f0bbe8e046dae1b811378f735872d3e61f4609)

src/storage/storage_backend_logical.c

index de43c3a4290270d3a86bf84c2e2fac8bbd694f04..fd5cbd12d8bfa0d1592769de567749d485d852e6 100644 (file)
@@ -708,6 +708,8 @@ virStorageBackendLogicalCreateVol(virConnectPtr conn,
         return -1;
     }
 
+    vol->type = VIR_STORAGE_VOL_BLOCK;
+
     if (vol->target.path != NULL) {
         /* A target path passed to CreateVol has no meaning */
         VIR_FREE(vol->target.path);