]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: Use qemuDomainRequiresMlock() when attaching PCI hostdev
authorAndrea Bolognani <abologna@redhat.com>
Wed, 18 Nov 2015 11:10:33 +0000 (12:10 +0100)
committerAndrea Bolognani <abologna@redhat.com>
Fri, 20 Nov 2015 09:25:14 +0000 (10:25 +0100)
commit79b8c97e995d2e8bc04fb9a3972e1875fad01e6d
tree2cdb6a274e0293f0609601c585547dcbf4dd552c
parentcf9bd256556cfa1343e4438e4807625c9e1af921
qemu: Use qemuDomainRequiresMlock() when attaching PCI hostdev

The function is used everywhere else to check whether the locked
memory limit should be set / updated, and it should be used here
as well.

Moreover, qemuDomainGetMlockLimitBytes() expects the hostdev to
have already been added to the domain definition, but we only do
that at the end of qemuDomainAttachHostPCIDevice(). Work around
the issue by adding the hostdev before adjusting the locked memory
limit and removing it immediately afterwards.
src/qemu/qemu_hotplug.c