summaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2011-09-06 18:58:45 +0200
committerKevin Wolf <kwolf@redhat.com>2011-09-12 15:17:20 +0200
commitfdec4404ddfaf9e121bef84eac1303a8a0e47d75 (patch)
treeea7637b6abf1510c1ff22baf1b495536f71a5b40 /block.c
parent81b1008d50829fdcbe79aa67fa1113bb00a787d6 (diff)
downloadqemu-fdec4404ddfaf9e121bef84eac1303a8a0e47d75.tar.gz
qemu-fdec4404ddfaf9e121bef84eac1303a8a0e47d75.tar.bz2
qemu-fdec4404ddfaf9e121bef84eac1303a8a0e47d75.zip
block: Leave enforcing tray lock to device models
The device model knows best when to accept the guest's eject command. No need to detour through the block layer. bdrv_eject() can't fail anymore. Make it void. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block.c')
-rw-r--r--block.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/block.c b/block.c
index 8c86251fa1..7408fa9dc2 100644
--- a/block.c
+++ b/block.c
@@ -3051,18 +3051,13 @@ int bdrv_media_changed(BlockDriverState *bs)
/**
* If eject_flag is TRUE, eject the media. Otherwise, close the tray
*/
-int bdrv_eject(BlockDriverState *bs, int eject_flag)
+void bdrv_eject(BlockDriverState *bs, int eject_flag)
{
BlockDriver *drv = bs->drv;
- if (eject_flag && bs->locked) {
- return -EBUSY;
- }
-
if (drv && drv->bdrv_eject) {
drv->bdrv_eject(bs, eject_flag);
}
- return 0;
}
int bdrv_is_locked(BlockDriverState *bs)