[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 16/26] option: Add assigned flag to QEMUOptionParamet
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 16/26] option: Add assigned flag to QEMUOptionParameter |
Date: |
Fri, 30 Aug 2013 16:30:41 +0200 |
From: Max Reitz <address@hidden>
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 <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
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.1.4
- [Qemu-devel] [PULL 02/26] block: Remove redundant assertion, (continued)
- [Qemu-devel] [PULL 02/26] block: Remove redundant assertion, Kevin Wolf, 2013/08/30
- [Qemu-devel] [PULL 05/26] qemu-iotests: Update reference output for 051, Kevin Wolf, 2013/08/30
- [Qemu-devel] [PULL 07/26] add skeleton for BSD licensed "raw" BlockDriver, Kevin Wolf, 2013/08/30
- [Qemu-devel] [PULL 08/26] raw_bsd: emit debug events in bdrv_co_readv() and bdrv_co_writev(), Kevin Wolf, 2013/08/30
- [Qemu-devel] [PULL 09/26] raw_bsd: add raw_create(), Kevin Wolf, 2013/08/30
- [Qemu-devel] [PULL 10/26] raw_bsd: introduce "special members", Kevin Wolf, 2013/08/30
- [Qemu-devel] [PULL 11/26] raw_bsd: add raw_create_options, Kevin Wolf, 2013/08/30
- [Qemu-devel] [PULL 12/26] raw_bsd: register bdrv_raw, Kevin Wolf, 2013/08/30
- [Qemu-devel] [PULL 13/26] switch raw block driver from "raw.o" to "raw_bsd.o", Kevin Wolf, 2013/08/30
- [Qemu-devel] [PULL 14/26] block: Remove old raw driver, Kevin Wolf, 2013/08/30
- [Qemu-devel] [PULL 16/26] option: Add assigned flag to QEMUOptionParameter,
Kevin Wolf <=
- [Qemu-devel] [PULL 18/26] qemu-iotests: Snapshotting zero clusters, Kevin Wolf, 2013/08/30
- [Qemu-devel] [PULL 15/26] gluster: Abort on AIO completion failure, Kevin Wolf, 2013/08/30
- [Qemu-devel] [PULL 17/26] qcow2-refcount: Snapshot update for zero clusters, Kevin Wolf, 2013/08/30
- [Qemu-devel] [PULL 20/26] qcow2: Metadata overlap checks, Kevin Wolf, 2013/08/30
- [Qemu-devel] [PULL 19/26] qcow2: Add corrupt bit, Kevin Wolf, 2013/08/30
- [Qemu-devel] [PULL 22/26] qcow2-refcount: Move OFLAG_COPIED checks, Kevin Wolf, 2013/08/30
- [Qemu-devel] [PULL 21/26] qcow2: Employ metadata overlap checks, Kevin Wolf, 2013/08/30
- [Qemu-devel] [PULL 23/26] qcow2-refcount: Repair OFLAG_COPIED errors, Kevin Wolf, 2013/08/30
- [Qemu-devel] [PULL 24/26] qcow2-refcount: Repair shared refcount blocks, Kevin Wolf, 2013/08/30
- [Qemu-devel] [PULL 25/26] qcow2_check: Mark image consistent, Kevin Wolf, 2013/08/30