aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2012-01-27 19:55:43 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2012-02-01 14:45:01 -0600
commit25de59350606772a4df479f0f49721281091ec56 (patch)
tree7ecf82e46090bcb027df4e440f46991a14688a28
parent433acf0daceb12afd9680bcbc668002f9b274ad2 (diff)
Improve default machine options usability
So far we overwrite the machine options completely with defaults if no accel=value is provided. More user friendly is to fill in only unspecified options. The new qemu_opts_set_defaults enables this. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
-rw-r--r--vl.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/vl.c b/vl.c
index 6af0f83ae5..138f6bc1ef 100644
--- a/vl.c
+++ b/vl.c
@@ -3153,21 +3153,8 @@ int main(int argc, char **argv, char **envp)
* specified either by the configuration file or by the command line.
*/
if (machine->default_machine_opts) {
- QemuOptsList *list = qemu_find_opts("machine");
- const char *p = NULL;
-
- if (!QTAILQ_EMPTY(&list->head)) {
- p = qemu_opt_get(QTAILQ_FIRST(&list->head), "accel");
- }
- if (p == NULL) {
- qemu_opts_reset(list);
- opts = qemu_opts_parse(list, machine->default_machine_opts, 0);
- if (!opts) {
- fprintf(stderr, "parse error for machine %s: %s\n",
- machine->name, machine->default_machine_opts);
- exit(1);
- }
- }
+ qemu_opts_set_defaults(qemu_find_opts("machine"),
+ machine->default_machine_opts, 0);
}
qemu_opts_foreach(qemu_find_opts("device"), default_driver_check, NULL, 0);