aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2013-08-29 11:15:44 +0200
committerKevin Wolf <kwolf@redhat.com>2013-08-30 15:28:52 +0200
commitd4ca092a423f1f853a99357bab01a168bb57d625 (patch)
treea7288be03b54437a5674ef84cf4ffa221b59fcfb /util
parent9faa574f7d07109e2256c0b4b63e8711d650f2d8 (diff)
option: Add assigned flag to QEMUOptionParameter
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> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'util')
-rw-r--r--util/qemu-option.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/util/qemu-option.c b/util/qemu-option.c
index 4ebdc4c33c..e0844a966c 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