priv->originalMemlock);
}
+ if (priv->preMigrationMemlock > 0) {
+ virBufferAsprintf(buf, "<preMigrationMemlock>%llu</preMigrationMemlock>\n",
+ priv->preMigrationMemlock);
+ }
+
return 0;
}
return -1;
}
+ if (virXPathULongLong("string(./preMigrationMemlock)", ctxt,
+ &priv->preMigrationMemlock) == -2) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("failed to parse pre-migration memlock limit"));
+ return -1;
+ }
+
return 0;
}
if (STREQ_NULLABLE(protocol, "rdma") &&
vm->def->mem.hard_limit > 0 &&
- qemuDomainSetMaxMemLock(vm, vm->def->mem.hard_limit << 10, NULL) < 0) {
+ qemuDomainSetMaxMemLock(vm, vm->def->mem.hard_limit << 10,
+ &priv->preMigrationMemlock) < 0) {
goto error;
}
VIR_DOMAIN_EVENT_STOPPED_MIGRATED);
virObjectEventStateQueue(driver->domainEventState, event);
qemuDomainEventEmitJobCompleted(driver, vm);
+ priv->preMigrationMemlock = 0;
}
qemuMigrationParamsReset(driver, vm, VIR_ASYNC_JOB_MIGRATION_OUT,
jobPriv->migParams, priv->job.apiFlags);
+ qemuDomainSetMaxMemLock(vm, 0, &priv->preMigrationMemlock);
}
qemuDomainSaveStatus(vm);
case MIGRATION_DEST_HOST:
if (STREQ(spec->dest.host.protocol, "rdma") &&
vm->def->mem.hard_limit > 0 &&
- qemuDomainSetMaxMemLock(vm, vm->def->mem.hard_limit << 10, NULL) < 0) {
+ qemuDomainSetMaxMemLock(vm, vm->def->mem.hard_limit << 10,
+ &priv->preMigrationMemlock) < 0) {
return -1;
}
return qemuMonitorMigrateToHost(priv->mon, migrateFlags,
qemuMigrationSrcRestoreDomainState(driver, vm);
qemuMigrationParamsReset(driver, vm, VIR_ASYNC_JOB_MIGRATION_OUT,
jobPriv->migParams, priv->job.apiFlags);
+ qemuDomainSetMaxMemLock(vm, 0, &priv->preMigrationMemlock);
qemuMigrationJobFinish(vm);
} else {
if (ret < 0)
virPortAllocatorRelease(priv->migrationPort);
priv->migrationPort = 0;
+ qemuDomainSetMaxMemLock(vm, 0, &priv->preMigrationMemlock);
}