* [Qemu-devel] [PATCH] option: Add assigned flag to QEMUOptionParameter
@ 2013-08-29 9:15 Max Reitz
2013-08-29 12:47 ` Kevin Wolf
0 siblings, 1 reply; 2+ messages in thread
From: Max Reitz @ 2013-08-29 9:15 UTC (permalink / raw)
To: qemu-devel; +Cc: Kevin Wolf, Stefan Hajnoczi, Max Reitz
Adds an "assigned" flag to QEMUOptionParameter which is cleared at the
beginning of parse_option_parameters and set on (successful)
set_option_parameter and set_option_parameter_int.
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
include/qemu/option.h | 1 +
util/qemu-option.c | 9 +++++++++
2 files changed, 10 insertions(+)
diff --git a/include/qemu/option.h b/include/qemu/option.h
index 7a58e47..63db4cc 100644
--- a/include/qemu/option.h
+++ b/include/qemu/option.h
@@ -46,6 +46,7 @@ typedef struct QEMUOptionParameter {
char* s;
} value;
const char *help;
+ bool assigned;
} QEMUOptionParameter;
diff --git a/util/qemu-option.c b/util/qemu-option.c
index 4ebdc4c..e0844a9 100644
--- a/util/qemu-option.c
+++ b/util/qemu-option.c
@@ -275,6 +275,8 @@ int set_option_parameter(QEMUOptionParameter *list, const char *name,
return -1;
}
+ list->assigned = true;
+
return 0;
}
@@ -306,6 +308,8 @@ int set_option_parameter_int(QEMUOptionParameter *list, const char *name,
return -1;
}
+ list->assigned = true;
+
return 0;
}
@@ -397,6 +401,7 @@ QEMUOptionParameter *parse_option_parameters(const char *param,
char value[256];
char *param_delim, *value_delim;
char next_delim;
+ int i;
if (list == NULL) {
return NULL;
@@ -406,6 +411,10 @@ QEMUOptionParameter *parse_option_parameters(const char *param,
dest = allocated = append_option_parameters(NULL, list);
}
+ for (i = 0; dest[i].name; i++) {
+ dest[i].assigned = false;
+ }
+
while (*param) {
// Find parameter name and value in the string
--
1.8.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] option: Add assigned flag to QEMUOptionParameter
2013-08-29 9:15 [Qemu-devel] [PATCH] option: Add assigned flag to QEMUOptionParameter Max Reitz
@ 2013-08-29 12:47 ` Kevin Wolf
0 siblings, 0 replies; 2+ messages in thread
From: Kevin Wolf @ 2013-08-29 12:47 UTC (permalink / raw)
To: Max Reitz; +Cc: qemu-devel, Stefan Hajnoczi
Am 29.08.2013 um 11:15 hat Max Reitz geschrieben:
> Adds an "assigned" flag to QEMUOptionParameter which is cleared at the
> beginning of parse_option_parameters and set on (successful)
> set_option_parameter and set_option_parameter_int.
>
> Signed-off-by: Max Reitz <mreitz@redhat.com>
Thanks, applied to the block branch.
Kevin
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-08-29 12:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-29 9:15 [Qemu-devel] [PATCH] option: Add assigned flag to QEMUOptionParameter Max Reitz
2013-08-29 12:47 ` Kevin Wolf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).