From patchwork Fri Apr 15 21:21:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 65975 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp153109qge; Fri, 15 Apr 2016 14:26:26 -0700 (PDT) X-Received: by 10.28.92.69 with SMTP id q66mr6793572wmb.102.1460755586865; Fri, 15 Apr 2016 14:26:26 -0700 (PDT) Return-Path: Received: from mx6-phx2.redhat.com (mx6-phx2.redhat.com. [209.132.183.39]) by mx.google.com with ESMTPS id jx4si52464053wjb.219.2016.04.15.14.26.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Apr 2016 14:26:26 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.39 as permitted sender) client-ip=209.132.183.39; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.39 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx6-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u3FLMIis045728; Fri, 15 Apr 2016 17:22:19 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u3FLLVcZ019264 for ; Fri, 15 Apr 2016 17:21:31 -0400 Received: from colepc.redhat.com (ovpn-113-40.phx2.redhat.com [10.3.113.40]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u3FLLTsx007154; Fri, 15 Apr 2016 17:21:31 -0400 From: Cole Robinson To: libvirt-list@redhat.com Date: Fri, 15 Apr 2016 17:21:27 -0400 Message-Id: <9770900bc1d19b924f5d2307268ef46b97767e0e.1460755236.git.crobinso@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/3] storage: remove support for /usr/bin/kvm-img X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com 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 | 2 +- src/qemu/qemu_driver.c | 4 +--- src/storage/storage_backend.c | 15 +++------------ src/storage/storage_backend_fs.c | 8 ++------ src/util/virfile.c | 2 +- tests/virstoragetest.c | 4 +--- 6 files changed, 9 insertions(+), 26 deletions(-) -- 2.7.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index ed1e0e5..73187ce 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -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; } diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 95612cf..bf05ace 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -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 ? diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c index 7cc23d5..e4b9b39 100644 --- a/src/storage/storage_backend.c +++ b/src/storage/storage_backend.c @@ -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; diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend_fs.c index f55f5e2..47d0f54 100644 --- a/src/storage/storage_backend_fs.c +++ b/src/storage/storage_backend_fs.c @@ -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; } diff --git a/src/util/virfile.c b/src/util/virfile.c index f0412c6..730c08d 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -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 */ diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index 38ce09e..698f472 100644 --- a/tests/virstoragetest.c +++ b/tests/virstoragetest.c @@ -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;