qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v3 4/6] qemu-option: support +foo/-foo command line


From: Alexey Kardashevskiy
Subject: [Qemu-devel] [PATCH v3 4/6] qemu-option: support +foo/-foo command line agruments
Date: Mon, 11 Nov 2013 18:44:33 +1100

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 <address@hidden>
---
 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]