From: Eric Blake <eblake@redhat.com>
To: Fam Zheng <famz@redhat.com>, qemu-devel@nongnu.org
Cc: kwolf@redhat.com, jcody@redhat.com, stefanha@redhat.com
Subject: Re: [Qemu-devel] [PATCH v2] block: support dropping active in bdrv_drop_intermediate
Date: Fri, 18 Oct 2013 08:37:39 -0600 [thread overview]
Message-ID: <526147B3.7090105@redhat.com> (raw)
In-Reply-To: <1381821901-1486-1-git-send-email-famz@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1640 bytes --]
On 10/15/2013 01:25 AM, Fam Zheng wrote:
> There is only one failure point: bdrv_change_backing_file in this
> function, so we can drop the qlist and try to change the backing file
> before deleting anything.
>
> This way bdrv_drop_intermediate is simplified while keeping the
> operation transactional. A bonus is dropping an active BDS is supported
> too by swapping the base and top. Although no caller uses this yet, the
> comment is updated to reflect the change.
>
> Signed-off-by: Fam Zheng <famz@redhat.com>
>
> ---
> v2: check for active, top and base being in a backing chain. (Jeff)
>
> Signed-off-by: Fam Zheng <famz@redhat.com>
> ---
> block.c | 103 ++++++++++++++++++++-------------------------------------
> block/commit.c | 1 +
> 2 files changed, 37 insertions(+), 67 deletions(-)
>
>
> if (!top->drv || !base->drv) {
> goto exit;
> }
So base->drv is non-NULL if we get here...
> + if (active != top) {
> + /* If there's an overlay, its backing_hd points to top's BDS now,
> + * the top image is dropped but this BDS structure is kept and swapped
> + * with base, this way we keep the pointers valid after dropping top */
> + overlay = bdrv_find_overlay(active, top);
> + if (!overlay) {
> + goto exit;
> + }
> + ret = bdrv_change_backing_file(overlay, base->filename,
> + base->drv ?
...yet you are checking it for NULL here.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 621 bytes --]
next prev parent reply other threads:[~2013-10-18 14:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-15 7:25 [Qemu-devel] [PATCH v2] block: support dropping active in bdrv_drop_intermediate Fam Zheng
2013-10-18 14:37 ` Eric Blake [this message]
2013-10-24 10:19 ` Jeff Cody
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=526147B3.7090105@redhat.com \
--to=eblake@redhat.com \
--cc=famz@redhat.com \
--cc=jcody@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/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.