mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-21 20:15:17 +00:00
qemu: Take all PHBs into account while calculating memlock limits
Now that the multi-phb support series is in, work on the TODO at qemuDomainGetMemLockLimitBytes() to arrive at the correct memlock limit value. Signed-off-by: Shivaprasad G Bhat <sbhat@linux.vnet.ibm.com> Reviewed-by: Andrea Bolognani <abologna@redhat.com>
This commit is contained in:
parent
d54bc07820
commit
210dd0c58d
@ -6673,12 +6673,17 @@ qemuDomainGetMemLockLimitBytes(virDomainDefPtr def)
|
||||
unsigned long long memory;
|
||||
unsigned long long baseLimit;
|
||||
unsigned long long passthroughLimit;
|
||||
size_t nPCIHostBridges;
|
||||
size_t nPCIHostBridges = 0;
|
||||
bool usesVFIO = false;
|
||||
|
||||
/* TODO: Detect at runtime once we start using more than just
|
||||
* the default PCI Host Bridge */
|
||||
nPCIHostBridges = 1;
|
||||
for (i = 0; i < def->ncontrollers; i++) {
|
||||
virDomainControllerDefPtr cont = def->controllers[i];
|
||||
|
||||
if (!virDomainControllerIsPCIHostBridge(cont))
|
||||
continue;
|
||||
|
||||
nPCIHostBridges++;
|
||||
}
|
||||
|
||||
for (i = 0; i < def->nhostdevs; i++) {
|
||||
virDomainHostdevDefPtr dev = def->hostdevs[i];
|
||||
|
Loading…
x
Reference in New Issue
Block a user