From: Fam Zheng <famz@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: kwolf@redhat.com, obarenbo@redhat.com, armbru@redhat.com,
roliveri@redhat.com, hbrock@redhat.com, qemu-devel@nongnu.org,
rjones@redhat.com, pmyers@redhat.com, imain@redhat.com,
stefanha@redhat.com, pbonzini@redhat.com
Subject: Re: [Qemu-devel] [PATCH 1/7] block: Convert BlockDriverState.in_use to refcount
Date: Wed, 3 Jul 2013 08:59:17 +0800 [thread overview]
Message-ID: <20130703005917.GC1949@t430s.nay.redhat.com> (raw)
In-Reply-To: <51D32CDD.8050307@redhat.com>
On Tue, 07/02 13:41, Eric Blake wrote:
> On 07/01/2013 11:59 PM, Fam Zheng wrote:
> > Use numeric value to replace in_use flag in BDS, this will make
> > lifecycle management with ref count possible. This patch only replaces
> > existing uses of bdrv_set_in_use, so no logic change here.
> >
> > Signed-off-by: Fam Zheng <famz@redhat.com>
> > ---
> > block-migration.c | 4 ++--
> > block.c | 23 +++++++++++++++--------
> > blockjob.c | 6 +++---
> > hw/block/dataplane/virtio-blk.c | 4 ++--
> > include/block/block.h | 3 ++-
> > include/block/block_int.h | 2 +-
> > 6 files changed, 25 insertions(+), 17 deletions(-)
> >
> > diff --git a/block-migration.c b/block-migration.c
> > index 2fd7699..2efb6c0 100644
> > --- a/block-migration.c
> > +++ b/block-migration.c
> > @@ -321,7 +321,7 @@ static void init_blk_migration_it(void *opaque, BlockDriverState *bs)
> > bmds->shared_base = block_mig_state.shared_base;
> > alloc_aio_bitmap(bmds);
> > drive_get_ref(drive_get_by_blockdev(bs));
> > - bdrv_set_in_use(bs, 1);
> > + bdrv_get_ref(bs);
>
> The old code sets the flag, the new code gets a ref.
>
> >
> > block_mig_state.total_sector_sum += sectors;
> >
> > @@ -557,7 +557,7 @@ static void blk_mig_cleanup(void)
> > blk_mig_lock();
> > while ((bmds = QSIMPLEQ_FIRST(&block_mig_state.bmds_list)) != NULL) {
> > QSIMPLEQ_REMOVE_HEAD(&block_mig_state.bmds_list, entry);
> > - bdrv_set_in_use(bmds->bs, 0);
> > + bdrv_get_ref(bmds->bs);
>
> The old code sets the flag, the new code gets a ref. Shouldn't this be
> clearing a ref, with bdrv_put_ref?
Yes, thanks for pointing out.
--
Fam
next prev parent reply other threads:[~2013-07-03 0:59 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-02 5:59 [Qemu-devel] [PATCH 0/7] Point-in-time snapshot exporting over NBD Fam Zheng
2013-07-02 5:59 ` [Qemu-devel] [PATCH 1/7] block: Convert BlockDriverState.in_use to refcount Fam Zheng
2013-07-02 10:21 ` Paolo Bonzini
2013-07-08 8:37 ` Fam Zheng
2013-07-02 19:41 ` Eric Blake
2013-07-03 0:59 ` Fam Zheng [this message]
2013-07-02 5:59 ` [Qemu-devel] [PATCH 2/7] block: use refcount to manage BlockDriverState lifecycle Fam Zheng
2013-07-02 5:59 ` [Qemu-devel] [PATCH 3/7] nbd: use BDS refcount Fam Zheng
2013-07-02 10:16 ` Paolo Bonzini
2013-07-03 1:10 ` Fam Zheng
2013-07-03 5:58 ` Paolo Bonzini
2013-07-03 6:30 ` Fam Zheng
2013-07-03 7:28 ` Paolo Bonzini
2013-07-02 5:59 ` [Qemu-devel] [PATCH 4/7] block: simplify bdrv_drop_intermediate Fam Zheng
2013-07-04 14:02 ` Stefan Hajnoczi
2013-07-05 1:00 ` Fam Zheng
2013-07-02 5:59 ` [Qemu-devel] [PATCH 5/7] block: rename bdrv_in_use to bdrv_is_shared Fam Zheng
2013-07-02 5:59 ` [Qemu-devel] [PATCH 6/7] block: add target-id option to drive-backup QMP command Fam Zheng
2013-07-02 19:59 ` Eric Blake
2013-07-02 5:59 ` [Qemu-devel] [PATCH 7/7] block: assign backing relationship in drive-backup Fam Zheng
2013-07-04 14:32 ` Stefan Hajnoczi
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=20130703005917.GC1949@t430s.nay.redhat.com \
--to=famz@redhat.com \
--cc=armbru@redhat.com \
--cc=eblake@redhat.com \
--cc=hbrock@redhat.com \
--cc=imain@redhat.com \
--cc=kwolf@redhat.com \
--cc=obarenbo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=pmyers@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rjones@redhat.com \
--cc=roliveri@redhat.com \
--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).