]> git.proxmox.com Git - mirror_qemu.git/commitdiff
qsd: Do not use error_report() before monitor_init
authorHanna Reitz <hreitz@redhat.com>
Thu, 9 Jun 2022 12:28:52 +0000 (14:28 +0200)
committerHanna Reitz <hreitz@redhat.com>
Tue, 12 Jul 2022 11:54:44 +0000 (13:54 +0200)
error_report() only works once monitor_init_globals_core() has been
called, which is not the case when parsing the --daemonize option.  Use
fprintf(stderr, ...) instead.

Fixes: 2525edd85fec53e23fda98974a15e3b3c8957596 ("qsd: Add --daemonize")
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220609122852.21140-1-hreitz@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
storage-daemon/qemu-storage-daemon.c

index b8e910f2208f5f55364737b76a36d1f3a6844622..448c318e23a7d2861f71676a670e084073e73d16 100644 (file)
@@ -296,7 +296,11 @@ static void process_options(int argc, char *argv[], bool pre_init_pass)
             }
         case OPTION_DAEMONIZE:
             if (os_set_daemonize(true) < 0) {
-                error_report("--daemonize not supported in this build");
+                /*
+                 * --daemonize is parsed before monitor_init_globals_core(), so
+                 * error_report() does not work yet
+                 */
+                fprintf(stderr, "--daemonize not supported in this build\n");
                 exit(EXIT_FAILURE);
             }
             break;