On 07.10.2014 13:59, Markus Armbruster wrote:
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.
Signed-off-by: Markus Armbruster <arm...@redhat.com>
---
block.c | 12 ++--
block/block-backend.c | 71 ++++++++++++++++++++++-
blockdev.c | 19 +++----
hw/block/xen_disk.c | 8 +--
include/block/block_int.h | 2 +
include/sysemu/block-backend.h | 5 ++
qemu-img.c | 125 +++++++++++++++++++----------------------
qemu-io.c | 4 +-
qemu-nbd.c | 4 +-
9 files changed, 156 insertions(+), 94 deletions(-)
Reviewed-by: Max Reitz <mre...@redhat.com>