On 24.04.2013 13:40, John Ferlan wrote:
https://bugzilla.redhat.com/show_bug.cgi?id=916052
Domain lifecycle events "on_reboot" and "on_poweroff" translate into
QEMU
command options "no-reboot" and "no-shutdown" at startup time. The
existing
code only checked the "on_reboot" setting to determine whether to add the
"no-reboot" option even though "on_poweroff" could have been set to
allow
reboot. Changed the logic to only use "no-reboot" if each of the lifecycle
event actions was "destroy". I considered adding "preserve" as well;
however,
a future preserve action might be able to cull something from a qemu process
that doesn't just exit immediately. NB, previously it was possible to have
both QEMU command options on the command line, which while not tagged as
an error could be considered "odd".
During the shutdown or reboot domain operations, the calls to qemuAgentShutdown
and qemuDomainSetFakeReboot did not consider the possibility that the event
action for shutdown was reboot or the event action for reboot was destroy.
This patch fixes that. NB, I wasn't sure how I could "convey" that to the
user though. The virsh reboot will still issue the message "Domain is being
rebooted" even though it could be destroyed. Like was virsh shutdown will
still issue the message "Domain is being shutdown" even though it is being
rebooted. The usage of VIR_INFO was an attempt to do that even though one
would have to have the correct debug level set.
Adjusted the documentation in order to describe the possible actions based
on the event lifecycle action settings of the domain.
John Ferlan (4):
Adjust usage of qemu -no-reboot and -no-shutdown options
Adjust comments to describe on_poweroff and on_reboot action
Handle the domain event 'on_reboot' and 'on_poweroff' settings
docs: Update formatdomain for lifecycle events
docs/formatdomain.html.in | 30 ++++++++++++++++++++++--------
src/libvirt.c | 15 +++++++++++----
src/qemu/qemu_command.c | 17 +++++++++++++----
src/qemu/qemu_driver.c | 26 ++++++++++++++++++++++----
4 files changed, 68 insertions(+), 20 deletions(-)
ACK series, but see my comments to 2/4 and 4/4.
Michal