mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-30 09:53:10 +00:00
f344005547
The virDomainObj struct has @pid member where the domain's hypervisor PID is stored (e.g. QEMU/bhyve/libvirt_lxc/... PID). However, we are not consistent when it comes to shutoff state. Initially, because virDomainObjNew() uses g_new0() the @pid is initialized to 0. But when domain is shut off, some functions set it to -1 (virBhyveProcessStop, virCHProcessStop, qemuProcessStop, ..). In other places, the @pid is tested to be 0, on some other places it's tested for being negative and in the rest for being positive. To solve this inconsistency we can stick with either value, -1 or 0. I've chosen the latter as it's safer IMO. For instance if by mistake we'd kill(vm->pid, SIGTERM) we would kill ourselves instead of init's process group. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com> |
||
---|---|---|
.. | ||
libvirtd_lxc.aug | ||
lxc_cgroup.c | ||
lxc_cgroup.h | ||
lxc_conf.c | ||
lxc_conf.h | ||
lxc_container.c | ||
lxc_container.h | ||
lxc_controller.c | ||
lxc_domain.c | ||
lxc_domain.h | ||
lxc_driver.c | ||
lxc_driver.h | ||
lxc_fuse.c | ||
lxc_fuse.h | ||
lxc_hostdev.c | ||
lxc_hostdev.h | ||
lxc_monitor_protocol.x | ||
lxc_monitor.c | ||
lxc_monitor.h | ||
lxc_native.c | ||
lxc_native.h | ||
lxc_process.c | ||
lxc_process.h | ||
lxc.conf | ||
meson.build | ||
test_libvirtd_lxc.aug.in | ||
virtlxcd.init.in | ||
virtlxcd.service.in |