All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: pkrempa@redhat.com, qemu-block@nongnu.org, kchamart@redhat.com,
	libvir-list@redhat.com, qemu-devel@nongnu.org, mreitz@redhat.com
Subject: Re: [PATCH v5 4/7] qcow2: Deprecate use of qemu-img amend to change backing file
Date: Tue, 5 May 2020 09:50:50 +0200	[thread overview]
Message-ID: <20200505075050.GB5759@linux.fritz.box> (raw)
In-Reply-To: <20200403175859.863248-5-eblake@redhat.com>

Am 03.04.2020 um 19:58 hat Eric Blake geschrieben:
> The use of 'qemu-img amend' to change qcow2 backing files is not
> tested very well.  In particular, our implementation has a bug where
> if a new backing file is provided without a format, then the prior
> format is blindly reused, even if this results in data corruption, but
> this is not caught by iotests.
> 
> There are also situations where amending other options needs access to
> the original backing file (for example, on a downgrade to a v2 image,
> knowing whether a v3 zero cluster must be allocated or may be left
> unallocated depends on knowing whether the backing file already reads
> as zero), but the command line does not have a nice way to tell us
> both the backing file to use for opening the image as well as the
> backing file to install after the operation is complete.
> 
> Even if we do allow changing the backing file, it is redundant with
> the existing ability to change backing files via 'qemu-img rebase -u'.
> It is time to deprecate this support (leaving the existing behavior
> intact, even if it is buggy), and at a point in the future, require
> the use of only 'qemu-img rebase' for adjusting backing chain
> relations, saving 'qemu-img amend' for changes unrelated to the
> backing chain.
> 
> Signed-off-by: Eric Blake <eblake@redhat.com>

I think the original idea was that in BlockDriver, special interfaces
like the ones used by qemu-img rebase could eventually go away if we
have a single consistent interface to change image options, which is
amend. So ideally, bdrv_change_backing_file() should become a wrapper
around amend.

I'm not even sure if the behaviour you mention should be considered a
bug because amend is a low-level interface. But even if that's the case,
it would be a matter of simply adding a check.

Kevin



  reply	other threads:[~2020-05-05  7:51 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-03 17:58 [PATCH v5 for-5.0? 0/7] Tighten qemu-img rules on missing backing format Eric Blake
2020-04-03 17:58 ` [PATCH v5 1/7] sheepdog: Add trivial backing_fmt support Eric Blake
2020-04-03 17:58 ` [PATCH v5 2/7] vmdk: " Eric Blake
2020-04-03 17:58 ` [PATCH v5 3/7] qcow: Tolerate backing_fmt=, but warn on backing_fmt=raw Eric Blake
2020-05-05  7:35   ` Kevin Wolf
2020-05-05 15:30     ` Eric Blake
2020-06-22 21:58       ` Eric Blake
2020-06-23 10:40         ` Kevin Wolf
2020-04-03 17:58 ` [PATCH v5 4/7] qcow2: Deprecate use of qemu-img amend to change backing file Eric Blake
2020-05-05  7:50   ` Kevin Wolf [this message]
2020-04-03 17:58 ` [PATCH v5 5/7] iotests: Specify explicit backing format where sensible Eric Blake
2020-04-03 17:58 ` [PATCH v5 6/7] block: Add support to warn on backing file change without format Eric Blake
2020-04-03 17:58 ` [PATCH v5 7/7] qemu-img: Deprecate use of -b without -F Eric Blake
2020-05-05  8:11   ` Kevin Wolf
2020-05-05  8:43     ` Peter Krempa
2020-05-04 20:02 ` [PATCH v5 for-5.0? 0/7] Tighten qemu-img rules on missing backing format 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=20200505075050.GB5759@linux.fritz.box \
    --to=kwolf@redhat.com \
    --cc=eblake@redhat.com \
    --cc=kchamart@redhat.com \
    --cc=libvir-list@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=pkrempa@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.