From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JKi1n-0002ci-Ig for qemu-devel@nongnu.org; Thu, 31 Jan 2008 17:37:03 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JKi1l-0002bB-HR for qemu-devel@nongnu.org; Thu, 31 Jan 2008 17:37:02 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JKi1l-0002b5-5P for qemu-devel@nongnu.org; Thu, 31 Jan 2008 17:37:01 -0500 Received: from e6.ny.us.ibm.com ([32.97.182.146]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JKi1k-0001vg-R1 for qemu-devel@nongnu.org; Thu, 31 Jan 2008 17:37:00 -0500 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e6.ny.us.ibm.com (8.13.8/8.13.8) with ESMTP id m0VMcjhw003638 for ; Thu, 31 Jan 2008 17:38:45 -0500 Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v8.7) with ESMTP id m0VMaqv7245386 for ; Thu, 31 Jan 2008 17:36:52 -0500 Received: from d01av01.pok.ibm.com (loopback [127.0.0.1]) by d01av01.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m0VMamIH029405 for ; Thu, 31 Jan 2008 17:36:52 -0500 From: Anthony Liguori Date: Thu, 31 Jan 2008 16:36:17 -0600 Message-Id: <1201818980-27534-4-git-send-email-aliguori@us.ibm.com> In-Reply-To: <1201818980-27534-1-git-send-email-aliguori@us.ibm.com> References: <1201818980-27534-1-git-send-email-aliguori@us.ibm.com> Subject: [Qemu-devel] [PATCH 3/6] Fix daemonize options Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kvm-devel@lists.sourceforge.net, Paul Brook The -daemonize option is too restrictive when using with SDL. It also switches the working directory to / too early which causes block devices with a relative path to fail. The -daemonize option is needed for my regression testing so I've included this patch in the series. Index: qemu/vl.c =================================================================== --- qemu.orig/vl.c 2008-01-30 13:47:37.000000000 -0600 +++ qemu/vl.c 2008-01-30 13:47:39.000000000 -0600 @@ -8766,11 +8766,6 @@ } #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; @@ -8808,7 +8803,6 @@ exit(1); umask(027); - chdir("/"); signal(SIGTSTP, SIG_IGN); signal(SIGTTOU, SIG_IGN); @@ -9067,6 +9061,7 @@ if (len != 1) exit(1); + chdir("/"); TFR(fd = open("/dev/null", O_RDWR)); if (fd == -1) exit(1);