From nobody Sun Oct 5 21:12:25 2025 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=1583535107; cv=none; d=zohomail.com; s=zohoarc; b=Nw0uWdEx3G/y6/hN6TCUSIB+dMjD8aOmEspCsWbQ2X1GIlk9UiXMznxUTlWTJkWwgWUYyIJKi6D3JBKo6xLyJ7EBFpRD6ooZPoZLC1qVfQRJZhyjBdRoXgvwZwNvfv0zf9aqBk/NASwHhG5bKfNSRFpf3jHv6e1C7jd9gZMQ+1k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583535107; 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=e9Z8L4MuIIza3Zlc0b2s5Hrm2167lOu8T2EMCiCnn+I=; b=BKVlNTGi/P4MqxFOUcl7QB0ML5DLbUqDgu1dbmj1gxpjSeF4+ce84GkUsiTRDJf0Wny6GuSzJcXor2a4FoKMYDaF0H50E63lpJEna4IXlmvRp8V9WS3JeLIOLPxz7Cg/v87WxlDeZuvAGIPxlXm3NyZMjwnyURvgaGp2tMYRq/A= 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 1583535107227178.3117971886744; Fri, 6 Mar 2020 14:51:47 -0800 (PST) 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-292-iTt0vAMNPAu-TdMOjlhToQ-1; Fri, 06 Mar 2020 17:51:43 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 65DB0800D5B; Fri, 6 Mar 2020 22:51:38 +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 37CE21001B2B; Fri, 6 Mar 2020 22:51:38 +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 3FF3118089CD; Fri, 6 Mar 2020 22:51:37 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 026MpY4R010880 for ; Fri, 6 Mar 2020 17:51:34 -0500 Received: by smtp.corp.redhat.com (Postfix) id 4C54260C87; Fri, 6 Mar 2020 22:51:34 +0000 (UTC) Received: from blue.redhat.com (ovpn-117-177.phx2.redhat.com [10.3.117.177]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0AB9860BE0; Fri, 6 Mar 2020 22:51:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583535105; 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=e9Z8L4MuIIza3Zlc0b2s5Hrm2167lOu8T2EMCiCnn+I=; b=Zjjom8D4XOnaHa60m1XZt7k8//dmcxNDVaNNJwi3tK0BjpxvXa7mYAZn5AjTvQBz83Y31X eUGIWVsxUjkM7tGMT6wnad8lQYw2Wgk4x2wFc0V/F09njzQ45QF6IQWm6IxvDEPY+Q1Qk6 MuQej+/WBtXvBuQbKUgmOLknlpVUYvM= X-MC-Unique: iTt0vAMNPAu-TdMOjlhToQ-1 From: Eric Blake To: qemu-devel@nongnu.org Subject: [PATCH v3 1/4] block: Add trivial backing_fmt support to qcow, sheepdog, vmdk Date: Fri, 6 Mar 2020 16:51:18 -0600 Message-Id: <20200306225121.3199279-2-eblake@redhat.com> In-Reply-To: <20200306225121.3199279-1-eblake@redhat.com> References: <20200306225121.3199279-1-eblake@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: Kevin Wolf , Fam Zheng , pkrempa@redhat.com, "open list:Sheepdog" , qemu-block@nongnu.org, libvir-list@redhat.com, Michael Tokarev , Laurent Vivier , mreitz@redhat.com, "open list:Trivial patches" , Liu Yuan 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.84 on 10.5.11.22 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" For qcow2 and qed, we want to encourage the use of -F always, as these formats can suffer from data corruption or security holes if backing format is probed. But for other formats, the backing format cannot be recorded. Making the user decide on a per-format basis whether to supply a backing format string is awkward, better is to just blindly accept a backing format argument even if it is ignored by the contraints of the format at hand. Signed-off-by: Eric Blake --- block/qcow.c | 6 ++++++ block/sheepdog.c | 6 ++++++ block/vmdk.c | 5 +++++ 3 files changed, 17 insertions(+) diff --git a/block/qcow.c b/block/qcow.c index fce89898681f..d05c3d526170 100644 --- a/block/qcow.c +++ b/block/qcow.c @@ -947,6 +947,7 @@ static int coroutine_fn qcow_co_create_opts(const char = *filename, static const QDictRenames opt_renames[] =3D { { BLOCK_OPT_BACKING_FILE, "backing-file" }, + { BLOCK_OPT_BACKING_FMT, "backing-fmt" }, { BLOCK_OPT_ENCRYPT, BLOCK_OPT_ENCRYPT_FORMAT }, { NULL, NULL }, }; @@ -1151,6 +1152,11 @@ static QemuOptsList qcow_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 "Ignored (use raw backing files with caution)", + }, { .name =3D BLOCK_OPT_ENCRYPT, .type =3D QEMU_OPT_BOOL, diff --git a/block/sheepdog.c b/block/sheepdog.c index cfa84338a2d6..248dcf4dfa01 100644 --- a/block/sheepdog.c +++ b/block/sheepdog.c @@ -2187,6 +2187,7 @@ static int coroutine_fn sd_co_create_opts(const char = *filename, QemuOpts *opts, /* Change legacy command line options into QMP ones */ static const QDictRenames opt_renames[] =3D { { BLOCK_OPT_BACKING_FILE, "backing-file" }, + { BLOCK_OPT_BACKING_FMT, "backing-fmt" }, { BLOCK_OPT_OBJECT_SIZE, "object-size" }, { NULL, NULL }, }; @@ -3189,6 +3190,11 @@ static QemuOptsList sd_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 "Ignored (use raw backing files with caution)", + }, { .name =3D BLOCK_OPT_PREALLOC, .type =3D QEMU_OPT_STRING, diff --git a/block/vmdk.c b/block/vmdk.c index 20e909d99794..53f3d864f3fe 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -3005,6 +3005,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 "Ignored (base image must be vmdk format)", + }, { .name =3D BLOCK_OPT_COMPAT6, .type =3D QEMU_OPT_BOOL, --=20 2.25.1