qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>, Fam Zheng <fam@euphon.net>,
	pkrempa@redhat.com,
	"open list:Sheepdog" <sheepdog@lists.wpkg.org>,
	qemu-block@nongnu.org, libvir-list@redhat.com,
	Michael Tokarev <mjt@tls.msk.ru>,
	Laurent Vivier <laurent@vivier.eu>,
	mreitz@redhat.com,
	"open list:Trivial patches" <qemu-trivial@nongnu.org>,
	Liu Yuan <namei.unix@gmail.com>
Subject: [PATCH v3 1/4] block: Add trivial backing_fmt support to qcow, sheepdog, vmdk
Date: Fri,  6 Mar 2020 16:51:18 -0600	[thread overview]
Message-ID: <20200306225121.3199279-2-eblake@redhat.com> (raw)
In-Reply-To: <20200306225121.3199279-1-eblake@redhat.com>

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 <eblake@redhat.com>
---
 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[] = {
         { 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 = {
             .type = QEMU_OPT_STRING,
             .help = "File name of a base image"
         },
+        {
+            .name = BLOCK_OPT_BACKING_FMT,
+            .type = QEMU_OPT_STRING,
+            .help = "Ignored (use raw backing files with caution)",
+        },
         {
             .name = BLOCK_OPT_ENCRYPT,
             .type = 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[] = {
         { 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 = {
             .type = QEMU_OPT_STRING,
             .help = "File name of a base image"
         },
+        {
+            .name = BLOCK_OPT_BACKING_FMT,
+            .type = QEMU_OPT_STRING,
+            .help = "Ignored (use raw backing files with caution)",
+        },
         {
             .name = BLOCK_OPT_PREALLOC,
             .type = 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 = {
             .type = QEMU_OPT_STRING,
             .help = "File name of a base image"
         },
+        {
+            .name = BLOCK_OPT_BACKING_FMT,
+            .type = QEMU_OPT_STRING,
+            .help = "Ignored (base image must be vmdk format)",
+        },
         {
             .name = BLOCK_OPT_COMPAT6,
             .type = QEMU_OPT_BOOL,
-- 
2.25.1



  reply	other threads:[~2020-03-06 22:54 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-06 22:51 [PATCH v3 0/4] Tighten qemu-img rules on missing backing format Eric Blake
2020-03-06 22:51 ` Eric Blake [this message]
2020-03-09 15:21   ` [PATCH v3 1/4] block: Add trivial backing_fmt support to qcow, sheepdog, vmdk Kevin Wolf
2020-03-09 15:32     ` Eric Blake
2020-03-09 15:44       ` Daniel P. Berrangé
2020-03-09 15:52         ` Eric Blake
2020-03-09 15:57         ` Kevin Wolf
2020-03-09 15:48       ` Kevin Wolf
2020-03-09 15:55         ` Eric Blake
2020-03-09 15:36     ` Daniel P. Berrangé
2020-03-09 15:50       ` Eric Blake
2020-03-06 22:51 ` [PATCH v3 2/4] iotests: Specify explicit backing format where sensible Eric Blake
2020-03-06 22:51 ` [PATCH v3 3/4] block: Add support to warn on backing file change without format Eric Blake
2020-03-06 22:51 ` [PATCH v3 4/4] qemu-img: Deprecate use of -b without -F Eric Blake
2020-03-09 15:31   ` Kashyap Chamarthy
2020-03-09 15:42     ` Eric Blake
2020-03-10  9:47       ` Kashyap Chamarthy
2020-03-10 12:15         ` Eric Blake
2020-03-10 14:53           ` Kashyap Chamarthy
2020-03-10 10:57       ` Kashyap Chamarthy
2020-03-10 12:17         ` Eric Blake
2020-03-10 12:19         ` Eric Blake
2020-03-10 14:50           ` Kashyap Chamarthy
2020-03-13 18:20     ` Eric Blake

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200306225121.3199279-2-eblake@redhat.com \
    --to=eblake@redhat.com \
    --cc=fam@euphon.net \
    --cc=kwolf@redhat.com \
    --cc=laurent@vivier.eu \
    --cc=libvir-list@redhat.com \
    --cc=mjt@tls.msk.ru \
    --cc=mreitz@redhat.com \
    --cc=namei.unix@gmail.com \
    --cc=pkrempa@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=sheepdog@lists.wpkg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).