]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
lib: Introduce VIR_DOMAIN_EVENT_SUSPENDED_GUEST_SHUTDOWN event reason
authorPeter Krempa <pkrempa@redhat.com>
Tue, 18 Nov 2025 14:45:22 +0000 (15:45 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 24 Nov 2025 15:40:24 +0000 (16:40 +0100)
Upcoming patches will introduce the possibility for the domain to be
kept paused after the guest OS shuts itself down. It'll allow jobs
such as backup to finish as e.g. in the qemu driver it requires the qemu
process.

Add an the appropriate reason for the VIR_DOMAIN_EVENT_SUSPENDED
lifecycle event.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
examples/c/misc/event-test.c
include/libvirt/libvirt-domain.h
tools/virsh-domain-event.c

index 347ec44682cc794160f92b5364f5a472f2e55d3a..2ce82ca9e0887cf369558e93493ede67beece42e 100644 (file)
@@ -180,6 +180,9 @@ eventDetailToString(int event,
             case VIR_DOMAIN_EVENT_SUSPENDED_POSTCOPY_FAILED:
                 return "Post-copy Error";
 
+            case VIR_DOMAIN_EVENT_SUSPENDED_GUEST_SHUTDOWN:
+                return "guest OS shutdown";
+
             case VIR_DOMAIN_EVENT_SUSPENDED_LAST:
                 break;
             }
index e16c1925cd070d33c02fad4013204fa1fb9008d5..3f5bd1ff7bb3e620c7717678d6a35511663acf4f 100644 (file)
@@ -5401,6 +5401,7 @@ typedef enum {
     VIR_DOMAIN_EVENT_SUSPENDED_API_ERROR = 6, /* Some APIs (e.g., migration, snapshot) internally need to suspend a domain. This event detail is used when resume operation at the end of such API fails. (Since: 1.0.1) */
     VIR_DOMAIN_EVENT_SUSPENDED_POSTCOPY = 7, /* suspended for post-copy migration (Since: 1.3.3) */
     VIR_DOMAIN_EVENT_SUSPENDED_POSTCOPY_FAILED = 8, /* suspended after failed post-copy (Since: 1.3.3) */
+    VIR_DOMAIN_EVENT_SUSPENDED_GUEST_SHUTDOWN = 9, /* suspended after guest os shut-down (a long running job is preserving the VM until completion) (Since: 11.10.0) */
 
 # ifdef VIR_ENUM_SENTINELS
     VIR_DOMAIN_EVENT_SUSPENDED_LAST /* (Since: 0.9.10) */
index a47fdfc7fd09866397a65c526598a4533cbba9a6..b9d1cdf019cab13eba5c5083f9940ff8d16b360f 100644 (file)
@@ -85,7 +85,8 @@ VIR_ENUM_IMPL(virshDomainEventSuspended,
               N_("Snapshot"),
               N_("API error"),
               N_("Post-copy"),
-              N_("Post-copy Error"));
+              N_("Post-copy Error"),
+              N_("guest shutdown"));
 
 VIR_ENUM_DECL(virshDomainEventResumed);
 VIR_ENUM_IMPL(virshDomainEventResumed,