From patchwork Fri Apr 15 21:21:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 65973 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp152732qge; Fri, 15 Apr 2016 14:25:20 -0700 (PDT) X-Received: by 10.55.72.148 with SMTP id v142mr28674925qka.102.1460755520043; Fri, 15 Apr 2016 14:25:20 -0700 (PDT) Return-Path: Received: from mx5-phx2.redhat.com (mx5-phx2.redhat.com. [209.132.183.37]) by mx.google.com with ESMTPS id s6si36995269qha.96.2016.04.15.14.25.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Apr 2016 14:25:20 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.37 as permitted sender) client-ip=209.132.183.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.37 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 mx5-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u3FLLYL3037650; Fri, 15 Apr 2016 17:21:34 -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 u3FLLVZO019259 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 u3FLLTsw007154; Fri, 15 Apr 2016 17:21:30 -0400 From: Cole Robinson To: libvirt-list@redhat.com Date: Fri, 15 Apr 2016 17:21:26 -0400 Message-Id: <71bccdbb2bf143aaac7c12da963c03890f256efa.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 1/3] storage: remove support for /usr/bin/qcow-create 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 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 | 68 ---------------------------------------- src/storage/storage_backend_fs.c | 2 +- 2 files changed, 1 insertion(+), 69 deletions(-) -- 2.7.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c index a8fff14..7cc23d5 100644 --- a/src/storage/storage_backend.c +++ b/src/storage/storage_backend.c @@ -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) diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend_fs.c index b114b76..f55f5e2 100644 --- a/src/storage/storage_backend_fs.c +++ b/src/storage/storage_backend_fs.c @@ -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