qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Luiz Capitulino <lcapitulino@redhat.com>
To: aliguori@us.ibm.com
Cc: mdroth@linux.vnet.ibm.com, qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 09/19] block: Rename the BlockIOStatus enum values
Date: Thu, 27 Oct 2011 17:02:06 -0200	[thread overview]
Message-ID: <1319742136-8691-10-git-send-email-lcapitulino@redhat.com> (raw)
In-Reply-To: <1319742136-8691-1-git-send-email-lcapitulino@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 <lcapitulino@redhat.com>
---
 block.c |   18 ++++++++++--------
 block.h |    3 ++-
 2 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/block.c b/block.c
index 4dc2b85..1a4625f 100644
--- a/block.c
+++ b/block.c
@@ -1870,10 +1870,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)
@@ -3140,7 +3140,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
@@ -3161,7 +3161,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;
     }
 }
 
@@ -3170,9 +3170,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 1823e93..c37b1bf 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.475.g997a1

  parent reply	other threads:[~2011-10-27 19:03 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-27 19:01 [Qemu-devel] [PULL 00/19]: QMP queue Luiz Capitulino
2011-10-27 19:01 ` [Qemu-devel] [PATCH 01/19] qapi-commands.py: Don't call the output marshal on error Luiz Capitulino
2011-10-27 19:01 ` [Qemu-devel] [PATCH 02/19] qapi: Convert query-mice Luiz Capitulino
2011-10-27 19:02 ` [Qemu-devel] [PATCH 03/19] qapi: Convert query-migrate Luiz Capitulino
2011-10-27 19:02 ` [Qemu-devel] [PATCH 04/19] Monitor: Make mon_set_cpu() public Luiz Capitulino
2011-10-27 19:02 ` [Qemu-devel] [PATCH 05/19] Monitor: Introduce monitor_get_cpu_index() Luiz Capitulino
2011-10-27 19:02 ` [Qemu-devel] [PATCH 06/19] qapi: Convert the cpu command Luiz Capitulino
2011-10-27 19:02 ` [Qemu-devel] [PATCH 07/19] qapi: Convert query-cpus Luiz Capitulino
2011-10-27 19:02 ` [Qemu-devel] [PATCH 08/19] block: iostatus: Drop BDRV_IOS_INVAL Luiz Capitulino
2011-10-27 19:02 ` Luiz Capitulino [this message]
2011-10-27 19:02 ` [Qemu-devel] [PATCH 10/19] qapi: Convert query-block Luiz Capitulino
2011-10-27 19:02 ` [Qemu-devel] [PATCH 11/19] qapi: Convert query-blockstats Luiz Capitulino
2011-10-27 19:02 ` [Qemu-devel] [PATCH 12/19] qerror: Add a user string for QERR_FEATURE_DISABLED Luiz Capitulino
2011-10-27 19:02 ` [Qemu-devel] [PATCH 13/19] qapi: Convert query-vnc Luiz Capitulino
2011-10-27 19:02 ` [Qemu-devel] [PATCH 14/19] qapi: Convert query-spice Luiz Capitulino
2011-10-27 19:02 ` [Qemu-devel] [PATCH 15/19] qapi: Convert query-balloon Luiz Capitulino
2011-10-27 19:02 ` [Qemu-devel] [PATCH 16/19] qapi: Convert query-pci Luiz Capitulino
2011-10-27 19:02 ` [Qemu-devel] [PATCH 17/19] QMP: Drop the query commands dispatch table Luiz Capitulino
2011-10-27 19:02 ` [Qemu-devel] [PATCH 18/19] Monitor: do_info(): Drop QMP command handling code Luiz Capitulino
2011-10-27 19:02 ` [Qemu-devel] [PATCH 19/19] Drop qemu-objects.h from modules that don't require it Luiz Capitulino
2011-10-31 16:52 ` [Qemu-devel] [PULL 00/19]: QMP queue Anthony Liguori
  -- strict thread matches above, loose matches on Subject: below --
2011-10-24 13:26 [Qemu-devel] [PATCH v1 00/19]: QAPI conversions round 2 Luiz Capitulino
2011-10-24 13:27 ` [Qemu-devel] [PATCH 09/19] block: Rename the BlockIOStatus enum values Luiz Capitulino

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1319742136-8691-10-git-send-email-lcapitulino@redhat.com \
    --to=lcapitulino@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).