Am 20.07.2011 18:23, schrieb Markus Armbruster: > 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 <arm...@redhat.com>
SCSI doesn't really matter here, this is about host state. The comment for bdrv_set_locked only talks about eject, so it's probably right anyway. Kevin > --- > block.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/block.c b/block.c > index 594bcab..6727274 100644 > --- a/block.c > +++ b/block.c > @@ -2769,7 +2769,7 @@ int bdrv_eject(BlockDriverState *bs, int eject_flag) > { > BlockDriver *drv = bs->drv; > > - if (bs->locked) { > + if (eject_flag && bs->locked) { > return -EBUSY; > } >