From: Peter Maydell <peter.maydell@linaro.org>
To: Michael Tokarev <mjt@tls.msk.ru>
Cc: Stefan Hajnoczi <stefanha@gmail.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] stop using stdio for monitor/serial/etc with -daemonize
Date: Tue, 25 Sep 2012 12:23:09 +0100 [thread overview]
Message-ID: <CAFEAcA9+FfcUk7e2MS6cmY3sb7KmMtwJ5zEZSCuncfSBue2sjA@mail.gmail.com> (raw)
In-Reply-To: <1348569817-11178-1-git-send-email-mjt@msgid.tls.msk.ru>
On 25 September 2012 11:43, Michael Tokarev <mjt@tls.msk.ru> wrote:
> --- a/vl.c
> +++ b/vl.c
> @@ -3395,17 +3395,26 @@ int main(int argc, char **argv, char **envp)
> if (display_type == DT_NOGRAPHIC) {
> if (default_parallel)
> add_device_config(DEV_PARALLEL, "null");
> - if (default_serial && default_monitor) {
> - add_device_config(DEV_SERIAL, "mon:stdio");
> - } else if (default_virtcon && default_monitor) {
> - add_device_config(DEV_VIRTCON, "mon:stdio");
> + if (!is_daemonized()) {
> + if (default_serial && default_monitor) {
> + add_device_config(DEV_SERIAL, "mon:stdio");
> + } else if (default_virtcon && default_monitor) {
> + add_device_config(DEV_VIRTCON, "mon:stdio");
> + } else {
> + if (default_serial)
> + add_device_config(DEV_SERIAL, "stdio");
> + if (default_virtcon)
> + add_device_config(DEV_VIRTCON, "stdio");
> + if (default_monitor)
> + monitor_parse("stdio", "readline");
> + }
Braces :-)
> } else {
> if (default_serial)
> - add_device_config(DEV_SERIAL, "stdio");
> + add_device_config(DEV_SERIAL, "null");
> if (default_virtcon)
> - add_device_config(DEV_VIRTCON, "stdio");
> + add_device_config(DEV_VIRTCON, "null");
> if (default_monitor)
> - monitor_parse("stdio", "readline");
> + monitor_parse("stdio", "null");
monitor_parse()'s second argument is the mode, which I think can
only be "readline" or "control" -- should this be "null", "readline"
instead?
Would it be possible to condense this chain of ifs down a bit
by having a variable which gets appropriately set to
"stdio", "null" or "vc:80Cx24C" and then used in a single
set of add_device_config() calls?
-- PMM
next prev parent reply other threads:[~2012-09-25 11:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-25 10:43 [Qemu-devel] [PATCH] stop using stdio for monitor/serial/etc with -daemonize Michael Tokarev
2012-09-25 11:23 ` Peter Maydell [this message]
2012-09-25 11:53 ` Michael Tokarev
2012-09-25 13:49 ` Michael Tokarev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAFEAcA9+FfcUk7e2MS6cmY3sb7KmMtwJ5zEZSCuncfSBue2sjA@mail.gmail.com \
--to=peter.maydell@linaro.org \
--cc=mjt@tls.msk.ru \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).