On 02/21/2017 08:14 AM, Marc-André Lureau wrote: > Allows to specify which slot to look for the device.
"Allow[s] to ${verb}" is not idiomatic; it's missing a subject. But "Allows $subject to" (as in "allows someone to" or "allows me to") is wordy, compared to just saying "Allows ${verb}ing". I'd suggest: Allow specifying which slot to favor when looking for the device. > > This will be used in the following patch to avoid leaking when multiple > devices exists and we want to lookup the hotplug one. > > Signed-off-by: Marc-André Lureau <marcandre.lur...@redhat.com> > --- > tests/libqos/virtio-pci.h | 4 ++-- > tests/libqos/virtio-pci.c | 31 ++++++++++++++++++++++++++----- > 2 files changed, 28 insertions(+), 7 deletions(-) > > @@ -55,10 +57,11 @@ static void qvirtio_pci_foreach_callback( > QVirtioPCIForeachData *d = data; > QVirtioPCIDevice *vpcidev = qpcidevice_to_qvirtiodevice(dev); > > - if (vpcidev->vdev.device_type == d->device_type) { > + if (vpcidev->vdev.device_type == d->device_type && > + (!d->has_slot || vpcidev->pdev->devfn == d->slot << 3)) { > d->func(&vpcidev->vdev, d->user_data); > } else { > - g_free(vpcidev); > + qvirtio_pci_device_free(vpcidev); Is this an unmentioned leak plug? Either it should be mentioned, or squashed into the leak fix of 29. With those cleanups, Reviewed-by: Eric Blake <ebl...@redhat.com> -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature