]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Introduce VIR_DOMAIN_RUNNING_POSTCOPY_FAILED
authorJiri Denemark <jdenemar@redhat.com>
Tue, 10 May 2022 13:20:25 +0000 (15:20 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Tue, 7 Jun 2022 15:40:20 +0000 (17:40 +0200)
This new "post-copy failed" reason for the running state will be used on
the destination host when post-copy migration fails while the domain is
already running there.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
examples/c/misc/event-test.c
include/libvirt/libvirt-domain.h
src/conf/domain_conf.c
src/libvirt-domain.c
src/qemu/qemu_domain.c
tools/virsh-domain-event.c
tools/virsh-domain-monitor.c

index 1165469a655c07f7e1f9453798c58400505b67f8..64652b0153f853905fb732620897b887fd5c1861 100644 (file)
@@ -196,6 +196,9 @@ eventDetailToString(int event,
             case VIR_DOMAIN_EVENT_RESUMED_POSTCOPY:
                 return "Post-copy";
 
+            case VIR_DOMAIN_EVENT_RESUMED_POSTCOPY_FAILED:
+                return "Post-copy Error";
+
             case VIR_DOMAIN_EVENT_RESUMED_LAST:
                 break;
             }
index 24846046aa0207218b9fdb4bf800d8c06613fcda..caf99d41bcc4cfde55e80e2a866d7e00bde045d6 100644 (file)
@@ -108,6 +108,7 @@ typedef enum {
                                                wakeup event (Since: 0.9.11) */
     VIR_DOMAIN_RUNNING_CRASHED = 9,         /* resumed from crashed (Since: 1.1.1) */
     VIR_DOMAIN_RUNNING_POSTCOPY = 10,       /* running in post-copy migration mode (Since: 1.3.3) */
+    VIR_DOMAIN_RUNNING_POSTCOPY_FAILED = 11, /* running in failed post-copy migration (Since: 8.5.0) */
 
 # ifdef VIR_ENUM_SENTINELS
     VIR_DOMAIN_RUNNING_LAST /* (Since: 0.9.10) */
@@ -3801,6 +3802,7 @@ typedef enum {
     VIR_DOMAIN_EVENT_RESUMED_FROM_SNAPSHOT = 2, /* Resumed from snapshot (Since: 0.9.5) */
     VIR_DOMAIN_EVENT_RESUMED_POSTCOPY = 3,   /* Resumed, but migration is still
                                                 running in post-copy mode (Since: 1.3.3) */
+    VIR_DOMAIN_EVENT_RESUMED_POSTCOPY_FAILED = 4, /* Running, but migration failed in post-copy (Since: 8.5.0) */
 
 # ifdef VIR_ENUM_SENTINELS
     VIR_DOMAIN_EVENT_RESUMED_LAST /* (Since: 0.9.10) */
index 5d0d436a40c68e1b361dcebcec8826851435d2ea..ef38deddc5e642a39a61d90b6e2be29a9e360dbb 100644 (file)
@@ -1106,6 +1106,7 @@ VIR_ENUM_IMPL(virDomainRunningReason,
               "wakeup",
               "crashed",
               "post-copy",
+              "post-copy failed",
 );
 
 VIR_ENUM_IMPL(virDomainBlockedReason,
index e3ced700b870bb1534cc9c2a77af88acb156fcde..10fc3188fe59196ee7564ef74701f092f5fca2c4 100644 (file)
@@ -9764,10 +9764,12 @@ virDomainMigrateGetMaxSpeed(virDomainPtr domain,
  * at most once no matter how fast it changes. On the other hand once the
  * guest is running on the destination host, the migration can no longer be
  * rolled back because none of the hosts has complete state. If this happens,
- * libvirt will leave the domain paused on both hosts with
- * VIR_DOMAIN_PAUSED_POSTCOPY_FAILED reason. It's up to the upper layer to
- * decide what to do in such case. Because of this, libvirt will refuse to
- * cancel post-copy migration via virDomainAbortJob.
+ * libvirt will leave the domain paused on the source host with
+ * VIR_DOMAIN_PAUSED_POSTCOPY_FAILED reason. The domain on the destination host
+ * will remain running with VIR_DOMAIN_RUNNING_POSTCOPY_FAILED reason.
+ * It's up to the upper layer to decide what to do in such case. Because of
+ * this, libvirt will refuse to cancel post-copy migration via
+ * virDomainAbortJob.
  *
  * The following domain life cycle events are emitted during post-copy
  * migration:
@@ -9781,9 +9783,11 @@ virDomainMigrateGetMaxSpeed(virDomainPtr domain,
  *  VIR_DOMAIN_EVENT_RESUMED_MIGRATED (on the destination),
  *  VIR_DOMAIN_EVENT_STOPPED_MIGRATED (on the source) -- migration finished
  *      successfully and the destination host holds a complete guest state.
- *  VIR_DOMAIN_EVENT_SUSPENDED_POSTCOPY_FAILED (on the destination) -- emitted
- *      when migration fails in post-copy mode and it's unclear whether any
- *      of the hosts has a complete guest state.
+ *  VIR_DOMAIN_EVENT_SUSPENDED_POSTCOPY_FAILED (on the source),
+ *  VIR_DOMAIN_EVENT_RESUMED_POSTCOPY_FAILED (on the destination) -- emitted
+ *      when migration fails in post-copy mode and it's unclear whether any of
+ *      the hosts has a complete guest state. Virtual CPUs on the destination
+ *      are still running.
  *
  * The progress of a post-copy migration can be monitored normally using
  * virDomainGetJobStats on the source host. Fetching statistics of a completed
index 916f85e67394ee4b3e774d6fcb7d06d4e2faa194..124f5315c8379ea2feeff7f7ac81dd130fe85f17 100644 (file)
@@ -11145,6 +11145,9 @@ qemuDomainRunningReasonToResumeEvent(virDomainRunningReason reason)
     case VIR_DOMAIN_RUNNING_POSTCOPY:
         return VIR_DOMAIN_EVENT_RESUMED_POSTCOPY;
 
+    case VIR_DOMAIN_RUNNING_POSTCOPY_FAILED:
+        return VIR_DOMAIN_EVENT_RESUMED_POSTCOPY_FAILED;
+
     case VIR_DOMAIN_RUNNING_UNKNOWN:
     case VIR_DOMAIN_RUNNING_SAVE_CANCELED:
     case VIR_DOMAIN_RUNNING_BOOTED:
index 6dbb64a6557ac1cf4324f15cc1a6aeb8769e7094..2d6db5f881198716803e22d758adabb2766c46fb 100644 (file)
@@ -93,7 +93,8 @@ VIR_ENUM_IMPL(virshDomainEventResumed,
               N_("Unpaused"),
               N_("Migrated"),
               N_("Snapshot"),
-              N_("Post-copy"));
+              N_("Post-copy"),
+              N_("Post-copy Error"));
 
 VIR_ENUM_DECL(virshDomainEventStopped);
 VIR_ENUM_IMPL(virshDomainEventStopped,
index 246e8a16c07d48102db57c82a3ec0f85d996b9c4..dc5fe13e49de10548882642f785fcc2386e5fee8 100644 (file)
@@ -166,6 +166,7 @@ VIR_ENUM_IMPL(virshDomainRunningReason,
               N_("event wakeup"),
               N_("crashed"),
               N_("post-copy"),
+              N_("post-copy failed"),
 );
 
 VIR_ENUM_DECL(virshDomainBlockedReason);