mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
qemu: Drop @forceVFIO argument of qemuDomainAdjustMaxMemLock()
After previous cleanup, there's not a single caller that would call qemuDomainAdjustMaxMemLock() with @forceVFIO set. All callers pass false. Drop the unneeded argument from the function. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
parent
c925bb9273
commit
4f355fa5b7
@ -8040,7 +8040,7 @@ qemuDomainStorageSourceAccessModifyNVMe(virQEMUDriver *driver,
|
|||||||
|
|
||||||
revoke:
|
revoke:
|
||||||
if (revoke_maxmemlock) {
|
if (revoke_maxmemlock) {
|
||||||
if (qemuDomainAdjustMaxMemLock(vm, false) < 0)
|
if (qemuDomainAdjustMaxMemLock(vm) < 0)
|
||||||
VIR_WARN("Unable to change max memlock limit");
|
VIR_WARN("Unable to change max memlock limit");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -9726,12 +9726,9 @@ qemuDomainSetMaxMemLock(virDomainObj *vm,
|
|||||||
/**
|
/**
|
||||||
* qemuDomainAdjustMaxMemLock:
|
* qemuDomainAdjustMaxMemLock:
|
||||||
* @vm: domain
|
* @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
|
* Adjust the memory locking limit for the QEMU process associated to @vm, in
|
||||||
* order to comply with VFIO or architecture requirements. If @forceVFIO is
|
* order to comply with VFIO or architecture requirements.
|
||||||
* true then the limit is changed even if nothing in @vm's definition indicates
|
|
||||||
* so.
|
|
||||||
*
|
*
|
||||||
* The limit will not be changed unless doing so is needed; the first time
|
* 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
|
* the limit is changed, the original (default) limit is stored in @vm and
|
||||||
@ -9741,11 +9738,10 @@ qemuDomainSetMaxMemLock(virDomainObj *vm,
|
|||||||
* Returns: 0 on success, <0 on failure
|
* Returns: 0 on success, <0 on failure
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
qemuDomainAdjustMaxMemLock(virDomainObj *vm,
|
qemuDomainAdjustMaxMemLock(virDomainObj *vm)
|
||||||
bool forceVFIO)
|
|
||||||
{
|
{
|
||||||
return qemuDomainSetMaxMemLock(vm,
|
return qemuDomainSetMaxMemLock(vm,
|
||||||
qemuDomainGetMemLockLimitBytes(vm->def, forceVFIO),
|
qemuDomainGetMemLockLimitBytes(vm->def, false),
|
||||||
&QEMU_DOMAIN_PRIVATE(vm)->originalMemlock);
|
&QEMU_DOMAIN_PRIVATE(vm)->originalMemlock);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -9770,7 +9766,7 @@ qemuDomainAdjustMaxMemLockHostdev(virDomainObj *vm,
|
|||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
vm->def->hostdevs[vm->def->nhostdevs++] = hostdev;
|
vm->def->hostdevs[vm->def->nhostdevs++] = hostdev;
|
||||||
if (qemuDomainAdjustMaxMemLock(vm, false) < 0)
|
if (qemuDomainAdjustMaxMemLock(vm) < 0)
|
||||||
ret = -1;
|
ret = -1;
|
||||||
|
|
||||||
vm->def->hostdevs[--(vm->def->nhostdevs)] = NULL;
|
vm->def->hostdevs[--(vm->def->nhostdevs)] = NULL;
|
||||||
@ -9803,7 +9799,7 @@ qemuDomainAdjustMaxMemLockNVMe(virDomainObj *vm,
|
|||||||
|
|
||||||
VIR_APPEND_ELEMENT_COPY(vm->def->disks, vm->def->ndisks, disk);
|
VIR_APPEND_ELEMENT_COPY(vm->def->disks, vm->def->ndisks, disk);
|
||||||
|
|
||||||
if (qemuDomainAdjustMaxMemLock(vm, false) < 0)
|
if (qemuDomainAdjustMaxMemLock(vm) < 0)
|
||||||
ret = -1;
|
ret = -1;
|
||||||
|
|
||||||
VIR_DELETE_ELEMENT_INPLACE(vm->def->disks, vm->def->ndisks - 1, vm->def->ndisks);
|
VIR_DELETE_ELEMENT_INPLACE(vm->def->disks, vm->def->ndisks - 1, vm->def->ndisks);
|
||||||
|
@ -856,8 +856,7 @@ void qemuDomainUpdateCurrentMemorySize(virDomainObj *vm);
|
|||||||
|
|
||||||
unsigned long long qemuDomainGetMemLockLimitBytes(virDomainDef *def,
|
unsigned long long qemuDomainGetMemLockLimitBytes(virDomainDef *def,
|
||||||
bool forceVFIO);
|
bool forceVFIO);
|
||||||
int qemuDomainAdjustMaxMemLock(virDomainObj *vm,
|
int qemuDomainAdjustMaxMemLock(virDomainObj *vm);
|
||||||
bool forceVFIO);
|
|
||||||
int qemuDomainAdjustMaxMemLockHostdev(virDomainObj *vm,
|
int qemuDomainAdjustMaxMemLockHostdev(virDomainObj *vm,
|
||||||
virDomainHostdevDef *hostdev);
|
virDomainHostdevDef *hostdev);
|
||||||
int qemuDomainAdjustMaxMemLockNVMe(virDomainObj *vm,
|
int qemuDomainAdjustMaxMemLockNVMe(virDomainObj *vm,
|
||||||
|
@ -1244,7 +1244,7 @@ qemuDomainAttachNetDevice(virQEMUDriver *driver,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case VIR_DOMAIN_NET_TYPE_VDPA:
|
case VIR_DOMAIN_NET_TYPE_VDPA:
|
||||||
if (qemuDomainAdjustMaxMemLock(vm, false) < 0)
|
if (qemuDomainAdjustMaxMemLock(vm) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
adjustmemlock = true;
|
adjustmemlock = true;
|
||||||
break;
|
break;
|
||||||
@ -1417,7 +1417,7 @@ qemuDomainAttachNetDevice(virQEMUDriver *driver,
|
|||||||
* after all
|
* after all
|
||||||
*/
|
*/
|
||||||
if (adjustmemlock)
|
if (adjustmemlock)
|
||||||
qemuDomainAdjustMaxMemLock(vm, false);
|
qemuDomainAdjustMaxMemLock(vm);
|
||||||
|
|
||||||
if (net->type == VIR_DOMAIN_NET_TYPE_NETWORK) {
|
if (net->type == VIR_DOMAIN_NET_TYPE_NETWORK) {
|
||||||
if (conn)
|
if (conn)
|
||||||
@ -1564,7 +1564,7 @@ qemuDomainAttachHostPCIDevice(virQEMUDriver *driver,
|
|||||||
if (teardowndevice &&
|
if (teardowndevice &&
|
||||||
qemuDomainNamespaceTeardownHostdev(vm, hostdev) < 0)
|
qemuDomainNamespaceTeardownHostdev(vm, hostdev) < 0)
|
||||||
VIR_WARN("Unable to remove host device from /dev");
|
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");
|
VIR_WARN("Unable to reset maximum locked memory on hotplug fail");
|
||||||
|
|
||||||
if (releaseaddr)
|
if (releaseaddr)
|
||||||
@ -2291,7 +2291,7 @@ qemuDomainAttachMemory(virQEMUDriver *driver,
|
|||||||
if (virDomainMemoryInsert(vm->def, mem) < 0)
|
if (virDomainMemoryInsert(vm->def, mem) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (qemuDomainAdjustMaxMemLock(vm, false) < 0)
|
if (qemuDomainAdjustMaxMemLock(vm) < 0)
|
||||||
goto removedef;
|
goto removedef;
|
||||||
|
|
||||||
qemuDomainObjEnterMonitor(vm);
|
qemuDomainObjEnterMonitor(vm);
|
||||||
@ -2357,7 +2357,7 @@ qemuDomainAttachMemory(virQEMUDriver *driver,
|
|||||||
|
|
||||||
/* reset the mlock limit */
|
/* reset the mlock limit */
|
||||||
virErrorPreserveLast(&orig_err);
|
virErrorPreserveLast(&orig_err);
|
||||||
ignore_value(qemuDomainAdjustMaxMemLock(vm, false));
|
ignore_value(qemuDomainAdjustMaxMemLock(vm));
|
||||||
virErrorRestore(&orig_err);
|
virErrorRestore(&orig_err);
|
||||||
|
|
||||||
goto audit;
|
goto audit;
|
||||||
@ -2720,7 +2720,7 @@ qemuDomainAttachMediatedDevice(virQEMUDriver *driver,
|
|||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
if (ret < 0) {
|
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");
|
VIR_WARN("Unable to reset maximum locked memory on hotplug fail");
|
||||||
if (teardowncgroup && qemuTeardownHostdevCgroup(vm, hostdev) < 0)
|
if (teardowncgroup && qemuTeardownHostdevCgroup(vm, hostdev) < 0)
|
||||||
VIR_WARN("Unable to remove host device cgroup ACL on hotplug fail");
|
VIR_WARN("Unable to remove host device cgroup ACL on hotplug fail");
|
||||||
@ -4583,7 +4583,7 @@ qemuDomainRemoveMemoryDevice(virQEMUDriver *driver,
|
|||||||
ignore_value(qemuProcessRefreshBalloonState(vm, VIR_ASYNC_JOB_NONE));
|
ignore_value(qemuProcessRefreshBalloonState(vm, VIR_ASYNC_JOB_NONE));
|
||||||
|
|
||||||
/* decrease the mlock limit after memory unplug if necessary */
|
/* decrease the mlock limit after memory unplug if necessary */
|
||||||
ignore_value(qemuDomainAdjustMaxMemLock(vm, false));
|
ignore_value(qemuDomainAdjustMaxMemLock(vm));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -4690,7 +4690,7 @@ qemuDomainRemoveHostDevice(virQEMUDriver *driver,
|
|||||||
qemuDomainRemovePCIHostDevice(driver, vm, hostdev);
|
qemuDomainRemovePCIHostDevice(driver, vm, hostdev);
|
||||||
/* QEMU might no longer need to lock as much memory, eg. we just
|
/* QEMU might no longer need to lock as much memory, eg. we just
|
||||||
* detached the last VFIO device, so adjust the limit here */
|
* 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");
|
VIR_WARN("Failed to adjust locked memory limit");
|
||||||
break;
|
break;
|
||||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB:
|
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB:
|
||||||
|
Loading…
Reference in New Issue
Block a user