cookieFlags |= QEMU_MIGRATION_COOKIE_ALLOW_REBOOT;
+ if (!(flags & VIR_MIGRATE_OFFLINE))
+ cookieFlags |= QEMU_MIGRATION_COOKIE_CAPS;
+
if (!(mig = qemuMigrationEatCookie(driver, vm, NULL, 0, 0)))
goto cleanup;
}
cookieFlags = 0;
} else {
- cookieFlags = QEMU_MIGRATION_COOKIE_GRAPHICS;
+ cookieFlags = QEMU_MIGRATION_COOKIE_GRAPHICS |
+ QEMU_MIGRATION_COOKIE_CAPS;
}
if (flags & VIR_MIGRATE_POSTCOPY &&
QEMU_MIGRATION_COOKIE_MEMORY_HOTPLUG |
QEMU_MIGRATION_COOKIE_CPU_HOTPLUG |
QEMU_MIGRATION_COOKIE_CPU |
- QEMU_MIGRATION_COOKIE_ALLOW_REBOOT)))
+ QEMU_MIGRATION_COOKIE_ALLOW_REBOOT |
+ QEMU_MIGRATION_COOKIE_CAPS)))
goto cleanup;
if (STREQ_NULLABLE(protocol, "rdma") &&
}
if (qemuMigrationParamsCheck(driver, vm, QEMU_ASYNC_JOB_MIGRATION_IN,
- migParams) < 0)
+ migParams, mig->caps->automatic) < 0)
goto stopjob;
/* Migrations using TLS need to add the "tls-creds-x509" object and
}
mig = qemuMigrationEatCookie(driver, vm, cookiein, cookieinlen,
- cookieFlags | QEMU_MIGRATION_COOKIE_GRAPHICS);
+ cookieFlags |
+ QEMU_MIGRATION_COOKIE_GRAPHICS |
+ QEMU_MIGRATION_COOKIE_CAPS);
if (!mig)
goto error;
VIR_WARN("unable to provide data for graphics client relocation");
if (qemuMigrationParamsCheck(driver, vm, QEMU_ASYNC_JOB_MIGRATION_OUT,
- migParams) < 0)
+ migParams, mig->caps->automatic) < 0)
goto error;
if (flags & VIR_MIGRATE_TLS) {
};
/* Migration capabilities which should always be enabled as long as they
- * are supported by QEMU. */
+ * are supported by QEMU. If the capability is supposed to be enabled on both
+ * sides of migration, it won't be enabled unless both sides support it.
+ */
static const qemuMigrationParamsAlwaysOnItem qemuMigrationParamsAlwaysOn[] = {
{QEMU_MIGRATION_CAP_PAUSE_BEFORE_SWITCHOVER,
QEMU_MIGRATION_SOURCE},
qemuMigrationParamsCheck(virQEMUDriverPtr driver,
virDomainObjPtr vm,
int asyncJob,
- qemuMigrationParamsPtr migParams)
+ qemuMigrationParamsPtr migParams,
+ virBitmapPtr remoteCaps)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
qemuMigrationCapability cap;
if (qemuMigrationParamsAlwaysOn[i].party & party &&
qemuMigrationCapsGet(vm, cap)) {
+ if (qemuMigrationParamsAlwaysOn[i].party != party) {
+ bool remote = false;
+
+ if (remoteCaps)
+ ignore_value(virBitmapGetBit(remoteCaps, cap, &remote));
+
+ if (!remote) {
+ VIR_DEBUG("Not enabling migration capability '%s'; it is "
+ "not supported or automatically enabled by the "
+ "other side of migration",
+ qemuMigrationCapabilityTypeToString(cap));
+ continue;
+ }
+ }
+
VIR_DEBUG("Enabling migration capability '%s'",
qemuMigrationCapabilityTypeToString(cap));
ignore_value(virBitmapSetBit(migParams->caps, cap));