]> git.proxmox.com Git - mirror_qemu.git/commit - qemu-io.c
block: Connect BlockBackend to BlockDriverState
authorMarkus Armbruster <armbru@redhat.com>
Tue, 7 Oct 2014 11:59:05 +0000 (13:59 +0200)
committerKevin Wolf <kwolf@redhat.com>
Mon, 20 Oct 2014 11:41:26 +0000 (13:41 +0200)
commit7e7d56d9e05b340290669442cfa05f5869204572
tree5ac3934eadc67544a188e1f368357bfe16c6b81c
parent26f54e9a3cfe62fca61baf83a06b269935d6b9a4
block: Connect BlockBackend to BlockDriverState

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 <armbru@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block.c
block/block-backend.c
blockdev.c
hw/block/xen_disk.c
include/block/block_int.h
include/sysemu/block-backend.h
qemu-img.c
qemu-io.c
qemu-nbd.c