[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v5 19/22] blkdebug: Alias "errno" as "error"
From: |
Max Reitz |
Subject: |
[Qemu-devel] [PATCH v5 19/22] blkdebug: Alias "errno" as "error" |
Date: |
Fri, 13 Dec 2013 18:10:30 +0100 |
Introduce an alias "error" for "errno", since using the latter for QMP
is sure to result in various syntax errors due to the name being used
directly as an identifier.
Signed-off-by: Max Reitz <address@hidden>
---
block/blkdebug.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/block/blkdebug.c b/block/blkdebug.c
index fdfc6b0..522a766 100644
--- a/block/blkdebug.c
+++ b/block/blkdebug.c
@@ -100,6 +100,10 @@ static QemuOptsList inject_error_opts = {
.type = QEMU_OPT_NUMBER,
},
{
+ .name = "error",
+ .type = QEMU_OPT_NUMBER,
+ },
+ {
.name = "sector",
.type = QEMU_OPT_NUMBER,
},
@@ -232,7 +236,8 @@ static int add_rule(QemuOpts *opts, void *opaque)
/* Parse action-specific options */
switch (d->action) {
case ACTION_INJECT_ERROR:
- rule->options.inject.error = qemu_opt_get_number(opts, "errno", EIO);
+ rule->options.inject.error = qemu_opt_get_number(opts,
+ qemu_opt_get(opts, "errno") ? "errno" : "error", EIO);
rule->options.inject.once = qemu_opt_get_bool(opts, "once", 0);
rule->options.inject.immediately =
qemu_opt_get_bool(opts, "immediately", 0);
--
1.8.5.1
- Re: [Qemu-devel] [PATCH v5 15/22] blkdebug: Allow command-line file configuration, (continued)
[Qemu-devel] [PATCH v5 16/22] blkdebug: Make filename optional, Max Reitz, 2013/12/13
[Qemu-devel] [PATCH v5 18/22] blkverify: Don't require protocol filename, Max Reitz, 2013/12/13
[Qemu-devel] [PATCH v5 17/22] blkverify: Allow command-line configuration, Max Reitz, 2013/12/13
[Qemu-devel] [PATCH v5 19/22] blkdebug: Alias "errno" as "error",
Max Reitz <=
[Qemu-devel] [PATCH v5 20/22] qapi: QMP interface for blkdebug and blkverify, Max Reitz, 2013/12/13
[Qemu-devel] [PATCH v5 21/22] qemu-io: Make filename optional, Max Reitz, 2013/12/13