提交 84ebe375 编写于 作者: M Markus Armbruster 提交者: Kevin Wolf

block: Make device model's references to BlockBackend strong

Doesn't make a difference just yet, but it's the right thing to do.
Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
Reviewed-by: NBenoît Canet <benoit.canet@nodalink.com>
Reviewed-by: NKevin Wolf <kwolf@redhat.com>
Reviewed-by: NMax Reitz <mreitz@redhat.com>
Signed-off-by: NKevin Wolf <kwolf@redhat.com>
上级 a7f53e26
......@@ -257,6 +257,7 @@ int blk_attach_dev(BlockBackend *blk, void *dev)
if (blk->dev) {
return -EBUSY;
}
blk_ref(blk);
blk->dev = dev;
bdrv_iostatus_reset(blk->bs);
......@@ -290,6 +291,7 @@ void blk_detach_dev(BlockBackend *blk, void *dev)
blk->dev_opaque = NULL;
bdrv_set_guest_block_size(blk->bs, 512);
qemu_coroutine_adjust_pool_size(-COROUTINE_POOL_RESERVATION);
blk_unref(blk);
}
/*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册