Received: from eggs.gnu.org ([2001:4830:134:3::10]:44113) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VfmBG-0003Ft-Ex for qemu-devel@nongnu.org; Mon, 11 Nov 2013 02:45:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VfmB5-0005Wt-0R for qemu-devel@nongnu.org; Mon, 11 Nov 2013 02:45:06 -0500 Received: from e23smtp09.au.ibm.com ([202.81.31.142]:49167) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VfmB4-0005Ux-AA for qemu-devel@nongnu.org; Mon, 11 Nov 2013 02:44:54 -0500 Received: from /spool/local by e23smtp09.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 11 Nov 2013 17:44:48 +1000 From: Alexey Kardashevskiy Date: Mon, 11 Nov 2013 18:44:33 +1100 Message-Id: <1384155875-26999-5-git-send-email-aik@ozlabs.ru> In-Reply-To: <1384155875-26999-1-git-send-email-aik@ozlabs.ru> References: <1384155875-26999-1-git-send-email-aik@ozlabs.ru> Subject: [Qemu-devel] [PATCH v3 4/6] qemu-option: support +foo/-foo command line agruments List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Alexey Kardashevskiy , qemu-ppc@nongnu.org, Alexander Graf , =?UTF-8?q?Andreas=20F=C3=A4rber?= This converts +foo/-foo to "foo=on"/"foo=off" respectively when QEMU parser is used for the command line options. "-cpu" parsers in x86 and other architectures should be unaffected by this change. Signed-off-by: Alexey Kardashevskiy --- util/qemu-option.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/util/qemu-option.c b/util/qemu-option.c index efcb5dc..6c8667c 100644 --- a/util/qemu-option.c +++ b/util/qemu-option.c @@ -890,6 +890,12 @@ static int opts_do_parse(QemuOpts *opts, const char *params, if (strncmp(option, "no", 2) == 0) { memmove(option, option+2, strlen(option+2)+1); pstrcpy(value, sizeof(value), "off"); + } else if (strncmp(option, "-", 1) == 0) { + memmove(option, option+1, strlen(option+1)+1); + pstrcpy(value, sizeof(value), "off"); + } else if (strncmp(option, "+", 1) == 0) { + memmove(option, option+1, strlen(option+1)+1); + pstrcpy(value, sizeof(value), "on"); } else { pstrcpy(value, sizeof(value), "on"); } -- 1.8.4.rc4