qemu-option: Move the implied first name into QemuOptsList

We sometimes permit omitting the first option name, for example
-device foo is short for -device driver=foo.  The name to use
("driver" in the example) is passed as argument to qemu_opts_parse().
For each QemuOptsList, we use at most one such name.

Move the name into QemuOptsList, and pass whether to permit the
abbreviation.  This ensures continued consistency, and simplifies the
commit after next in this series.
This commit is contained in:
Markus Armbruster 2010-02-10 19:52:18 +01:00
parent 01e7f18869
commit 8212c64f0e
8 changed files with 24 additions and 13 deletions

4
net.c
View file

@ -1159,7 +1159,7 @@ void net_host_device_add(Monitor *mon, const QDict *qdict)
return;
}
opts = qemu_opts_parse(&qemu_net_opts, opts_str ? opts_str : "", NULL);
opts = qemu_opts_parse(&qemu_net_opts, opts_str ? opts_str : "", 0);
if (!opts) {
monitor_printf(mon, "parsing network options '%s' failed\n",
opts_str ? opts_str : "");
@ -1364,7 +1364,7 @@ int net_client_parse(QemuOptsList *opts_list, const char *optarg)
}
#endif
if (!qemu_opts_parse(opts_list, optarg, "type")) {
if (!qemu_opts_parse(opts_list, optarg, 1)) {
return -1;
}