[libvirt] [PATCH 5/5] lxc: Don't reboot host on virDomainReboot

Erik Skultety eskultet at redhat.com
Wed Feb 6 16:36:18 UTC 2019


On Fri, Jan 25, 2019 at 02:31:49PM +0100, Michal Privoznik wrote:
> 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

Nevertheless, it's hilarious :).

> 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 at redhat.com>

I'll trust you tried it, code-wise, I don't see an issue, it's pretty
straightforward.

Reviewed-by: Erik Skultety <eskultet at redhat.com>




More information about the libvir-list mailing list