revoke:
if (revoke_maxmemlock) {
- if (qemuDomainAdjustMaxMemLock(vm, false) < 0)
+ if (qemuDomainAdjustMaxMemLock(vm) < 0)
VIR_WARN("Unable to change max memlock limit");
}
/**
* qemuDomainAdjustMaxMemLock:
* @vm: domain
- * @forceVFIO: apply VFIO requirements even if vm's def doesn't require it
*
* Adjust the memory locking limit for the QEMU process associated to @vm, in
- * order to comply with VFIO or architecture requirements. If @forceVFIO is
- * true then the limit is changed even if nothing in @vm's definition indicates
- * so.
+ * order to comply with VFIO or architecture requirements.
*
* The limit will not be changed unless doing so is needed; the first time
* the limit is changed, the original (default) limit is stored in @vm and
* Returns: 0 on success, <0 on failure
*/
int
-qemuDomainAdjustMaxMemLock(virDomainObj *vm,
- bool forceVFIO)
+qemuDomainAdjustMaxMemLock(virDomainObj *vm)
{
return qemuDomainSetMaxMemLock(vm,
- qemuDomainGetMemLockLimitBytes(vm->def, forceVFIO),
+ qemuDomainGetMemLockLimitBytes(vm->def, false),
&QEMU_DOMAIN_PRIVATE(vm)->originalMemlock);
}
int ret = 0;
vm->def->hostdevs[vm->def->nhostdevs++] = hostdev;
- if (qemuDomainAdjustMaxMemLock(vm, false) < 0)
+ if (qemuDomainAdjustMaxMemLock(vm) < 0)
ret = -1;
vm->def->hostdevs[--(vm->def->nhostdevs)] = NULL;
VIR_APPEND_ELEMENT_COPY(vm->def->disks, vm->def->ndisks, disk);
- if (qemuDomainAdjustMaxMemLock(vm, false) < 0)
+ if (qemuDomainAdjustMaxMemLock(vm) < 0)
ret = -1;
VIR_DELETE_ELEMENT_INPLACE(vm->def->disks, vm->def->ndisks - 1, vm->def->ndisks);
break;
case VIR_DOMAIN_NET_TYPE_VDPA:
- if (qemuDomainAdjustMaxMemLock(vm, false) < 0)
+ if (qemuDomainAdjustMaxMemLock(vm) < 0)
goto cleanup;
adjustmemlock = true;
break;
* after all
*/
if (adjustmemlock)
- qemuDomainAdjustMaxMemLock(vm, false);
+ qemuDomainAdjustMaxMemLock(vm);
if (net->type == VIR_DOMAIN_NET_TYPE_NETWORK) {
if (conn)
if (teardowndevice &&
qemuDomainNamespaceTeardownHostdev(vm, hostdev) < 0)
VIR_WARN("Unable to remove host device from /dev");
- if (teardownmemlock && qemuDomainAdjustMaxMemLock(vm, false) < 0)
+ if (teardownmemlock && qemuDomainAdjustMaxMemLock(vm) < 0)
VIR_WARN("Unable to reset maximum locked memory on hotplug fail");
if (releaseaddr)
if (virDomainMemoryInsert(vm->def, mem) < 0)
goto cleanup;
- if (qemuDomainAdjustMaxMemLock(vm, false) < 0)
+ if (qemuDomainAdjustMaxMemLock(vm) < 0)
goto removedef;
qemuDomainObjEnterMonitor(vm);
/* reset the mlock limit */
virErrorPreserveLast(&orig_err);
- ignore_value(qemuDomainAdjustMaxMemLock(vm, false));
+ ignore_value(qemuDomainAdjustMaxMemLock(vm));
virErrorRestore(&orig_err);
goto audit;
ret = 0;
cleanup:
if (ret < 0) {
- if (teardownmemlock && qemuDomainAdjustMaxMemLock(vm, false) < 0)
+ if (teardownmemlock && qemuDomainAdjustMaxMemLock(vm) < 0)
VIR_WARN("Unable to reset maximum locked memory on hotplug fail");
if (teardowncgroup && qemuTeardownHostdevCgroup(vm, hostdev) < 0)
VIR_WARN("Unable to remove host device cgroup ACL on hotplug fail");
ignore_value(qemuProcessRefreshBalloonState(vm, VIR_ASYNC_JOB_NONE));
/* decrease the mlock limit after memory unplug if necessary */
- ignore_value(qemuDomainAdjustMaxMemLock(vm, false));
+ ignore_value(qemuDomainAdjustMaxMemLock(vm));
return 0;
}
qemuDomainRemovePCIHostDevice(driver, vm, hostdev);
/* QEMU might no longer need to lock as much memory, eg. we just
* detached the last VFIO device, so adjust the limit here */
- if (qemuDomainAdjustMaxMemLock(vm, false) < 0)
+ if (qemuDomainAdjustMaxMemLock(vm) < 0)
VIR_WARN("Failed to adjust locked memory limit");
break;
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB: