[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 31/35] qsd: Do not use error_report() before monitor_init
From: |
Hanna Reitz |
Subject: |
[PULL 31/35] qsd: Do not use error_report() before monitor_init |
Date: |
Tue, 12 Jul 2022 20:06:13 +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 | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
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;
--
2.35.3
- [PULL 16/35] block: Make 'bytes' param of blk_{pread, pwrite}() an int64_t, (continued)
- [PULL 16/35] block: Make 'bytes' param of blk_{pread, pwrite}() an int64_t, Hanna Reitz, 2022/07/12
- [PULL 13/35] block: Make blk_{pread,pwrite}() return 0 on success, Hanna Reitz, 2022/07/12
- [PULL 11/35] tests/qemu-iotests: hotfix for 307, 223 output, Hanna Reitz, 2022/07/12
- [PULL 24/35] block: Implement blk_pwrite_zeroes() using generated_co_wrapper, Hanna Reitz, 2022/07/12
- [PULL 25/35] block: Implement blk_pdiscard() using generated_co_wrapper, Hanna Reitz, 2022/07/12
- [PULL 15/35] block: Change blk_{pread,pwrite}() param order, Hanna Reitz, 2022/07/12
- [PULL 14/35] block: Add a 'flags' param to blk_pread(), Hanna Reitz, 2022/07/12
- [PULL 17/35] block: Make blk_co_pwrite() take a const buffer, Hanna Reitz, 2022/07/12
- [PULL 28/35] block: Add blk_co_truncate(), Hanna Reitz, 2022/07/12
- [PULL 19/35] block: Add blk_{preadv,pwritev}(), Hanna Reitz, 2022/07/12
- [PULL 31/35] qsd: Do not use error_report() before monitor_init,
Hanna Reitz <=
- [PULL 20/35] block: Add blk_[co_]preadv_part(), Hanna Reitz, 2022/07/12
- [PULL 22/35] block: Change blk_pwrite_compressed() param order, Hanna Reitz, 2022/07/12
- [PULL 21/35] block: Export blk_pwritev_part() in block-backend-io.h, Hanna Reitz, 2022/07/12
- [PULL 18/35] block: Implement blk_{pread, pwrite}() using generated_co_wrapper, Hanna Reitz, 2022/07/12
- [PULL 26/35] block: Implement blk_flush() using generated_co_wrapper, Hanna Reitz, 2022/07/12
- [PULL 27/35] block: Add blk_co_ioctl(), Hanna Reitz, 2022/07/12
- [PULL 30/35] block: Remove remaining unused symbols in coroutines.h, Hanna Reitz, 2022/07/12
- [PULL 23/35] block: Add blk_co_pwrite_compressed(), Hanna Reitz, 2022/07/12
- [PULL 29/35] block: Reorganize some declarations in block-backend-io.h, Hanna Reitz, 2022/07/12
- [PULL 32/35] iotests/297: Have mypy ignore unused ignores, Hanna Reitz, 2022/07/12