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

2015-11-18 Thread Peter Krempa
On Wed, Nov 18, 2015 at 15:13:18 +0100, 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

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

2015-11-18 Thread Andrea Bolognani
On Wed, 2015-11-18 at 16:17 +0100, Peter Krempa wrote: > > +/* QEMU might no longer need to lock as much memory, eg. we just > > detached > > + * a VFIO device, so adjust the limit here */ > > +if (qemuDomainRequiresMlock(vm->def)) > > +if (virProcessSetMaxMemLock(vm->pid, > >

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

2015-11-18 Thread Peter Krempa
On Wed, Nov 18, 2015 at 17:04:55 +0100, Andrea Bolognani wrote: > On Wed, 2015-11-18 at 16:17 +0100, Peter Krempa wrote: > > > +/* QEMU might no longer need to lock as much memory, eg. we just > > > detached > > > + * a VFIO device, so adjust the limit here */ > > > +if

[libvirt] [PATCH 4/6] qemu: Reduce memlock limit after detaching hostdev

2015-11-18 Thread Andrea Bolognani
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 |