diff options
author | Markus Armbruster <armbru@redhat.com> | 2014-10-07 13:59:25 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2014-10-20 14:03:50 +0200 |
commit | a7f53e26a6f5bd64cda617cbcca118601d9a01d9 (patch) | |
tree | 126055939716b056e9cf975eae1118fdbe2526ee /block/qapi.c | |
parent | 6007cdd448b6729e82530e85579e5089ddc58eba (diff) |
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>
Diffstat (limited to 'block/qapi.c')
-rw-r--r-- | block/qapi.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/block/qapi.c b/block/qapi.c index fca981d94e..1301144bbc 100644 --- a/block/qapi.c +++ b/block/qapi.c @@ -275,12 +275,12 @@ static void bdrv_query_info(BlockBackend *blk, BlockInfo **p_info, Error *local_err = NULL; info->device = g_strdup(blk_name(blk)); info->type = g_strdup("unknown"); - info->locked = bdrv_dev_is_medium_locked(bs); - info->removable = bdrv_dev_has_removable_media(bs); + info->locked = blk_dev_is_medium_locked(blk); + info->removable = blk_dev_has_removable_media(blk); - if (bdrv_dev_has_removable_media(bs)) { + if (blk_dev_has_removable_media(blk)) { info->has_tray_open = true; - info->tray_open = bdrv_dev_is_tray_open(bs); + info->tray_open = blk_dev_is_tray_open(blk); } if (bdrv_iostatus_is_enabled(bs)) { |