[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4 5/7] commit: support commit active layer
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH v4 5/7] commit: support commit active layer |
Date: |
Mon, 30 Sep 2013 14:16:41 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130923 Thunderbird/17.0.9 |
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
- [Qemu-devel] [PATCH v4 0/7] block: allow commit active as top, Fam Zheng, 2013/09/30
- [Qemu-devel] [PATCH v4 1/7] block: add bdrv_common_ancestor(), Fam Zheng, 2013/09/30
- [Qemu-devel] [PATCH v4 2/7] qmp: add internal sync mode "common" to mirror_start, Fam Zheng, 2013/09/30
- [Qemu-devel] [PATCH v4 3/7] mirror: don't close target, Fam Zheng, 2013/09/30
- [Qemu-devel] [PATCH v4 4/7] mirror: Add commit_job_type to perform commit with mirror code, Fam Zheng, 2013/09/30
- [Qemu-devel] [PATCH v4 5/7] commit: support commit active layer, Fam Zheng, 2013/09/30
- Re: [Qemu-devel] [PATCH v4 5/7] commit: support commit active layer,
Paolo Bonzini <=
- [Qemu-devel] [PATCH v4 6/7] commit: remove unused check, Fam Zheng, 2013/09/30
- [Qemu-devel] [PATCH v4 7/7] qemu-iotests: update test cases for commit active, Fam Zheng, 2013/09/30