]> git.proxmox.com Git - mirror_qemu.git/commit - block/block-backend.c
block: Lift device model API into BlockBackend
authorMarkus Armbruster <armbru@redhat.com>
Tue, 7 Oct 2014 11:59:25 +0000 (13:59 +0200)
committerKevin Wolf <kwolf@redhat.com>
Mon, 20 Oct 2014 12:03:50 +0000 (14:03 +0200)
commita7f53e26a6f5bd64cda617cbcca118601d9a01d9
tree126055939716b056e9cf975eae1118fdbe2526ee
parent6007cdd448b6729e82530e85579e5089ddc58eba
block: Lift device model API into BlockBackend

Move device model attachment / detachment and the BlockDevOps device
model callbacks and their wrappers from BlockDriverState to
BlockBackend.

Wrapper calls in block.c change from

    bdrv_dev_FOO_cb(bs, ...)

to

    if (bs->blk) {
        bdrv_dev_FOO_cb(bs->blk, ...);
    }

No change, because both bdrv_dev_change_media_cb() and
bdrv_dev_resize_cb() do nothing when no device model is attached, and
a device model can be attached only when bs->blk.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block.c
block/block-backend.c
block/qapi.c
blockdev.c
include/block/block.h
include/block/block_int.h
include/sysemu/block-backend.h