qemu: Allow forcing VFIO when computing memlock limit

With NVMe disks, one can start a blockjob with a NVMe disk
that is not visible in domain XML (at least right away). Usually,
it's fairly easy to override this limitation of
qemuDomainGetMemLockLimitBytes() - for instance for hostdevs we
temporarily add the device to domain def, let the function
calculate the limit and then remove the device. But it's not so
easy with virStorageSourcePtr - in some cases they don't
necessarily are attached to a disk. And even if they are it's
done later in the process and frankly, I find it too complicated
to be able to use the simple trick we use with hostdevs.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
Michal Privoznik
2019-09-26 13:15:47 +02:00
parent da27be1b09
commit 6edb4321b2
5 changed files with 41 additions and 27 deletions

View File

@@ -42,7 +42,7 @@ testCompareMemLock(const void *data)
goto cleanup;
}
ret = virTestCompareToULL(info->memlock, qemuDomainGetMemLockLimitBytes(def));
ret = virTestCompareToULL(info->memlock, qemuDomainGetMemLockLimitBytes(def, false));
cleanup:
virDomainDefFree(def);