libvirt/src/lxc
Michal Privoznik f344005547 lib: Be consistent about vm->pid
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>
2022-06-01 09:35:26 +02:00
..
libvirtd_lxc.aug
lxc_cgroup.c conf: Fix type of @present in _virDomainTimerDef struct 2022-01-26 10:49:18 +01:00
lxc_cgroup.h lxc_fuse: Move virLXCMeminfo struct into lxc_cgroup.h 2022-03-07 14:01:48 +01:00
lxc_conf.c lxc: Use automatic mutex management 2022-02-11 11:03:54 +01:00
lxc_conf.h lxc: Use automatic mutex management 2022-02-11 11:03:54 +01:00
lxc_container.c conf: Convert virDomainFSDefParseXML() to virXMLProp*() 2022-01-21 16:42:14 +01:00
lxc_container.h
lxc_controller.c lib: Set up cpuset controller for restrictive numatune 2022-04-07 12:12:11 +02:00
lxc_domain.c lxc: Store 'driver' in VM private data 2022-05-17 19:31:08 +02:00
lxc_domain.h lxc: Store 'driver' in VM private data 2022-05-17 19:31:08 +02:00
lxc_driver.c virclosecallbacks: Don't pass opqaue pointer to callback invocation 2022-05-17 19:31:08 +02:00
lxc_driver.h
lxc_fuse.c meson: Detect newer fuse 2022-03-07 14:01:48 +01:00
lxc_fuse.h lxc_fuse: Move #include <fuse.h> 2022-03-07 14:01:48 +01:00
lxc_hostdev.c
lxc_hostdev.h
lxc_monitor_protocol.x
lxc_monitor.c
lxc_monitor.h
lxc_native.c lib: Use g_clear_pointer() more 2022-02-08 08:42:07 +01:00
lxc_native.h
lxc_process.c lib: Be consistent about vm->pid 2022-06-01 09:35:26 +02:00
lxc_process.h
lxc.conf
meson.build meson: Add missing virt_install_dirs 2022-02-02 16:26:36 +01:00
test_libvirtd_lxc.aug.in
virtlxcd.init.in
virtlxcd.service.in systemd: Use correct man page name in modular daemon service files 2022-02-01 13:20:11 +01:00