From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JL47p-0008Tz-To for qemu-devel@nongnu.org; Fri, 01 Feb 2008 17:12:46 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JL47l-0008Qv-F9 for qemu-devel@nongnu.org; Fri, 01 Feb 2008 17:12:43 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JL47j-0008Pb-Rb for qemu-devel@nongnu.org; Fri, 01 Feb 2008 17:12:39 -0500 Received: from e32.co.us.ibm.com ([32.97.110.150]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JL47j-0002fg-Bf for qemu-devel@nongnu.org; Fri, 01 Feb 2008 17:12:39 -0500 Received: from d03relay02.boulder.ibm.com (d03relay02.boulder.ibm.com [9.17.195.227]) by e32.co.us.ibm.com (8.13.8/8.13.8) with ESMTP id m11L91Kl027570 for ; Fri, 1 Feb 2008 16:09:01 -0500 Received: from d03av04.boulder.ibm.com (d03av04.boulder.ibm.com [9.17.195.170]) by d03relay02.boulder.ibm.com (8.13.8/8.13.8/NCO v8.7) with ESMTP id m11MCWIs021462 for ; Fri, 1 Feb 2008 15:12:32 -0700 Received: from d03av04.boulder.ibm.com (loopback [127.0.0.1]) by d03av04.boulder.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m11MCWke022640 for ; Fri, 1 Feb 2008 15:12:32 -0700 From: Anthony Liguori Date: Fri, 1 Feb 2008 16:11:59 -0600 Message-Id: <1201903921-1125-5-git-send-email-aliguori@us.ibm.com> In-Reply-To: <1201903921-1125-1-git-send-email-aliguori@us.ibm.com> References: <1201903921-1125-1-git-send-email-aliguori@us.ibm.com> Subject: [Qemu-devel] [PATCH 4/6] Fix daemonize options (v2) 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. This patch hasn't changed since v1. Index: qemu/vl.c =================================================================== --- qemu.orig/vl.c 2008-02-01 11:53:42.000000000 -0600 +++ qemu/vl.c 2008-02-01 11:53:44.000000000 -0600 @@ -8779,11 +8779,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; @@ -8821,7 +8816,6 @@ exit(1); umask(027); - chdir("/"); signal(SIGTSTP, SIG_IGN); signal(SIGTTOU, SIG_IGN); @@ -9087,6 +9081,7 @@ if (len != 1) exit(1); + chdir("/"); TFR(fd = open("/dev/null", O_RDWR)); if (fd == -1) exit(1);