On 9/14/26 10:18, Jean-Louis Dupond via Devel wrote: > With the 'on_reboot' lifecycle action set to 'destroy' (QEMU > -action reboot=shutdown), a guest-initiated reboot is converted > into a shutdown. The QMP SHUTDOWN event carries a 'reason' field > distinguishing 'guest-reset' (guest requested a reboot) from > 'guest-shutdown' (guest powered off), but libvirt discarded it. > > Thread the reason through the monitor shutdown callback and map > 'guest-reset' to a new VIR_DOMAIN_EVENT_SHUTDOWN_GUEST_RESET > lifecycle detail so that management applications can tell a > reboot apart from a poweroff when handling the SHUTDOWN event. > > Signed-off-by: Jean-Louis Dupond <[email protected]> > --- > examples/c/misc/event-test.c | 3 +++ > include/libvirt/libvirt-domain.h | 5 +++++ > src/qemu/qemu_monitor.c | 2 +- > src/qemu/qemu_monitor.h | 3 ++- > src/qemu/qemu_process.c | 35 +++++++++++++++++++------------- > tools/virsh-domain-event.c | 3 ++- > 6 files changed, 34 insertions(+), 17 deletions(-)
Reviewed-by: Michal Privoznik <[email protected]> and merged. Sorry for the delay. Michal
