mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
qemu: Call migrate-incoming with exit-on-error=false
The exit-on-error=false argument of migrate-incoming tells the QEMU process to keep running when incoming migration fails, which helps us in two ways: 1. When migration enters Finish phase to cleanup the process, the domain might not even exist on the destination (because it has already been cleaned up by EOF monitor callback) and we would get rather unhelpful "operation failed: domain is no longer running" error message. 2. We can get the error that caused incoming migration to fail directly from QEMU via query-migrate QMP command. https://issues.redhat.com/browse/RHEL-7041 Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
090a2f27c2
commit
060fd63c26
@ -2378,11 +2378,18 @@ qemuMigrationDstRun(virDomainObj *vm,
|
||||
const char *uri,
|
||||
virDomainAsyncJob asyncJob)
|
||||
{
|
||||
virTristateBool exitOnError = VIR_TRISTATE_BOOL_ABSENT;
|
||||
qemuDomainObjPrivate *priv = vm->privateData;
|
||||
int rv;
|
||||
|
||||
VIR_DEBUG("Setting up incoming migration with URI %s", uri);
|
||||
|
||||
/* Ask QEMU not to exit on failure during incoming migration (if supported)
|
||||
* so that we can properly check and report error during Finish phase.
|
||||
*/
|
||||
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATE_INCOMING_EXIT_ON_ERROR))
|
||||
exitOnError = VIR_TRISTATE_BOOL_NO;
|
||||
|
||||
if (qemuDomainObjEnterMonitorAsync(vm, asyncJob) < 0)
|
||||
return -1;
|
||||
|
||||
@ -2390,7 +2397,7 @@ qemuMigrationDstRun(virDomainObj *vm,
|
||||
if (rv < 0)
|
||||
goto exit_monitor;
|
||||
|
||||
rv = qemuMonitorMigrateIncoming(priv->mon, uri);
|
||||
rv = qemuMonitorMigrateIncoming(priv->mon, uri, exitOnError);
|
||||
|
||||
exit_monitor:
|
||||
qemuDomainObjExitMonitor(vm);
|
||||
|
@ -3811,13 +3811,15 @@ qemuMonitorGetMemoryDeviceInfo(qemuMonitor *mon,
|
||||
|
||||
int
|
||||
qemuMonitorMigrateIncoming(qemuMonitor *mon,
|
||||
const char *uri)
|
||||
const char *uri,
|
||||
virTristateBool exitOnError)
|
||||
{
|
||||
VIR_DEBUG("uri=%s", uri);
|
||||
VIR_DEBUG("uri=%s, exitOnError=%s",
|
||||
uri, virTristateBoolTypeToString(exitOnError));
|
||||
|
||||
QEMU_CHECK_MONITOR(mon);
|
||||
|
||||
return qemuMonitorJSONMigrateIncoming(mon, uri);
|
||||
return qemuMonitorJSONMigrateIncoming(mon, uri, exitOnError);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1294,7 +1294,8 @@ int qemuMonitorGetMemoryDeviceInfo(qemuMonitor *mon,
|
||||
ATTRIBUTE_NONNULL(2);
|
||||
|
||||
int qemuMonitorMigrateIncoming(qemuMonitor *mon,
|
||||
const char *uri);
|
||||
const char *uri,
|
||||
virTristateBool exitOnError);
|
||||
|
||||
int qemuMonitorMigrateStartPostCopy(qemuMonitor *mon);
|
||||
|
||||
|
@ -7269,13 +7269,15 @@ qemuMonitorJSONFindLinkPath(qemuMonitor *mon,
|
||||
|
||||
int
|
||||
qemuMonitorJSONMigrateIncoming(qemuMonitor *mon,
|
||||
const char *uri)
|
||||
const char *uri,
|
||||
virTristateBool exitOnError)
|
||||
{
|
||||
g_autoptr(virJSONValue) cmd = NULL;
|
||||
g_autoptr(virJSONValue) reply = NULL;
|
||||
|
||||
if (!(cmd = qemuMonitorJSONMakeCommand("migrate-incoming",
|
||||
"s:uri", uri,
|
||||
"T:exit-on-error", exitOnError,
|
||||
NULL)))
|
||||
return -1;
|
||||
|
||||
|
@ -607,7 +607,8 @@ qemuMonitorJSONFindLinkPath(qemuMonitor *mon,
|
||||
|
||||
int
|
||||
qemuMonitorJSONMigrateIncoming(qemuMonitor *mon,
|
||||
const char *uri)
|
||||
const char *uri,
|
||||
virTristateBool exitOnError)
|
||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
||||
|
||||
int
|
||||
|
Loading…
Reference in New Issue
Block a user