[libvirt PATCH 53/80] qemu: Don't set VIR_MIGRATE_PAUSED for post-copy resume

Jiri Denemark posted 80 patches 3 years, 9 months ago
There is a newer version of this series
[libvirt PATCH 53/80] qemu: Don't set VIR_MIGRATE_PAUSED for post-copy resume
Posted by Jiri Denemark 3 years, 9 months ago
For historical reasons we automatically enabled VIR_MIGRATE_PAUSED flag
when a migration was started for a paused domain. However, when resuming
failed post-copy migration the domain on the source host will always be
paused (as it is already running on the destination host). We must avoid
enabling VIR_MIGRATE_PAUSED in this case.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
 src/libvirt-domain.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
index 41ba4aa39c..07fb8119d9 100644
--- a/src/libvirt-domain.c
+++ b/src/libvirt-domain.c
@@ -3279,7 +3279,9 @@ virDomainMigrateVersion3Full(virDomainPtr domain,
         ret = virDomainGetInfo(domain, &info);
         state = info.state;
     }
-    if (ret == 0 && state == VIR_DOMAIN_PAUSED)
+    if (ret == 0 &&
+        state == VIR_DOMAIN_PAUSED &&
+        !(flags & VIR_MIGRATE_POSTCOPY_RESUME))
         flags |= VIR_MIGRATE_PAUSED;
 
     destflags = flags & ~(VIR_MIGRATE_ABORT_ON_ERROR |
-- 
2.35.1
Re: [libvirt PATCH 53/80] qemu: Don't set VIR_MIGRATE_PAUSED for post-copy resume
Posted by Peter Krempa 3 years, 9 months ago
On Tue, May 10, 2022 at 17:21:14 +0200, Jiri Denemark wrote:
> For historical reasons we automatically enabled VIR_MIGRATE_PAUSED flag
> when a migration was started for a paused domain. However, when resuming
> failed post-copy migration the domain on the source host will always be
> paused (as it is already running on the destination host). We must avoid
> enabling VIR_MIGRATE_PAUSED in this case.
> 
> Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
> ---
>  src/libvirt-domain.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

Reviewed-by: Peter Krempa <pkrempa@redhat.com>