From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:44122) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RIKZ2-0000tP-BH for qemu-devel@nongnu.org; Mon, 24 Oct 2011 09:27:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RIKYw-0003b5-Ir for qemu-devel@nongnu.org; Mon, 24 Oct 2011 09:27:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55427) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RIKYw-0003au-9s for qemu-devel@nongnu.org; Mon, 24 Oct 2011 09:27:34 -0400 From: Luiz Capitulino Date: Mon, 24 Oct 2011 11:27:02 -0200 Message-Id: <1319462832-12199-10-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1319462832-12199-1-git-send-email-lcapitulino@redhat.com> References: <1319462832-12199-1-git-send-email-lcapitulino@redhat.com> Subject: [Qemu-devel] [PATCH 09/19] block: Rename the BlockIOStatus enum values List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, armbru@redhat.com, aliguori@us.ibm.com, mdroth@linux.vnet.ibm.com, quintela@redhat.com The biggest change is to rename its prefix from BDRV_IOS to BLOCK_DEVICE_IO_STATUS. Next commit will convert the query-block command to the QAPI and that's how the enumeration is going to be generated. Signed-off-by: Luiz Capitulino --- block.c | 18 ++++++++++-------- block.h | 3 ++- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/block.c b/block.c index 04f4143..443014e 100644 --- a/block.c +++ b/block.c @@ -1921,10 +1921,10 @@ void bdrv_info_print(Monitor *mon, const QObject *data) qlist_iter(qobject_to_qlist(data), bdrv_print_dict, mon); } -static const char *const io_status_name[BDRV_IOS_MAX] = { - [BDRV_IOS_OK] = "ok", - [BDRV_IOS_FAILED] = "failed", - [BDRV_IOS_ENOSPC] = "nospace", +static const char *const io_status_name[BLOCK_DEVICE_IO_STATUS_MAX] = { + [BLOCK_DEVICE_IO_STATUS_OK] = "ok", + [BLOCK_DEVICE_IO_STATUS_FAILED] = "failed", + [BLOCK_DEVICE_IO_STATUS_NOSPACE] = "nospace", }; void bdrv_info(Monitor *mon, QObject **ret_data) @@ -3080,7 +3080,7 @@ int bdrv_in_use(BlockDriverState *bs) void bdrv_iostatus_enable(BlockDriverState *bs) { bs->iostatus_enabled = true; - bs->iostatus = BDRV_IOS_OK; + bs->iostatus = BLOCK_DEVICE_IO_STATUS_OK; } /* The I/O status is only enabled if the drive explicitly @@ -3101,7 +3101,7 @@ void bdrv_iostatus_disable(BlockDriverState *bs) void bdrv_iostatus_reset(BlockDriverState *bs) { if (bdrv_iostatus_is_enabled(bs)) { - bs->iostatus = BDRV_IOS_OK; + bs->iostatus = BLOCK_DEVICE_IO_STATUS_OK; } } @@ -3110,9 +3110,11 @@ void bdrv_iostatus_reset(BlockDriverState *bs) possible to implement this without device models being involved */ void bdrv_iostatus_set_err(BlockDriverState *bs, int error) { - if (bdrv_iostatus_is_enabled(bs) && bs->iostatus == BDRV_IOS_OK) { + if (bdrv_iostatus_is_enabled(bs) && + bs->iostatus == BLOCK_DEVICE_IO_STATUS_OK) { assert(error >= 0); - bs->iostatus = error == ENOSPC ? BDRV_IOS_ENOSPC : BDRV_IOS_FAILED; + bs->iostatus = error == ENOSPC ? BLOCK_DEVICE_IO_STATUS_NOSPACE : + BLOCK_DEVICE_IO_STATUS_FAILED; } } diff --git a/block.h b/block.h index 9c77604..f655686 100644 --- a/block.h +++ b/block.h @@ -78,7 +78,8 @@ typedef enum { } BlockMonEventAction; typedef enum { - BDRV_IOS_OK, BDRV_IOS_FAILED, BDRV_IOS_ENOSPC, BDRV_IOS_MAX + BLOCK_DEVICE_IO_STATUS_OK, BLOCK_DEVICE_IO_STATUS_FAILED, + BLOCK_DEVICE_IO_STATUS_NOSPACE, BLOCK_DEVICE_IO_STATUS_MAX } BlockIOStatus; void bdrv_iostatus_enable(BlockDriverState *bs); -- 1.7.7.1.431.g10b2a