qemu: Fix crash when resuming failed post-copy migration

Since commit 28a0621528 (released in 11.2.0) resuming a failed
post-copy migration calls qemuProcessIncomingDefNew with fd == NULL
rather than -1. The function does not expect to be called with NULL file
descriptor and tries to dereference it causing virtqemud on the
destination host to crash.

Fixes: 28a0621528
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Jiri Denemark
2025-05-27 12:45:25 +02:00
parent ac4f855bb0
commit 34ce7f25c5
+2 -1
View File
@@ -3642,6 +3642,7 @@ qemuMigrationDstPrepareResume(virQEMUDriver *driver,
virDomainJobStatus status;
virDomainObj *vm;
int ret = -1;
int nofd = -1;
VIR_DEBUG("name=%s, origname=%s, protocol=%s, port=%hu, "
"listenAddress=%s, flags=0x%x",
@@ -3684,7 +3685,7 @@ qemuMigrationDstPrepareResume(virQEMUDriver *driver,
priv->origname = g_strdup(origname);
if (!(incoming = qemuMigrationDstPrepare(driver, vm, false, protocol,
listenAddress, port, NULL)))
listenAddress, port, &nofd)))
goto cleanup;
if (qemuDomainObjEnterMonitorAsync(vm, VIR_ASYNC_JOB_MIGRATION_IN) < 0)