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>
This commit is contained in:
Markus Armbruster 2011-07-20 18:23:43 +02:00 committed by Kevin Wolf
parent 822e1cd17e
commit 49aa46bb4b
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}