[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 04/29] block: Make BlockDriver method bdrv_set_locke
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 04/29] block: Make BlockDriver method bdrv_set_locked() return void |
Date: |
Wed, 3 Aug 2011 16:13:59 +0200 |
From: Markus Armbruster <address@hidden>
The only caller is bdrv_set_locked(), and it ignores the value.
Callees always return 0, except for FreeBSD's cdrom_set_locked(),
which returns -ENOTSUP when the device is in a terminally wedged
state.
Signed-off-by: Markus Armbruster <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block/raw-posix.c | 10 +++-------
block/raw.c | 3 +--
block_int.h | 2 +-
3 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/block/raw-posix.c b/block/raw-posix.c
index cd89c83..5241308 100644
--- a/block/raw-posix.c
+++ b/block/raw-posix.c
@@ -1363,7 +1363,7 @@ static int cdrom_eject(BlockDriverState *bs, int
eject_flag)
return 0;
}
-static int cdrom_set_locked(BlockDriverState *bs, int locked)
+static void cdrom_set_locked(BlockDriverState *bs, int locked)
{
BDRVRawState *s = bs->opaque;
@@ -1374,8 +1374,6 @@ static int cdrom_set_locked(BlockDriverState *bs, int
locked)
*/
/* perror("CDROM_LOCKDOOR"); */
}
-
- return 0;
}
static BlockDriver bdrv_host_cdrom = {
@@ -1486,12 +1484,12 @@ static int cdrom_eject(BlockDriverState *bs, int
eject_flag)
return 0;
}
-static int cdrom_set_locked(BlockDriverState *bs, int locked)
+static void cdrom_set_locked(BlockDriverState *bs, int locked)
{
BDRVRawState *s = bs->opaque;
if (s->fd < 0)
- return -ENOTSUP;
+ return;
if (ioctl(s->fd, (locked ? CDIOCPREVENT : CDIOCALLOW)) < 0) {
/*
* Note: an error can happen if the distribution automatically
@@ -1499,8 +1497,6 @@ static int cdrom_set_locked(BlockDriverState *bs, int
locked)
*/
/* perror("CDROM_LOCKDOOR"); */
}
-
- return 0;
}
static BlockDriver bdrv_host_cdrom = {
diff --git a/block/raw.c b/block/raw.c
index b0f72d6..1398a9c 100644
--- a/block/raw.c
+++ b/block/raw.c
@@ -80,10 +80,9 @@ static int raw_eject(BlockDriverState *bs, int eject_flag)
return bdrv_eject(bs->file, eject_flag);
}
-static int raw_set_locked(BlockDriverState *bs, int locked)
+static void raw_set_locked(BlockDriverState *bs, int locked)
{
bdrv_set_locked(bs->file, locked);
- return 0;
}
static int raw_ioctl(BlockDriverState *bs, unsigned long int req, void *buf)
diff --git a/block_int.h b/block_int.h
index efb6803..e0b638c 100644
--- a/block_int.h
+++ b/block_int.h
@@ -113,7 +113,7 @@ struct BlockDriver {
int (*bdrv_is_inserted)(BlockDriverState *bs);
int (*bdrv_media_changed)(BlockDriverState *bs);
int (*bdrv_eject)(BlockDriverState *bs, int eject_flag);
- int (*bdrv_set_locked)(BlockDriverState *bs, int locked);
+ void (*bdrv_set_locked)(BlockDriverState *bs, int locked);
/* to control generic scsi devices */
int (*bdrv_ioctl)(BlockDriverState *bs, unsigned long int req, void *buf);
--
1.7.6
- [Qemu-devel] [PULL 00/29] Block patches, Kevin Wolf, 2011/08/03
- [Qemu-devel] [PATCH 01/29] blockdev: Make eject fail for non-removable drives even with -f, Kevin Wolf, 2011/08/03
- [Qemu-devel] [PATCH 02/29] block: Reset device model callbacks on detach, Kevin Wolf, 2011/08/03
- [Qemu-devel] [PATCH 04/29] block: Make BlockDriver method bdrv_set_locked() return void,
Kevin Wolf <=
- [Qemu-devel] [PATCH 03/29] block/raw-win32: Drop disabled code for removable host devices, Kevin Wolf, 2011/08/03
- [Qemu-devel] [PATCH 05/29] block: Make BlockDriver method bdrv_eject() return void, Kevin Wolf, 2011/08/03
- [Qemu-devel] [PATCH 06/29] block: Don't let locked flag prevent medium load, Kevin Wolf, 2011/08/03
- [Qemu-devel] [PATCH 07/29] block/vpc.c: Detect too-large vpc file, Kevin Wolf, 2011/08/03
- [Qemu-devel] [PATCH 09/29] scsi: Remove references to SET_WINDOW, Kevin Wolf, 2011/08/03
- [Qemu-devel] [PATCH 12/29] scsi-disk: Remove 'drive_kind', Kevin Wolf, 2011/08/03
- [Qemu-devel] [PATCH 11/29] scsi: Sanitize command definitions, Kevin Wolf, 2011/08/03
- [Qemu-devel] [PATCH 08/29] scsi-disk: Codingstyle fixes, Kevin Wolf, 2011/08/03
- [Qemu-devel] [PATCH 13/29] block: Removed unused function bdrv_write_sync, Kevin Wolf, 2011/08/03
- [Qemu-devel] [PATCH 14/29] raw-posix: Typo fix, Kevin Wolf, 2011/08/03