From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51378) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VqoFr-0002Ch-70 for qemu-devel@nongnu.org; Wed, 11 Dec 2013 13:11:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VqoFg-0002LA-OR for qemu-devel@nongnu.org; Wed, 11 Dec 2013 13:11:27 -0500 Received: from mx1.redhat.com ([209.132.183.28]:20494) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VqoFg-0002Kx-GW for qemu-devel@nongnu.org; Wed, 11 Dec 2013 13:11:16 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rBBIBFTM006494 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 11 Dec 2013 13:11:15 -0500 From: Max Reitz Date: Wed, 11 Dec 2013 19:11:10 +0100 Message-Id: <1386785473-26157-19-git-send-email-mreitz@redhat.com> In-Reply-To: <1386785473-26157-1-git-send-email-mreitz@redhat.com> References: <1386785473-26157-1-git-send-email-mreitz@redhat.com> Subject: [Qemu-devel] [PATCH v3 18/21] 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 6b59216..87993f9 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