qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] stop using stdio for monitor/serial/etc with -d


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH] stop using stdio for monitor/serial/etc with -daemonize
Date: Tue, 25 Sep 2012 12:23:09 +0100

On 25 September 2012 11:43, Michael Tokarev <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]