All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Tokarev <mjt@tls.msk.ru>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: Blue Swirl <blauwirbel@gmail.com>,
	Peter Maydell <peter.maydell@linaro.org>,
	Hitoshi Mitake <h.mitake@gmail.com>,
	qemu-devel@nongnu.org, Anthony Liguori <anthony@codemonkey.ws>
Subject: Re: [Qemu-devel] [PATCH] disallow -daemonize usage of stdio (curses display, -nographic, -serial stdio etc)
Date: Mon, 29 Oct 2012 16:26:58 +0400	[thread overview]
Message-ID: <508E7612.9070306@msgid.tls.msk.ru> (raw)
In-Reply-To: <20121029091841.GD8917@stefanha-thinkpad.redhat.com>

29.10.2012 13:18, Stefan Hajnoczi wrote:
> On Sat, Oct 27, 2012 at 05:15:15PM +0400, Michael Tokarev wrote:
>> diff --git a/vl.c b/vl.c
>> index 9f99ef4..db48d62 100644
>> --- a/vl.c
>> +++ b/vl.c
>> @@ -3413,6 +3413,26 @@ int main(int argc, char **argv, char **envp)
>>          default_sdcard = 0;
>>      }
>>  
>> +    if (is_daemonized()) {
>> +        /* According to documentation and historically, -nographic redirects
>> +         * serial port, parallel port and monitor to stdio, which does not work
>> +         * with -daemonize.  We can redirect these to null instead, but since
>> +         * -nographic is legacy, let's just error out.
>> +         */
>> +        if (display_type == DT_NOGRAPHIC
>> +            /* && (default_parallel || default_serial
>> +                || default_monitor || default_virtcon) */) {
> 
> Uncomment these?

I'd say treat it as a documentation comment, sort of.
If all 4 other options are specified, -nographics has
no effect, so this very case is not very interesting --
once you specify all 4, you don't need -nographic.
But keeping this special case around makes behavour
less consistent: -nographic starts sometimes working
and sometimes not.

Now when it isn't possible to use stdio chr backend
with -daemonize, it isn't really necessary to test
even for DT_NOGRAPHIC: if we wont, next we'll try
to create stdio backend which will fail.  The only
purpose for this test is to give more understandable
error message.

(Checking for DT_CURSES is still necessary).

Thanks,

/mjt

  reply	other threads:[~2012-10-29 12:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-27 13:15 [Qemu-devel] [PATCH] disallow -daemonize usage of stdio (curses display, -nographic, -serial stdio etc) Michael Tokarev
2012-10-29  9:18 ` Stefan Hajnoczi
2012-10-29 12:26   ` Michael Tokarev [this message]
2012-10-31  8:12     ` Stefan Hajnoczi

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=508E7612.9070306@msgid.tls.msk.ru \
    --to=mjt@tls.msk.ru \
    --cc=anthony@codemonkey.ws \
    --cc=blauwirbel@gmail.com \
    --cc=h.mitake@gmail.com \
    --cc=peter.maydell@linaro.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.