qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Fam Zheng <famz@redhat.com>
Cc: kwolf@redhat.com, jcody@redhat.com, qemu-devel@nongnu.org,
	stefanha@redhat.com
Subject: Re: [Qemu-devel] [PATCH v4 5/7] commit: support commit active layer
Date: Mon, 30 Sep 2013 14:16:41 +0200	[thread overview]
Message-ID: <52496BA9.7050104@redhat.com> (raw)
In-Reply-To: <1380542578-2387-6-git-send-email-famz@redhat.com>

Il 30/09/2013 14:02, Fam Zheng ha scritto:
> +        /* Mirror code already swapped bs and base, we drop the bs loop chain
> +         * formed by the swap: break the loop chain, trigger the chain unref.
> +         */
> +        p = info->base->backing_hd;
> +        info->base->backing_hd = NULL;
> +        bdrv_unref(p);

Should this code be in mirror_run? Perhaps extracting it into a new
function together with the preceding lines:

        if (bdrv_get_flags(s->target) != bdrv_get_flags(s->common.bs)) {
            bdrv_reopen(s->target, bdrv_get_flags(s->common.bs), NULL);
        }
        bdrv_swap(s->target, s->common.bs);

Same for this:

> +        if (bdrv_reopen(base_bs, bs->open_flags, &local_err)) {
> +            error_propagate(errp, local_err);
> +            return;
> +        }
> +        bdrv_ref(base_bs);

Perhaps you can have an internal function mirror_start_job and two
front-ends mirror_start + commit_active_start that wrap it.  Similarly,
mirror_start_job can take the base BDS and a bool instead of
MirrorSyncMode (removing the need for MIRROR_SYNC_MODE_COMMON).

But apart from these details, the series looks very nice.

Paolo

  reply	other threads:[~2013-09-30 12:16 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-30 12:02 [Qemu-devel] [PATCH v4 0/7] block: allow commit active as top Fam Zheng
2013-09-30 12:02 ` [Qemu-devel] [PATCH v4 1/7] block: add bdrv_common_ancestor() Fam Zheng
2013-09-30 21:40   ` Eric Blake
2013-09-30 12:02 ` [Qemu-devel] [PATCH v4 2/7] qmp: add internal sync mode "common" to mirror_start Fam Zheng
2013-09-30 14:49   ` Eric Blake
2013-10-08  8:08     ` Fam Zheng
2013-09-30 12:02 ` [Qemu-devel] [PATCH v4 3/7] mirror: don't close target Fam Zheng
2013-10-01 17:11   ` Eric Blake
2013-09-30 12:02 ` [Qemu-devel] [PATCH v4 4/7] mirror: Add commit_job_type to perform commit with mirror code Fam Zheng
2013-10-01 17:13   ` Eric Blake
2013-10-08  8:37     ` Fam Zheng
2013-09-30 12:02 ` [Qemu-devel] [PATCH v4 5/7] commit: support commit active layer Fam Zheng
2013-09-30 12:16   ` Paolo Bonzini [this message]
2013-09-30 12:02 ` [Qemu-devel] [PATCH v4 6/7] commit: remove unused check Fam Zheng
2013-09-30 12:17   ` Paolo Bonzini
2013-10-08  9:32     ` Fam Zheng
2013-09-30 12:02 ` [Qemu-devel] [PATCH v4 7/7] qemu-iotests: update test cases for commit active Fam Zheng

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=52496BA9.7050104@redhat.com \
    --to=pbonzini@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 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).