[libvirt] [PATCH 3/3] qemu: Adjust max memlock on mdev hotplug

Pavel Hrdina phrdina at redhat.com
Mon Sep 9 14:23:16 UTC 2019


On Tue, Sep 03, 2019 at 10:09:48PM +0200, Eric Farman wrote:
> 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.
> 
> (Note: I started trying to refactor qemuDomainAdjustMaxMemLockHostdev()
> to address the "A better way to handle this would be nice" comment,
> but the result was getting way too involved for the problem I was
> trying to fix.  Maybe another day.)

This paragraph doesn't belong into the commit message, I'll remove it
before pushing.

Otherwise looks good.

Reviewed-by: Pavel Hrdina <phrdina at redhat.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20190909/21f55658/attachment-0001.sig>


More information about the libvir-list mailing list