mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
src: Detect close_range syscall during virGlobalInit()
The whole purpose of virCloseRangeInit() is to be called somewhere during initialization (ideally before first virExec() or virCommandRun()), so that the rest of the code already knows kernel capabilities. While I can put the call somewhere into remote_daemon.c (when a daemon initializes), we might call virCommand*() even from client library (i.e. no daemon). Therefore, put it into virGlobalInit() with the rest of initialization code. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
This commit is contained in:
parent
520eb3e15b
commit
15ce9e888b
@ -231,6 +231,10 @@ virGlobalInit(void)
|
||||
goto error;
|
||||
}
|
||||
|
||||
/* Do this upfront rather than every time a child is spawned. */
|
||||
if (virCloseRangeInit() < 0)
|
||||
goto error;
|
||||
|
||||
if (virLogSetFromEnv() < 0)
|
||||
goto error;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user