qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 4/6] Fix daemonize options (v2)


From: Anthony Liguori
Subject: [Qemu-devel] [PATCH 4/6] Fix daemonize options (v2)
Date: Fri, 1 Feb 2008 16:11:59 -0600

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);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]