vDPA block devices will also need the same consideration for memlock
limits as other vdpa devices, so consider these devices when calculating
memlock limits.
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
static int
-qemuDomainGetNumVDPANetDevices(const virDomainDef *def)
+qemuDomainGetNumVDPADevices(const virDomainDef *def)
{
size_t i;
int n = 0;
n++;
}
+ for (i = 0; i < def->ndisks; i++) {
+ virStorageSource *src;
+ for (src = def->disks[i]->src; src; src = src->backingStore) {
+ if (src->type == VIR_STORAGE_TYPE_VHOST_VDPA)
+ n++;
+ }
+ }
+
return n;
}
nvfio = qemuDomainGetNumVFIOHostdevs(def);
nnvme = qemuDomainGetNumNVMeDisks(def);
- nvdpa = qemuDomainGetNumVDPANetDevices(def);
+ nvdpa = qemuDomainGetNumVDPADevices(def);
/* For device passthrough using VFIO the guest memory and MMIO memory
* regions need to be locked persistent in order to allow DMA.
*