• Markus Armbruster's avatar
    block: Connect BlockBackend to BlockDriverState · 7e7d56d9
    Markus Armbruster authored
    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: default avatarMarkus Armbruster <armbru@redhat.com>
    Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
    7e7d56d9
qemu-img.c 86.1 KB