diff options
author | Markus Armbruster <armbru@redhat.com> | 2010-02-10 19:52:18 +0100 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2010-03-16 17:45:34 +0100 |
commit | 8212c64f0e1b32300b7ec4e79885a0caf6f521a6 (patch) | |
tree | 2faf279be4942f2c30b535f508cf51ee88a82844 /vl.c | |
parent | 01e7f18869c9ee4c84793f4a39ec1f5f4128a0aa (diff) |
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.
Diffstat (limited to 'vl.c')
-rw-r--r-- | vl.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -1813,7 +1813,7 @@ QemuOpts *drive_add(const char *file, const char *fmt, ...) vsnprintf(optstr, sizeof(optstr), fmt, ap); va_end(ap); - opts = qemu_opts_parse(&qemu_drive_opts, optstr, NULL); + opts = qemu_opts_parse(&qemu_drive_opts, optstr, 0); if (!opts) { fprintf(stderr, "%s: huh? duplicate? (%s)\n", __FUNCTION__, optstr); @@ -4370,7 +4370,7 @@ static int balloon_parse(const char *arg) if (!strncmp(arg, "virtio", 6)) { if (arg[6] == ',') { /* have params -> parse them */ - opts = qemu_opts_parse(&qemu_device_opts, arg+7, NULL); + opts = qemu_opts_parse(&qemu_device_opts, arg+7, 0); if (!opts) return -1; } else { @@ -5365,7 +5365,7 @@ int main(int argc, char **argv, char **envp) default_monitor = 0; break; case QEMU_OPTION_mon: - opts = qemu_opts_parse(&qemu_mon_opts, optarg, "chardev"); + opts = qemu_opts_parse(&qemu_mon_opts, optarg, 1); if (!opts) { fprintf(stderr, "parse error: %s\n", optarg); exit(1); @@ -5373,7 +5373,7 @@ int main(int argc, char **argv, char **envp) default_monitor = 0; break; case QEMU_OPTION_chardev: - opts = qemu_opts_parse(&qemu_chardev_opts, optarg, "backend"); + opts = qemu_opts_parse(&qemu_chardev_opts, optarg, 1); if (!opts) { fprintf(stderr, "parse error: %s\n", optarg); exit(1); @@ -5467,7 +5467,7 @@ int main(int argc, char **argv, char **envp) add_device_config(DEV_USB, optarg); break; case QEMU_OPTION_device: - if (!qemu_opts_parse(&qemu_device_opts, optarg, "driver")) { + if (!qemu_opts_parse(&qemu_device_opts, optarg, 1)) { exit(1); } break; @@ -5576,7 +5576,7 @@ int main(int argc, char **argv, char **envp) configure_rtc_date_offset(optarg, 1); break; case QEMU_OPTION_rtc: - opts = qemu_opts_parse(&qemu_rtc_opts, optarg, NULL); + opts = qemu_opts_parse(&qemu_rtc_opts, optarg, 0); if (!opts) { fprintf(stderr, "parse error: %s\n", optarg); exit(1); |