• E
    qemu: Adjust max memlock on mdev hotplug · fe39e1b1
    Eric Farman 提交于
    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: NEric Farman <farman@linux.ibm.com>
    Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
    Reviewed-by: NPavel Hrdina <phrdina@redhat.com>
    fe39e1b1
qemu_hotplug.c 211.3 KB