summaryrefslogtreecommitdiffstats
path: root/storage-daemon
diff options
context:
space:
mode:
authorHanna Reitz2022-06-09 14:28:52 +0200
committerHanna Reitz2022-07-12 13:54:44 +0200
commit1a8fd0e3e73806a5eca3384d49503e6bc50ca20d (patch)
tree423c1315df4d0243fe294e7e393ca3b85c3876f6 /storage-daemon
parentblock: Remove remaining unused symbols in coroutines.h (diff)
downloadqemu-1a8fd0e3e73806a5eca3384d49503e6bc50ca20d.tar.gz
qemu-1a8fd0e3e73806a5eca3384d49503e6bc50ca20d.tar.xz
qemu-1a8fd0e3e73806a5eca3384d49503e6bc50ca20d.zip
qsd: Do not use error_report() before monitor_init
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>
Diffstat (limited to 'storage-daemon')
-rw-r--r--storage-daemon/qemu-storage-daemon.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/storage-daemon/qemu-storage-daemon.c b/storage-daemon/qemu-storage-daemon.c
index b8e910f220..448c318e23 100644
--- a/storage-daemon/qemu-storage-daemon.c
+++ b/storage-daemon/qemu-storage-daemon.c
@@ -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;