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:
Shivaprasad G Bhat 2017-06-30 13:56:08 +05:30 committed by Andrea Bolognani
parent d54bc07820
commit 210dd0c58d

View File

@ -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];