]> xenbits.xensource.com Git - libvirt.git/commitdiff
storage: remove support for /usr/bin/qcow-create
authorCole Robinson <crobinso@redhat.com>
Fri, 15 Apr 2016 20:48:59 +0000 (16:48 -0400)
committerCole Robinson <crobinso@redhat.com>
Wed, 20 Apr 2016 12:55:36 +0000 (08:55 -0400)
qcow-create was a crippled qemu-img impl that shipped with xen. I
think supporting this was only relevant for really old distros
that didn't have a proper qemu package, like early RHEL5. I think
it's fair to drop support

src/storage/storage_backend.c
src/storage/storage_backend_fs.c

index a8fff149ce0bf5c68a7908b4388ba7906845a247..7cc23d5578f57b753bb189466998ed4a9f27cbc4 100644 (file)
@@ -154,7 +154,6 @@ static virStorageFileBackendPtr fileBackends[] = {
 enum {
     TOOL_QEMU_IMG,
     TOOL_KVM_IMG,
-    TOOL_QCOW_CREATE,
 };
 
 #define READ_BLOCK_SIZE_DEFAULT  (1024 * 1024)
@@ -1263,69 +1262,6 @@ virStorageBackendCreateQemuImg(virConnectPtr conn,
     return ret;
 }
 
-/*
- * Xen removed the fully-functional qemu-img, and replaced it
- * with a partially functional qcow-create. Go figure ??!?
- */
-static int
-virStorageBackendCreateQcowCreate(virConnectPtr conn ATTRIBUTE_UNUSED,
-                                  virStoragePoolObjPtr pool,
-                                  virStorageVolDefPtr vol,
-                                  virStorageVolDefPtr inputvol,
-                                  unsigned int flags)
-{
-    int ret;
-    char *size;
-    virCommandPtr cmd;
-
-    virCheckFlags(VIR_STORAGE_VOL_CREATE_PREALLOC_METADATA, -1);
-
-    if (flags & VIR_STORAGE_VOL_CREATE_PREALLOC_METADATA) {
-        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                       _("metadata preallocation is not supported with "
-                         "qcow-create"));
-        return -1;
-    }
-
-    if (inputvol) {
-        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                       _("cannot copy from volume with qcow-create"));
-        return -1;
-    }
-
-    if (vol->target.format != VIR_STORAGE_FILE_QCOW2) {
-        virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("unsupported storage vol type %d"),
-                       vol->target.format);
-        return -1;
-    }
-    if (vol->target.backingStore != NULL) {
-        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                       _("copy-on-write image not supported with "
-                         "qcow-create"));
-        return -1;
-    }
-    if (vol->target.encryption != NULL) {
-        virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                       "%s", _("encrypted volumes not supported with "
-                               "qcow-create"));
-        return -1;
-    }
-
-    /* Size in MB - yes different units to qemu-img :-( */
-    if (virAsprintf(&size, "%llu",
-                    VIR_DIV_UP(vol->target.capacity, (1024 * 1024))) < 0)
-        return -1;
-
-    cmd = virCommandNewArgList("qcow-create", size, vol->target.path, NULL);
-
-    ret = virStorageBackendCreateExecCommand(pool, vol, cmd);
-    virCommandFree(cmd);
-    VIR_FREE(size);
-
-    return ret;
-}
-
 virStorageBackendBuildVolFrom
 virStorageBackendFSImageToolTypeToFunc(int tool_type)
 {
@@ -1333,8 +1269,6 @@ virStorageBackendFSImageToolTypeToFunc(int tool_type)
     case TOOL_KVM_IMG:
     case TOOL_QEMU_IMG:
         return virStorageBackendCreateQemuImg;
-    case TOOL_QCOW_CREATE:
-        return virStorageBackendCreateQcowCreate;
     default:
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Unknown file create tool type '%d'."),
@@ -1354,8 +1288,6 @@ virStorageBackendFindFSImageTool(char **tool)
         tool_type = TOOL_KVM_IMG;
     } else if ((tmp = virFindFileInPath("qemu-img")) != NULL) {
         tool_type = TOOL_QEMU_IMG;
-    } else if ((tmp = virFindFileInPath("qcow-create")) != NULL) {
-        tool_type = TOOL_QCOW_CREATE;
     }
 
     if (tool)
index b114b7675ce78b2f4fd7e983d8610c2834569b81..f55f5e2733ffbb6cfd25ec69e508ba0820915142 100644 (file)
@@ -1209,7 +1209,7 @@ _virStorageBackendFileSystemVolBuild(virConnectPtr conn,
 
 /**
  * Allocate a new file as a volume. This is either done directly
- * for raw/sparse files, or by calling qemu-img/qcow-create for
+ * for raw/sparse files, or by calling qemu-img for
  * special kinds of files
  */
 static int