From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:56087) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TSoQy-0006x4-47 for qemu-devel@nongnu.org; Mon, 29 Oct 2012 08:27:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TSoQt-00028o-9F for qemu-devel@nongnu.org; Mon, 29 Oct 2012 08:27:12 -0400 Received: from isrv.corpit.ru ([86.62.121.231]:39912) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TSoQt-00027D-27 for qemu-devel@nongnu.org; Mon, 29 Oct 2012 08:27:07 -0400 Message-ID: <508E7612.9070306@msgid.tls.msk.ru> Date: Mon, 29 Oct 2012 16:26:58 +0400 From: Michael Tokarev MIME-Version: 1.0 References: <1351343715-7446-1-git-send-email-mjt@msgid.tls.msk.ru> <20121029091841.GD8917@stefanha-thinkpad.redhat.com> In-Reply-To: <20121029091841.GD8917@stefanha-thinkpad.redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] disallow -daemonize usage of stdio (curses display, -nographic, -serial stdio etc) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Blue Swirl , Peter Maydell , Hitoshi Mitake , qemu-devel@nongnu.org, Anthony Liguori 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