aboutsummaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2011-07-20 18:23:43 +0200
committerKevin Wolf <kwolf@redhat.com>2011-08-01 12:10:28 +0200
commit49aa46bb4b894ff8bdb0339ee2a5dd3fcfe93ecd (patch)
treebf66b985e9fbe0c270861fbfd5d7601235a5095c /block.c
parent822e1cd17e8fa3ae98d0481c20f042316ace3fbc (diff)
block: Don't let locked flag prevent medium load
Commit aea2a33c made bdrv_eject() obey the locked flag. Correct for medium eject (eject_flag set), incorrect for medium load (eject_flag clear). See MMC-5 Table 341 "Actions for Lock/Unlock/Eject". 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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block.c b/block.c
index 7c25fe4990..8859f9b414 100644
--- a/block.c
+++ b/block.c
@@ -2771,7 +2771,7 @@ int bdrv_eject(BlockDriverState *bs, int eject_flag)
{
BlockDriver *drv = bs->drv;
- if (bs->locked) {
+ if (eject_flag && bs->locked) {
return -EBUSY;
}