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

2015-12-13 Thread Andrea Bolognani
On Thu, 2015-12-10 at 12:44 -0500, John Ferlan wrote: > > Calling qemuDomainAdjustMaxMemLock() more than necessary shouldn't > > really cause any harm, but adding a check for > > > >   hostdev->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI > > > > around the call is even better. > >

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

2015-12-13 Thread Andrea Bolognani
On Wed, 2015-12-09 at 15:15 -0500, John Ferlan wrote: > 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

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

2015-12-11 Thread Andrea Bolognani
On Thu, 2015-12-10 at 12:44 -0500, John Ferlan wrote: > > Calling qemuDomainAdjustMaxMemLock() more than necessary shouldn't > > really cause any harm, but adding a check for > > > >   hostdev->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI > > > > around the call is even better. > >

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

2015-12-10 Thread John Ferlan
On 12/10/2015 10:03 AM, Andrea Bolognani wrote: > On Wed, 2015-12-09 at 15:15 -0500, John Ferlan wrote: >> 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.

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

2015-12-10 Thread John Ferlan
On 12/10/2015 12:36 PM, Andrea Bolognani wrote: > On Thu, 2015-12-10 at 12:11 -0500, John Ferlan wrote: 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 -

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

2015-12-10 Thread Andrea Bolognani
On Thu, 2015-12-10 at 12:11 -0500, John Ferlan wrote: > > > 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. > > > > Because

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

2015-12-09 Thread John Ferlan
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

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

2015-11-24 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 |