From nobody Mon Feb 9 06:34:36 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1585936797; cv=none; d=zohomail.com; s=zohoarc; b=elkfvFJZ+O5IGwbT55NTxs/cIr4dSzKchvU8V2ZTgRlQq/enp5ksqxFKeO/pPaAMR7fCYv6WwElJocXdorIz+/WAe9MtLMn/59ejEjDoVjndHae23QGWuEmyaT9sZAOjGdd3F6TeJR2bcJfMuNCycE+Q2sYAnVwgPUvevHWsi24= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585936797; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Yo+ryPOZyQt+ZcUKPVTQE/2JrpsvvTK1ah97oCYRcz8=; b=TXMHnUSaAydR8UUYEnIY7TqZ6A/rjUmtxq81ee2WRGqGhGX/3SUAkqNwFFUdhhWVKOhYIraMqwlbFqvKGCy5FeMzDIA5ZNdeLjutiiiVfK03L6HvDV7kyPdA7iFM+7dILtO36OwkhXHKZRFAw1IkTNwDla/VrBaGPXUyH8uMr08= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1585936797276951.1765017860026; Fri, 3 Apr 2020 10:59:57 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-236-PKG4AbSTPoimLxRcPs3z2A-1; Fri, 03 Apr 2020 13:59:49 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 500768018A7; Fri, 3 Apr 2020 17:59:43 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F05965DA75; Fri, 3 Apr 2020 17:59:42 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id AFA6818089CD; Fri, 3 Apr 2020 17:59:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 033HxdRk004552 for ; Fri, 3 Apr 2020 13:59:39 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3BB595C296; Fri, 3 Apr 2020 17:59:39 +0000 (UTC) Received: from blue.redhat.com (ovpn-113-246.phx2.redhat.com [10.3.113.246]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8E6155C1B0; Fri, 3 Apr 2020 17:59:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585936793; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Yo+ryPOZyQt+ZcUKPVTQE/2JrpsvvTK1ah97oCYRcz8=; b=gKy5cgA8O+PGebW7cvxPpQhSYXfZ5TTBRAX9TlDE5K5TaTEtnm1hm9D8b4Hv399Co4OPaQ CMXsob8D+mMmQsR305g+wwsIs/vGtOfQcVBUiYdvZ4nHX77si8qA/E1PFFs9gPj1AjUkE4 bZCt2xYRYQbLm7LqyL6BHMExC3Z4xIU= X-MC-Unique: PKG4AbSTPoimLxRcPs3z2A-1 From: Eric Blake To: qemu-devel@nongnu.org Subject: [PATCH v5 2/7] vmdk: Add trivial backing_fmt support Date: Fri, 3 Apr 2020 12:58:54 -0500 Message-Id: <20200403175859.863248-3-eblake@redhat.com> In-Reply-To: <20200403175859.863248-1-eblake@redhat.com> References: <20200403175859.863248-1-eblake@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: kwolf@redhat.com, Fam Zheng , pkrempa@redhat.com, qemu-block@nongnu.org, libvir-list@redhat.com, Michael Tokarev , Laurent Vivier , mreitz@redhat.com, "open list:Trivial patches" 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" vmdk already requires that if backing_file is present, that it be another vmdk image (see vmdk_co_do_create). Meanwhile, we want to move towards always being explicit about the backing format for other drivers where it matters. So for convenience, make qemu-img create -F vmdk work, while rejecting all other explicit formats (note that this is only for QemuOpts usage; there is no change to the QAPI to allow a format through -blockdev). Signed-off-by: Eric Blake --- block/vmdk.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/block/vmdk.c b/block/vmdk.c index 218d9c980059..7ecaf0ee9be3 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -2613,6 +2613,14 @@ static int coroutine_fn vmdk_co_create_opts(BlockDri= ver *drv, bool zeroed_grain; bool compat6; VMDKCreateOptsData data; + char *backing_fmt =3D NULL; + + backing_fmt =3D qemu_opt_get_del(opts, BLOCK_OPT_BACKING_FMT); + if (backing_fmt && strcmp(backing_fmt, "vmdk") !=3D 0) { + error_setg(errp, "backing_file must be a vmdk image"); + ret =3D -EINVAL; + goto exit; + } if (filename_decompose(filename, path, prefix, postfix, PATH_MAX, errp= )) { ret =3D -EINVAL; @@ -2671,6 +2679,7 @@ static int coroutine_fn vmdk_co_create_opts(BlockDriv= er *drv, vmdk_co_create_opts_cb, &data, errp); exit: + g_free(backing_fmt); g_free(adapter_type); g_free(backing_file); g_free(hw_version); @@ -3007,6 +3016,11 @@ static QemuOptsList vmdk_create_opts =3D { .type =3D QEMU_OPT_STRING, .help =3D "File name of a base image" }, + { + .name =3D BLOCK_OPT_BACKING_FMT, + .type =3D QEMU_OPT_STRING, + .help =3D "Must be 'vmdk' if present", + }, { .name =3D BLOCK_OPT_COMPAT6, .type =3D QEMU_OPT_BOOL, --=20 2.26.0.rc2