]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: set qemu process' RLIMIT_MEMLOCK when VFIO is used
authorLaine Stump <laine@laine.org>
Thu, 25 Apr 2013 16:45:55 +0000 (12:45 -0400)
committerLaine Stump <laine@laine.org>
Fri, 26 Apr 2013 14:23:46 +0000 (10:23 -0400)
commit939589458553e3d0d5972859c6434e9856682e17
treee4721b94a3270faa1343b37dd03cb189b672cd7d
parent7bdf459d2cb5bd5ddaf7ad05353cc6610bb4a783
qemu: set qemu process' RLIMIT_MEMLOCK when VFIO is used

VFIO requires all of the guest's memory and IO space to be lockable in
RAM. The domain's max_balloon is the maximum amount of memory the
domain can have (in KiB). We add a generous 1GiB to that for IO space
(still much better than KVM device assignment, where the KVM module
actually *ignores* the process limits and locks everything anyway),
and convert from KiB to bytes.

In the case of hotplug, we are changing the limit for the already
existing qemu process (prlimit() is used under the hood), and for
regular commandline additions of vfio devices, we schedule a call to
setrlimit() that will happen after the qemu process is forked.
src/qemu/qemu_command.c
src/qemu/qemu_hotplug.c