From: Max Reitz <mreitz@redhat.com>
To: Ping Li <li.ping288@zte.com.cn>, kwolf@redhat.com
Cc: qemu-block@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] Block layer core: Fix qemu-img 'amend' subcommand failure of adjusting backing file in different path
Date: Sat, 22 Apr 2017 18:52:42 +0200 [thread overview]
Message-ID: <3258e8fb-d144-c36f-1847-0695d16ceb35@redhat.com> (raw)
In-Reply-To: <1492814072-4276-1-git-send-email-li.ping288@zte.com.cn>
[-- Attachment #1: Type: text/plain, Size: 1698 bytes --]
On 22.04.2017 00:34, Ping Li wrote:
> Currently, qemu-img 'amend' subcommand would fail to adjust image's backing file
> which was moved into different path.
> For example, parent.qcow2, the backing file of leaf.qcow2, first is at /home/a/,
> then moved into /home/b/. Originally this command,
> "qemu-img amend -f qcow2 -o backing_fmt=qcow2,backing_file=/home/b/parent.qcow2 leaf.qcow2",
> would fail because qemu-img failed to open the old backing file of leaf.qcow2.
> Give the 'amend' subcommand a '-u' option to not open the old backing file
> while openning leaf.qcow2.
>
> Signed-off-by: Li Ping<li.ping288@zte.com.cn>
> ---
> qemu-img.c | 16 ++++++++++------
> 1 file changed, 10 insertions(+), 6 deletions(-)
So why can't you just use rebase -u?
I'm not completely opposed to adding this functionality to amend, but
I'd actually rather remove the ability to change the backing file from
amend than to add functionality that may turn out to be rather
complicated to implement...
As Eric has proposed, I also think we could turn on BDRV_O_NO_BACKING
automatically if the option list consists of nothing but backing_file
and backing_fmt. But then we'd have to think about the case where the
user gives both backing_file and some other option at the same time; it
may be unexpected that we do open the backing file in that case. The
best might actually to error out so the user is forced to do both
changes separately -- but at that point the logic gets so complicated
that I think we should at most add a note to qemu-img's man page that
qemu-img amend will open the backing file and that users should use
rebase -u if that is not desired...
Max
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 512 bytes --]
prev parent reply other threads:[~2017-04-22 16:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-21 22:34 [Qemu-devel] [PATCH] Block layer core: Fix qemu-img 'amend' subcommand failure of adjusting backing file in different path Ping Li
2017-04-21 13:53 ` Eric Blake
2017-04-22 16:52 ` Max Reitz [this message]
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=3258e8fb-d144-c36f-1847-0695d16ceb35@redhat.com \
--to=mreitz@redhat.com \
--cc=kwolf@redhat.com \
--cc=li.ping288@zte.com.cn \
--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 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).