Received: from eggs.gnu.org ([2001:4830:134:3::10]:51515) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WopmW-0004cX-7j for qemu-devel@nongnu.org; Mon, 26 May 2014 03:57:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WopmS-0001XN-28 for qemu-devel@nongnu.org; Mon, 26 May 2014 03:57:16 -0400 From: Michael Tokarev Date: Mon, 26 May 2014 11:20:00 +0400 Message-Id: <1401088811-22923-13-git-send-email-mjt@msgid.tls.msk.ru> In-Reply-To: <1401088811-22923-1-git-send-email-mjt@msgid.tls.msk.ru> References: <1401088811-22923-1-git-send-email-mjt@msgid.tls.msk.ru> Subject: [Qemu-devel] [PULL 12/23] vl: fix 'name' option to work with -readconfig List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, Michael Tokarev , "Dr. David Alan Gilbert" From: "Dr. David Alan Gilbert" 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 Reported-by: William Dauchy Tested-by: William Dauchy Reviewed-by: Markus Armbruster Signed-off-by: Michael Tokarev (mjt: added commit message by ambru@ and subject prefix) --- vl.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/vl.c b/vl.c index 709d8cd..99b6fc0 100644 --- a/vl.c +++ b/vl.c @@ -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); -- 1.7.10.4