]> git.ipfire.org Git - thirdparty/libvirt.git/commit
lxcDomainShutdownFlags: Cleanup @flags usage
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 18 Dec 2013 18:00:32 +0000 (19:00 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 24 Dec 2013 16:36:47 +0000 (17:36 +0100)
commitaa4619337ccc0b171a3a4d17540da89429243c36
tree2152ae42c1246936d07e6db63fa708e412f18093
parent5bd7ac029efc86fe8048060c88f03f2a9486d8d8
lxcDomainShutdownFlags: Cleanup @flags usage

Currently, the @flags usage is a bit unclear at first sight to say the
least. There's no need for such unclear code especially when we can
borrow the working code from qemuDomainShutdownFlags().

In addition, this fixes one bug too. If user requested both
VIR_DOMAIN_SHUTDOWN_INITCTL and VIR_DOMAIN_SHUTDOWN_SIGNAL at the same
time, he is basically saying: 'Use the force Luke! If initctl fails try
sending a signal.' But with the current code we don't do that. If
initctl fails for some reason (e.g. inability to write to /dev/initctl)
we don't try sending any signal but fail immediately. To make things
worse, making a domain shutdown with bare _SIGNAL was working by blind
chance of a @rc variable being placed at correct place on the stack so
its initial value was zero.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/lxc/lxc_driver.c