From: Michael Tokarev <mjt@tls.msk.ru>
To: Blue Swirl <blauwirbel@gmail.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
Hitoshi Mitake <h.mitake@gmail.com>,
qemu-devel@nongnu.org, Anthony Liguori <anthony@codemonkey.ws>,
Stefan Hajnoczi <stefanha@gmail.com>
Subject: Re: [Qemu-devel] [PATCH v2] stop using stdio for monitor/serial/etc with -daemonize
Date: Sat, 27 Oct 2012 17:11:41 +0400 [thread overview]
Message-ID: <508BDD8D.60402@msgid.tls.msk.ru> (raw)
In-Reply-To: <508BD9CA.2050508@msgid.tls.msk.ru>
On 27.10.2012 16:55, Michael Tokarev wrote:
> On 27.10.2012 16:48, Blue Swirl wrote:
> []
>>> I'd rather have -nographic work with -daemonize, since the
>>> alternative - shown in the patch comment - is rather long and
>>> it is easy to forget to "nullify" some option, while -nographic
>>> can do that easy and it is convinient, but if people dislikes
>>> such natural and easy-for-the-user solutions, I wont insist.
>>
>> Instead of checking just for -nographic or -curses, can we forbid use
>> of any stdio chardev?
>
> I think that'll be quite a bit more difficult. Sure, say,
>
> -serial stdio -daemonize
>
> now has the same problem as original
>
> -nographic -daemonize.
>
> It is just now after you mentioned it I realized this omission.
> And it is exactly the same thing actually - we initialize
> stdio for the serial port, in both cases, and it switches
> the tty to raw mode.
>
> So this patch is insufficient indeed, we still have the
> same issue, and once -nographic -daemonize is disallowed,
> we've much better chances to hit this issue using -serial.
> Oh well.
>
> Hmm. Maybe init stdio chardev for something "else" in case
> of -nographic?
This, together with my previous patch, appears to work fine:
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -772,6 +772,10 @@ static CharDriverState *qemu_chr_open_stdio(QemuOpts *opts)
if (stdio_nb_clients >= STDIO_MAX_CLIENTS) {
return NULL;
}
+ if (is_daemonized()) {
+ error_report("cannot use stdio with -daemonize");
+ return NULL;
+ }
if (stdio_nb_clients == 0) {
old_fd0_flags = fcntl(0, F_GETFL);
tcgetattr (0, &oldtty);
(there's no need to add this to windows version, since
we don't daemonize on windows).
Thanks,
/mjt
prev parent reply other threads:[~2012-10-27 13:11 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-25 14:48 [Qemu-devel] [PATCH v2] stop using stdio for monitor/serial/etc with -daemonize Michael Tokarev
2012-09-25 21:19 ` Anthony Liguori
2012-09-26 7:09 ` Michael Tokarev
2012-09-26 8:00 ` Peter Maydell
2012-09-26 8:17 ` Michael Tokarev
2012-09-26 8:43 ` Peter Maydell
2012-09-26 13:46 ` Anthony Liguori
2012-09-26 14:56 ` Michael Tokarev
2012-10-27 11:23 ` Michael Tokarev
2012-10-27 11:33 ` Peter Maydell
2012-10-27 12:15 ` Michael Tokarev
2012-10-27 12:48 ` Blue Swirl
2012-10-27 12:55 ` Michael Tokarev
2012-10-27 13:11 ` Michael Tokarev [this message]
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=508BDD8D.60402@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.