int
qemuMigrationCapsCheck(virQEMUDriver *driver,
virDomainObj *vm,
- int asyncJob)
+ int asyncJob,
+ bool reconnect)
{
qemuDomainObjPrivate *priv = vm->privateData;
- g_autoptr(virBitmap) migEvent = NULL;
g_autoptr(virJSONValue) json = NULL;
g_auto(GStrv) caps = NULL;
char **capStr;
}
}
- migEvent = virBitmapNew(QEMU_MIGRATION_CAP_LAST);
+ if (!reconnect) {
+ g_autoptr(virBitmap) migEvent = virBitmapNew(QEMU_MIGRATION_CAP_LAST);
- ignore_value(virBitmapSetBit(migEvent, QEMU_MIGRATION_CAP_EVENTS));
+ ignore_value(virBitmapSetBit(migEvent, QEMU_MIGRATION_CAP_EVENTS));
- if (!(json = qemuMigrationCapsToJSON(migEvent, migEvent)))
- return -1;
+ if (!(json = qemuMigrationCapsToJSON(migEvent, migEvent)))
+ return -1;
- if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
- return -1;
+ if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
+ return -1;
- rc = qemuMonitorSetMigrationCapabilities(priv->mon, &json);
+ rc = qemuMonitorSetMigrationCapabilities(priv->mon, &json);
- qemuDomainObjExitMonitor(vm);
+ qemuDomainObjExitMonitor(vm);
- if (rc < 0)
- return -1;
+ if (rc < 0)
+ return -1;
+ }
/* Migration events capability must always be enabled, clearing it from
* migration capabilities bitmap makes sure it won't be touched anywhere
static int
-qemuConnectMonitor(virQEMUDriver *driver, virDomainObj *vm, int asyncJob,
- bool retry, qemuDomainLogContext *logCtxt)
+qemuConnectMonitor(virQEMUDriver *driver,
+ virDomainObj *vm,
+ int asyncJob,
+ bool retry,
+ qemuDomainLogContext *logCtxt,
+ bool reconnect)
{
qemuDomainObjPrivate *priv = vm->privateData;
qemuMonitor *mon = NULL;
if (qemuProcessInitMonitor(driver, vm, asyncJob) < 0)
return -1;
- if (qemuMigrationCapsCheck(driver, vm, asyncJob) < 0)
+ if (qemuMigrationCapsCheck(driver, vm, asyncJob, reconnect) < 0)
return -1;
return 0;
VIR_DEBUG("Connect monitor to vm=%p name='%s' retry=%d",
vm, vm->def->name, retry);
- if (qemuConnectMonitor(driver, vm, asyncJob, retry, logCtxt) < 0)
+ if (qemuConnectMonitor(driver, vm, asyncJob, retry, logCtxt, false) < 0)
goto cleanup;
/* Try to get the pty path mappings again via the monitor. This is much more
tryMonReconn = true;
/* XXX check PID liveliness & EXE path */
- if (qemuConnectMonitor(driver, obj, VIR_ASYNC_JOB_NONE, retry, NULL) < 0)
+ if (qemuConnectMonitor(driver, obj, VIR_ASYNC_JOB_NONE, retry, NULL, true) < 0)
goto error;
priv->machineName = qemuDomainGetMachineName(obj);