mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-26 06:25:19 +00:00
libxl: don't attempt to resume domain when suspend fails
Failure of libxl_domain_suspend() does not leave the domain in a suspended state, so no need to call libxl_domain_resume(), which btw will fail with "domain not suspended". Signed-off-by: Jim Fehlig <jfehlig@suse.com> (cherry picked from commit 15120b8c61014a9263cb53314076da9a44e39621)
This commit is contained in:
parent
24d194ad59
commit
b4fefefc1b
@ -178,7 +178,6 @@ libxlDoMigrateSend(libxlDriverPrivatePtr driver,
|
|||||||
int sockfd)
|
int sockfd)
|
||||||
{
|
{
|
||||||
libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver);
|
libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver);
|
||||||
virObjectEventPtr event = NULL;
|
|
||||||
int xl_flags = 0;
|
int xl_flags = 0;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@ -188,24 +187,11 @@ libxlDoMigrateSend(libxlDriverPrivatePtr driver,
|
|||||||
ret = libxl_domain_suspend(cfg->ctx, vm->def->id, sockfd,
|
ret = libxl_domain_suspend(cfg->ctx, vm->def->id, sockfd,
|
||||||
xl_flags, NULL);
|
xl_flags, NULL);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
/* attempt to resume the domain on failure */
|
|
||||||
if (libxl_domain_resume(cfg->ctx, vm->def->id, 1, 0) != 0) {
|
|
||||||
VIR_DEBUG("Failed to resume domain following failed migration");
|
|
||||||
virDomainObjSetState(vm, VIR_DOMAIN_PAUSED,
|
|
||||||
VIR_DOMAIN_PAUSED_MIGRATION);
|
|
||||||
event = virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_SUSPENDED,
|
|
||||||
VIR_DOMAIN_EVENT_SUSPENDED_MIGRATED);
|
|
||||||
ignore_value(virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm));
|
|
||||||
}
|
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("Failed to send migration data to destination host"));
|
_("Failed to send migration data to destination host"));
|
||||||
ret = -1;
|
ret = -1;
|
||||||
goto cleanup;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup:
|
|
||||||
if (event)
|
|
||||||
libxlDomainEventQueue(driver, event);
|
|
||||||
virObjectUnref(cfg);
|
virObjectUnref(cfg);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user