From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49069) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VrWH6-0003vW-Im for qemu-devel@nongnu.org; Fri, 13 Dec 2013 12:11:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VrWH0-0008BW-JZ for qemu-devel@nongnu.org; Fri, 13 Dec 2013 12:11:40 -0500 Received: from mx1.redhat.com ([209.132.183.28]:31376) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VrWH0-0008BK-C8 for qemu-devel@nongnu.org; Fri, 13 Dec 2013 12:11:34 -0500 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rBDHBX7Q017379 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 13 Dec 2013 12:11:33 -0500 From: Max Reitz Date: Fri, 13 Dec 2013 18:10:30 +0100 Message-Id: <1386954633-28905-20-git-send-email-mreitz@redhat.com> In-Reply-To: <1386954633-28905-1-git-send-email-mreitz@redhat.com> References: <1386954633-28905-1-git-send-email-mreitz@redhat.com> Subject: [Qemu-devel] [PATCH v5 19/22] blkdebug: Alias "errno" as "error" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Fam Zheng , Stefan Hajnoczi , Max Reitz 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 --- 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