From aea2a33c73f28ecd8f10b242ecadddcc79c1c28b Mon Sep 17 00:00:00 2001 From: Mark McLoughlin Date: Wed, 27 May 2009 10:06:11 +0100 Subject: Prevent CD-ROM media eject while device is locked Section 10.8.25 ("START/STOP UNIT Command") of SFF-8020i states that if the device is locked we should refuse to eject if the device is locked. ASC_MEDIA_REMOVAL_PREVENTED is the appropriate return in this case. In order to stop itself from ejecting the media it is running from, Fedora's installer (anaconda) requires the CDROMEJECT ioctl() to fail if the drive has been previously locked. See also https://bugzilla.redhat.com/501412 Signed-off-by: Mark McLoughlin Signed-off-by: Anthony Liguori --- block.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'block.h') diff --git a/block.h b/block.h index 0acac63b..71e87fc 100644 --- a/block.h +++ b/block.h @@ -124,7 +124,7 @@ int bdrv_is_inserted(BlockDriverState *bs); int bdrv_media_changed(BlockDriverState *bs); int bdrv_is_locked(BlockDriverState *bs); void bdrv_set_locked(BlockDriverState *bs, int locked); -void bdrv_eject(BlockDriverState *bs, int eject_flag); +int bdrv_eject(BlockDriverState *bs, int eject_flag); void bdrv_set_change_cb(BlockDriverState *bs, void (*change_cb)(void *opaque), void *opaque); void bdrv_get_format(BlockDriverState *bs, char *buf, int buf_size); -- cgit v1.1