[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 04/11] block: use refcnt for device attach/de
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH v2 04/11] block: use refcnt for device attach/detach |
Date: |
Tue, 23 Jul 2013 11:44:17 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Wed, Jul 17, 2013 at 05:42:09PM +0800, Fam Zheng wrote:
> Signed-off-by: Fam Zheng <address@hidden>
> ---
> block.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/block.c b/block.c
> index 7b46669..57a3876 100644
> --- a/block.c
> +++ b/block.c
> @@ -1622,6 +1622,7 @@ int bdrv_attach_dev(BlockDriverState *bs, void *dev)
> return -EBUSY;
> }
> bs->dev = dev;
> + bdrv_ref(bs, false);
> bdrv_iostatus_reset(bs);
> return 0;
> }
> @@ -1639,6 +1640,7 @@ void bdrv_detach_dev(BlockDriverState *bs, void *dev)
> {
> assert(bs->dev == dev);
> bs->dev = NULL;
> + bdrv_unref(bs, false);
> bs->dev_ops = NULL;
> bs->dev_opaque = NULL;
> bs->buffer_alignment = 512;
I'm not 100% sure about this. sd_init() and
ide_init2_with_non_qdev_drives() call bdrv_attach_dev_nofail() but I
don't see a bdrv_detach_dev() call.
It may be necessary to audit the lifecycle of emulated storage
controllers more closely before the refcounts work correctly.
- Re: [Qemu-devel] [PATCH v2 01/11] block: replace in_use with refcnt_soft and refcnt_hard, (continued)
- Re: [Qemu-devel] [PATCH v2 01/11] block: replace in_use with refcnt_soft and refcnt_hard, Stefan Hajnoczi, 2013/07/23
- Re: [Qemu-devel] [PATCH v2 01/11] block: replace in_use with refcnt_soft and refcnt_hard, Fam Zheng, 2013/07/23
- Re: [Qemu-devel] [PATCH v2 01/11] block: replace in_use with refcnt_soft and refcnt_hard, Stefan Hajnoczi, 2013/07/23
- Re: [Qemu-devel] [PATCH v2 01/11] block: replace in_use with refcnt_soft and refcnt_hard, Fam Zheng, 2013/07/23
- Re: [Qemu-devel] [PATCH v2 01/11] block: replace in_use with refcnt_soft and refcnt_hard, Stefan Hajnoczi, 2013/07/24
- Re: [Qemu-devel] [PATCH v2 01/11] block: replace in_use with refcnt_soft and refcnt_hard, Fam Zheng, 2013/07/24
- Re: [Qemu-devel] [PATCH v2 01/11] block: replace in_use with refcnt_soft and refcnt_hard, Stefan Hajnoczi, 2013/07/25
[Qemu-devel] [PATCH v2 02/11] block: use refcnt for bs->backing_hd and bs->file, Fam Zheng, 2013/07/17
[Qemu-devel] [PATCH v2 03/11] block: use refcnt for drive_init/drive_uninit, Fam Zheng, 2013/07/17
[Qemu-devel] [PATCH v2 04/11] block: use refcnt for device attach/detach, Fam Zheng, 2013/07/17
- Re: [Qemu-devel] [PATCH v2 04/11] block: use refcnt for device attach/detach,
Stefan Hajnoczi <=
[Qemu-devel] [PATCH v2 05/11] migration: omit drive ref as we have bdrv_ref now, Fam Zheng, 2013/07/17
[Qemu-devel] [PATCH v2 06/11] xen_disk: simplify blk_disconnect with refcnt, Fam Zheng, 2013/07/17
[Qemu-devel] [PATCH v2 07/11] block: hold hard reference for backup/mirror target, Fam Zheng, 2013/07/17
[Qemu-devel] [PATCH v2 08/11] block: simplify bdrv_drop_intermediate, Fam Zheng, 2013/07/17