]> xenbits.xensource.com Git - libvirt.git/commit
lxc: Don't reboot host on virDomainReboot
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 25 Jan 2019 11:42:54 +0000 (12:42 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 7 Feb 2019 10:36:41 +0000 (11:36 +0100)
commit94fce255461ad6bf0366dd4428921d7d41ba1a8f
tree8a5ce627fa0501e817d35206d5aeeb3b894ef7dd
parent64eca3d5e30030147383bc63eba77e723563d4e2
lxc: Don't reboot host on virDomainReboot

If the container is really a simple one (init is just bash and
the whole root is passed through) then virDomainReboot and
virDomainShutdown will talk to the actual init within the host.
Therefore, 'virsh shutdown $dom' will result in shutting down the
host. True, at that point the container is shut down too but
looks a bit harsh to me.

The solution is to check if the init inside the container is or
is not the same as the init running on the host.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
src/lxc/lxc_domain.c
src/lxc/lxc_domain.h
src/lxc/lxc_driver.c