]> xenbits.xensource.com Git - libvirt.git/commitdiff
storage: remove support for /usr/bin/kvm-img
authorCole Robinson <crobinso@redhat.com>
Fri, 15 Apr 2016 21:00:40 +0000 (17:00 -0400)
committerCole Robinson <crobinso@redhat.com>
Wed, 20 Apr 2016 12:55:36 +0000 (08:55 -0400)
This an ubuntu/debian packaging convention. At one point it may have
been an actually different binary, but at least as of ubuntu precise
(the oldest supported ubuntu distro, released april 2012) kvm-img is
just a symlink to qemu-img for back compat.

I think it's safe to drop support for it

src/qemu/qemu_domain.c
src/qemu/qemu_driver.c
src/storage/storage_backend.c
src/storage/storage_backend_fs.c
src/util/virfile.c
tests/virstoragetest.c

index e031e0fc42c8690a17768b2bf95a70d607744c4e..51d4830a77bbc3224a955f2faed52ec7f0cb4a88 100644 (file)
@@ -3072,7 +3072,7 @@ qemuFindQemuImgBinary(virQEMUDriverPtr driver)
 {
     if (!driver->qemuImgBinary)
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       "%s", _("unable to find kvm-img or qemu-img"));
+                       "%s", _("unable to find qemu-img"));
 
     return driver->qemuImgBinary;
 }
index ae118963b8a958f039eceaed260afe2e287b7e76..055f0714ddf32cc3b0350ac0ee13fae7d9ec59cd 100644 (file)
@@ -718,9 +718,7 @@ qemuStateInitialize(bool privileged,
         goto error;
     }
 
-    qemu_driver->qemuImgBinary = virFindFileInPath("kvm-img");
-    if (!qemu_driver->qemuImgBinary)
-        qemu_driver->qemuImgBinary = virFindFileInPath("qemu-img");
+    qemu_driver->qemuImgBinary = virFindFileInPath("qemu-img");
 
     if (!(qemu_driver->lockManager =
           virLockManagerPluginNew(cfg->lockManagerName ?
index 7cc23d5578f57b753bb189466998ed4a9f27cbc4..e4b9b399e4854c94fe7be1872923abe833423ada 100644 (file)
@@ -153,7 +153,6 @@ static virStorageFileBackendPtr fileBackends[] = {
 
 enum {
     TOOL_QEMU_IMG,
-    TOOL_KVM_IMG,
 };
 
 #define READ_BLOCK_SIZE_DEFAULT  (1024 * 1024)
@@ -1234,14 +1233,10 @@ virStorageBackendCreateQemuImg(virConnectPtr conn,
 
     virCheckFlags(VIR_STORAGE_VOL_CREATE_PREALLOC_METADATA, -1);
 
-    /* KVM is usually ahead of qemu on features, so try that first */
-    create_tool = virFindFileInPath("kvm-img");
-    if (!create_tool)
-        create_tool = virFindFileInPath("qemu-img");
-
+    create_tool = virFindFileInPath("qemu-img");
     if (!create_tool) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       "%s", _("unable to find kvm-img or qemu-img"));
+                       "%s", _("unable to find qemu-img"));
         return -1;
     }
 
@@ -1266,7 +1261,6 @@ virStorageBackendBuildVolFrom
 virStorageBackendFSImageToolTypeToFunc(int tool_type)
 {
     switch (tool_type) {
-    case TOOL_KVM_IMG:
     case TOOL_QEMU_IMG:
         return virStorageBackendCreateQemuImg;
     default:
@@ -1284,11 +1278,8 @@ virStorageBackendFindFSImageTool(char **tool)
     int tool_type = -1;
     char *tmp = NULL;
 
-    if ((tmp = virFindFileInPath("kvm-img")) != NULL) {
-        tool_type = TOOL_KVM_IMG;
-    } else if ((tmp = virFindFileInPath("qemu-img")) != NULL) {
+    if ((tmp = virFindFileInPath("qemu-img")) != NULL)
         tool_type = TOOL_QEMU_IMG;
-    }
 
     if (tool)
         *tool = tmp;
index f55f5e2733ffbb6cfd25ec69e508ba0820915142..47d0f5427da0e55d8e44edab24219329110482b7 100644 (file)
@@ -1343,14 +1343,10 @@ virStorageBackendFilesystemResizeQemuImg(const char *path,
     char *img_tool;
     virCommandPtr cmd = NULL;
 
-    /* KVM is usually ahead of qemu on features, so try that first */
-    img_tool = virFindFileInPath("kvm-img");
-    if (!img_tool)
-        img_tool = virFindFileInPath("qemu-img");
-
+    img_tool = virFindFileInPath("qemu-img");
     if (!img_tool) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       "%s", _("unable to find kvm-img or qemu-img"));
+                       "%s", _("unable to find qemu-img"));
         return -1;
     }
 
index f0412c6de53558dc9d1b47def666c50a7aeb2235..730c08d6957c009db33663f53b5429ea7bef3f8c 100644 (file)
@@ -1580,7 +1580,7 @@ virFileIsLink(const char *linkpath)
 
 /*
  * Finds a requested executable file in the PATH env. e.g.:
- * "kvm-img" will return "/usr/bin/kvm-img"
+ * "qemu-img" will return "/usr/bin/qemu-img"
  *
  * You must free the result
  */
index 38ce09e8c637ad1a4391f39e8d1c214f4085ad53..698f4720d832defb5010830a98a049687ec353b2 100644 (file)
@@ -137,9 +137,7 @@ testPrepImages(void)
     char *buf = NULL;
     bool compat = false;
 
-    qemuimg = virFindFileInPath("kvm-img");
-    if (!qemuimg)
-        qemuimg = virFindFileInPath("qemu-img");
+    qemuimg = virFindFileInPath("qemu-img");
     if (!qemuimg)
         goto skip;