Re: [PATCH 5/6] qemu: Reduce memlock limit after detaching hostdev

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 11/24/2015 08:56 AM, Andrea Bolognani wrote:
> We increase the limit before plugging in a PCI hostdev or a memory
> module because some memory might need to be locked due to eg. VFIO.
> 
> Of course we should do the opposite after unplugging a device: this
> was already the case for memory modules, but not for hostdevs.
> ---
>  src/qemu/qemu_hotplug.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
> index a5c134a..04baeff 100644
> --- a/src/qemu/qemu_hotplug.c
> +++ b/src/qemu/qemu_hotplug.c
> @@ -3070,6 +3070,12 @@ qemuDomainRemoveHostDevice(virQEMUDriverPtr driver,
>          networkReleaseActualDevice(vm->def, net);
>          virDomainNetDefFree(net);
>      }
> +
> +    /* QEMU might no longer need to lock as much memory, eg. we just detached
> +     * a VFIO device, so adjust the limit here */
> +    if (qemuDomainAdjustMaxMemLock(vm) < 0)
> +        VIR_WARN("Failed to adjust locked memory limit");
> +
>      ret = 0;
>  
>   cleanup:
> 


Since the add was in qemuDomainAttachHostPCIDevice, why is the remove
not in qemuDomainDetachHostPCIDevice?  Doing it here would mean it's
call for any host device removal - whether or not it was ever added.

John

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]