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: Michael Tokarev
Subject: Re: [Qemu-devel] [PATCH] stop using stdio for monitor/serial/etc with -daemonize
Date: Tue, 25 Sep 2012 15:53:23 +0400
User-agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:10.0.6esrpre) Gecko/20120817 Icedove/10.0.6

On 25.09.2012 15:23, Peter Maydell wrote:
> 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 :-)

That's the original code.  N/p, can add braces.  It will make the
code unnecessary bigger but who cares.

>> -                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?

Actually it is a typo -- I corrected it in my working tree but forgot
to commit before git-format-patch.

> 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?

I think it can be, yes.  Will try again :)

/mjt



reply via email to

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