]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: Adjust max memlock on mdev hotplug
authorEric Farman <farman@linux.ibm.com>
Tue, 3 Sep 2019 20:09:48 +0000 (22:09 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Mon, 9 Sep 2019 14:39:52 +0000 (16:39 +0200)
commitfe39e1b181bbe10aa08868fc132315a569bfb730
tree3fc36465d9e640a7cd50f2a0f84f1731166bd53c
parent94714594c5a868ba9739a7d5bd1d7d7771f730b3
qemu: Adjust max memlock on mdev hotplug

When starting a domain, we use the presence of a vfio-pci or
mdev hostdev to determine if the memlock maximum needs to be
increased.  But if we hotplug either of these devices, only the
vfio-pci path gets that love.  This means that attaching a, say,
vfio-ccw device will appear to succeed but the device may be
unusable as the guest may see I/O errors on long CCW chains.
The host, meanwhile, would be flooded with these messages:

  vfio_pin_page_external: Task qemu-system-s39 (11584) RLIMIT_MEMLOCK (65536) exceeded

Let's adjust the maximum memlock value in the mdev hotplug path,
so that the domain has the same value as if it were started with
one or more mdev devices in its configuration.

Signed-off-by: Eric Farman <farman@linux.ibm.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
src/qemu/qemu_hotplug.c