[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v5 03/23] block: Connect BlockBackend to BlockDr
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH v5 03/23] block: Connect BlockBackend to BlockDriverState |
Date: |
Thu, 2 Oct 2014 12:41:47 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Am 02.10.2014 um 11:04 hat Markus Armbruster geschrieben:
> Convenience function blk_new_with_bs() creates a BlockBackend with its
> BlockDriverState. Callers have to unref both. The commit after next
> will relieve them of the need to unref the BlockDriverState.
>
> Complication: due to the silly way drive_del works, we need a way to
> hide a BlockBackend, just like bdrv_make_anon(). To emphasize its
> "special" status, give the function a suitably off-putting name:
> blk_hide_on_behalf_of_do_drive_del(). Unfortunately, hiding turns the
> BlockBackend's name into the empty string. Can't avoid that without
> breaking the blk->bs->device_name equals blk->name invariant.
>
> The patch adds a memory leak: drive_del while a device model is
> connected leaks the BlockBackend. Avoiding the leak here is rather
> hairy, but it'll become straightforward shortly, so I mark it FIXME in
> the code now, and plug it when it's easy.
Does this leak actually still exist now that you have a blk_unref() in
drive_del() (which is called during autodel) rather than do_drive_del()?
> Signed-off-by: Markus Armbruster <address@hidden>
> Reviewed-by: Max Reitz <address@hidden>
Kevin
- [Qemu-devel] [PATCH v5 00/23] Split BlockBackend off BDS with an axe, Markus Armbruster, 2014/10/02
- [Qemu-devel] [PATCH v5 01/23] block: Split bdrv_new_root() off bdrv_new(), Markus Armbruster, 2014/10/02
- [Qemu-devel] [PATCH v5 05/23] block: Code motion to get rid of stubs/blockdev.c, Markus Armbruster, 2014/10/02
- [Qemu-devel] [PATCH v5 13/23] virtio-blk: Drop redundant VirtIOBlock member conf, Markus Armbruster, 2014/10/02
- [Qemu-devel] [PATCH v5 07/23] block: Eliminate bdrv_iterate(), use bdrv_next(), Markus Armbruster, 2014/10/02
- [Qemu-devel] [PATCH v5 03/23] block: Connect BlockBackend to BlockDriverState, Markus Armbruster, 2014/10/02
- Re: [Qemu-devel] [PATCH v5 03/23] block: Connect BlockBackend to BlockDriverState,
Kevin Wolf <=
- [Qemu-devel] [PATCH v5 09/23] block: Merge BlockBackend and BlockDriverState name spaces, Markus Armbruster, 2014/10/02
- [Qemu-devel] [PATCH v5 02/23] block: New BlockBackend, Markus Armbruster, 2014/10/02
- [Qemu-devel] [PATCH v5 04/23] block: Connect BlockBackend and DriveInfo, Markus Armbruster, 2014/10/02
- [Qemu-devel] [PATCH v5 10/23] block: Eliminate DriveInfo member bdrv, use blk_by_legacy_dinfo(), Markus Armbruster, 2014/10/02
- [Qemu-devel] [PATCH v5 06/23] block: Make BlockBackend own its BlockDriverState, Markus Armbruster, 2014/10/02
- [Qemu-devel] [PATCH v5 21/23] blockdev: Convert qmp_eject(), qmp_change_blockdev() to BlockBackend, Markus Armbruster, 2014/10/02
- [Qemu-devel] [PATCH v5 14/23] virtio-blk: Rename VirtIOBlkConf variables to conf, Markus Armbruster, 2014/10/02