qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <aliguori@us.ibm.com>
To: qemu-devel@nongnu.org
Cc: Anthony Liguori <aliguori@us.ibm.com>
Subject: [Qemu-devel] [PATCH 3/3] Fix -daemonize option
Date: Tue, 22 Jul 2008 15:51:43 -0500	[thread overview]
Message-ID: <1216759903-21779-3-git-send-email-aliguori@us.ibm.com> (raw)
In-Reply-To: <1216759903-21779-1-git-send-email-aliguori@us.ibm.com>

When using -daemonize, we want to avoid chdir() until after we've opened the
block devices.  It's also perfectly fine to use -dameonize along with SDL.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

diff --git a/vl.c b/vl.c
index f057a5e..d94ebb1 100644
--- a/vl.c
+++ b/vl.c
@@ -8626,11 +8626,6 @@ int main(int argc, char **argv)
     }
 
 #ifndef _WIN32
-    if (daemonize && !nographic && vnc_display == NULL) {
-	fprintf(stderr, "Can only daemonize if using -nographic or -vnc\n");
-	daemonize = 0;
-    }
-
     if (daemonize) {
 	pid_t pid;
 
@@ -8668,7 +8663,6 @@ int main(int argc, char **argv)
 	    exit(1);
 
 	umask(027);
-	chdir("/");
 
         signal(SIGTSTP, SIG_IGN);
         signal(SIGTTOU, SIG_IGN);
@@ -8974,6 +8968,7 @@ int main(int argc, char **argv)
 	if (len != 1)
 	    exit(1);
 
+	chdir("/");
 	TFR(fd = open("/dev/null", O_RDWR));
 	if (fd == -1)
 	    exit(1);

  parent reply	other threads:[~2008-07-22 20:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-22 20:51 [Qemu-devel] [PATCH 1/3] Fix SDL problems with BGR displays Anthony Liguori
2008-07-22 20:51 ` [Qemu-devel] [PATCH 2/3] Fix task register type after reset Anthony Liguori
2008-07-22 20:51 ` Anthony Liguori [this message]
2008-07-22 21:25 ` [Qemu-devel] [PATCH 1/3] Fix SDL problems with BGR displays Andreas Färber
2008-07-22 22:10   ` Anthony Liguori
2008-07-23  7:39     ` Blue Swirl
2008-07-23 13:21       ` Anthony Liguori
2008-07-23 15:19       ` Blue Swirl
2008-07-23 15:22         ` Anthony Liguori

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=1216759903-21779-3-git-send-email-aliguori@us.ibm.com \
    --to=aliguori@us.ibm.com \
    --cc=qemu-devel@nongnu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).