[pve-devel] [PATCH qemu-server 3/3] migration: handle 'cancelling' and 'wait-unplug' status

Fiona Ebner f.ebner at proxmox.com
Mon Jul 28 16:30:33 CEST 2025


When in 'cancelling' status, wait until the transition to 'cancelled'
happens. Similarly, when in 'wait-unplug' status, wait for the
transition to the next state.

According to the QMP reference docs:

cancelling:
> in the process of cancelling migration.

wait-unplug:
> wait for device unplug request by guest OS to be completed.

Signed-off-by: Fiona Ebner <f.ebner at proxmox.com>
---
 src/PVE/QemuMigrate.pm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/PVE/QemuMigrate.pm b/src/PVE/QemuMigrate.pm
index 5b854292..9585e292 100644
--- a/src/PVE/QemuMigrate.pm
+++ b/src/PVE/QemuMigrate.pm
@@ -1349,7 +1349,8 @@ sub phase2 {
         }
 
         my $status = $stat->{status};
-        if (defined($status) && $status =~ m/^(setup)$/im) {
+        if (defined($status) && $status =~ m/^(cancelling|setup|wait-unplug)$/im) {
+            $self->log('info', "migration in status '$status' - waiting for transition");
             sleep(1);
             next;
         }
-- 
2.47.2





More information about the pve-devel mailing list