diff options
author | Hanna Reitz <hreitz@redhat.com> | 2022-03-03 17:48:11 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2022-03-04 18:14:40 +0100 |
commit | f22ac4727bfbdd7d54348b8bc6d307e94ad425f8 (patch) | |
tree | e18f56c03a03e897180b6e46a24ba68f9aebf14a /include/sysemu/os-posix.h | |
parent | d5d2b15ecf62c662985983ca065ddeeec48fd248 (diff) | |
download | qemu-f22ac4727bfbdd7d54348b8bc6d307e94ad425f8.zip qemu-f22ac4727bfbdd7d54348b8bc6d307e94ad425f8.tar.gz qemu-f22ac4727bfbdd7d54348b8bc6d307e94ad425f8.tar.bz2 |
os-posix: Add os_set_daemonize()
The daemonizing functions in os-posix (os_daemonize() and
os_setup_post()) only daemonize the process if the static `daemonize`
variable is set. Right now, it can only be set by os_parse_cmd_args().
In order to use os_daemonize() and os_setup_post() from the storage
daemon to have it be daemonized, we need some other way to set this
`daemonize` variable, because I would rather not tap into the system
emulator's arg-parsing code. Therefore, this patch adds an
os_set_daemonize() function, which will return an error on os-win32
(because daemonizing is not supported there).
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220303164814.284974-2-hreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'include/sysemu/os-posix.h')
-rw-r--r-- | include/sysemu/os-posix.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/sysemu/os-posix.h b/include/sysemu/os-posix.h index 2edf336..dd64fb4 100644 --- a/include/sysemu/os-posix.h +++ b/include/sysemu/os-posix.h @@ -55,6 +55,7 @@ int os_mlock(void); typedef struct timeval qemu_timeval; #define qemu_gettimeofday(tp) gettimeofday(tp, NULL) +int os_set_daemonize(bool d); bool is_daemonized(void); /** |