diff --git a/src/libvirt.c b/src/libvirt.c index d8ea252ee57b265e7cbc6fd0798f0815d659c246..397792820fb0adf53ea7cacdb5f211d307b92dbb 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -3040,8 +3040,6 @@ virDomainMigrateVersion2 (virDomainPtr domain, */ ret = domain->conn->driver->domainMigratePerform (domain, cookie, cookielen, uri, flags, dname, bandwidth); - if (ret == -1) - goto done; /* In version 2 of the migration protocol, we pass the * status code from the sender to the destination host, diff --git a/src/qemu_driver.c b/src/qemu_driver.c index c095a2966db8a1955dfbd78bcfec617a5a345145..b921b71f268121bdda276e742522b93dff2cf620 100644 --- a/src/qemu_driver.c +++ b/src/qemu_driver.c @@ -7031,6 +7031,21 @@ qemudDomainMigratePerform (virDomainPtr dom, goto cleanup; } + /* it is also possible that the migrate didn't fail initially, but + * rather failed later on. Check the output of "info migrate" + */ + VIR_FREE(info); + if (qemudMonitorCommand(vm, "info migrate", &info) < 0) { + qemudReportError (dom->conn, dom, NULL, VIR_ERR_OPERATION_FAILED, + "%s", _("could not get info about migration")); + goto cleanup; + } + if (strstr(info, "fail") != NULL) { + qemudReportError (dom->conn, dom, NULL, VIR_ERR_OPERATION_FAILED, + _("migrate failed: %s"), info); + goto cleanup; + } + /* Clean up the source domain. */ qemudShutdownVMDaemon (dom->conn, driver, vm); paused = 0;