For the subject prefix, I'd suggest:

include: Introduce VIR_DOMAIN_EVENT_STOPPED_REBOOT detail

On 11/9/26 4:47 AM, Ben Grande wrote:
If domain "on_reboot" is not set to "restart", the listener can be aware
of such reboot request and run their own procedures.

This only mentions what a listener can do. It should introduce and describe the new detail. E.g. something like:

Introduce a new VIR_DOMAIN_EVENT_STOPPED_REBOOT detail for the 'stopped' lifecycle event, which indicates a domain has stopped due to a host or domain OS initiated reboot.


Resolves: https://github.com/QubesOS/qubes-issues/issues/8196
Signed-off-by: Ben Grande <[email protected]>
---
  examples/c/misc/event-test.c     | 3 +++
  include/libvirt/libvirt-domain.h | 1 +
  tools/virsh-domain-event.c       | 3 ++-
  3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/examples/c/misc/event-test.c b/examples/c/misc/event-test.c
index 3e2b0a7827..1bac8d0cb8 100644
--- a/examples/c/misc/event-test.c
+++ b/examples/c/misc/event-test.c
@@ -239,6 +239,9 @@ eventDetailToString(int event,
              case VIR_DOMAIN_EVENT_STOPPED_RECREATED:
                  return "Recreated";
+ case VIR_DOMAIN_EVENT_STOPPED_REBOOT:
+                return "Reboot";
+
              case VIR_DOMAIN_EVENT_STOPPED_LAST:
                  break;
              }
diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h
index 9ee153c6eb..ada0df65a7 100644
--- a/include/libvirt/libvirt-domain.h
+++ b/include/libvirt/libvirt-domain.h
@@ -5778,6 +5778,7 @@ typedef enum {
      VIR_DOMAIN_EVENT_STOPPED_FAILED = 5,    /* Host emulator/mgmt failed 
(Since: 0.5.0) */
      VIR_DOMAIN_EVENT_STOPPED_FROM_SNAPSHOT = 6, /* offline snapshot loaded 
(Since: 0.8.0) */
      VIR_DOMAIN_EVENT_STOPPED_RECREATED = 7,    /* Secure guest recreation 
(Since: 11.6.0) */
+    VIR_DOMAIN_EVENT_STOPPED_REBOOT = 8,    /* Host or guest requested reboot 
(Since: 12.9.0) */

Now 12.10.0.

Regards,
Jim

Reply via email to