diff options
author | Dr. David Alan Gilbert <dgilbert@redhat.com> | 2014-05-06 12:15:55 +0100 |
---|---|---|
committer | Michael Tokarev <mjt@tls.msk.ru> | 2014-05-24 00:44:12 +0400 |
commit | 5b9d313e3f820f50129887f0a59e88dc376a8b1a (patch) | |
tree | c01490729ee8020634a0487e837c85353af2a841 | |
parent | 8cd05ab65a92a592e771a0a1847c7e5505d9a024 (diff) |
vl: fix 'name' option to work with -readconfig
The 'name' option silently failed when used in config files
( http://lists.gnu.org/archive/html/qemu-devel/2014-04/msg00378.html )
-readconfig stores the configuration read in QemuOpts. Command line
option parsing should do the same, and no more. In particular it should
not act upon the option. That needs to be done separately, where both
command line and -readconfig settings are visible in QemuOpts.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reported-by: William Dauchy <william@gandi.net>
Tested-by: William Dauchy <william@gandi.net>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
(mjt: added commit message by ambru@ and subject prefix)
-rw-r--r-- | vl.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -965,7 +965,7 @@ static int parse_sandbox(QemuOpts *opts, void *opaque) return 0; } -static void parse_name(QemuOpts *opts) +static int parse_name(QemuOpts *opts, void *opaque) { const char *proc_name; @@ -978,6 +978,8 @@ static void parse_name(QemuOpts *opts) if (proc_name) { os_set_proc_name(proc_name); } + + return 0; } bool usb_enabled(bool default_usb) @@ -3796,7 +3798,6 @@ int main(int argc, char **argv, char **envp) if (!opts) { exit(1); } - parse_name(opts); break; case QEMU_OPTION_prom_env: if (nb_prom_envs >= MAX_PROM_ENVS) { @@ -3971,6 +3972,10 @@ int main(int argc, char **argv, char **envp) exit(1); } + if (qemu_opts_foreach(qemu_find_opts("name"), parse_name, NULL, 1)) { + exit(1); + } + #ifndef _WIN32 if (qemu_opts_foreach(qemu_find_opts("add-fd"), parse_add_fd, NULL, 1)) { exit(1); |