qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 28/30] tests: add specialized device_find fun


From: Marc-André Lureau
Subject: Re: [Qemu-devel] [PATCH v2 28/30] tests: add specialized device_find function
Date: Wed, 01 Mar 2017 07:59:34 +0000

On Wed, Mar 1, 2017 at 3:22 AM Eric Blake <address@hidden> wrote:

> 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 <address@hidden>
> > ---
> >  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.
>

I'll move it there, thanks

>
> With those cleanups,
> Reviewed-by: Eric Blake <address@hidden>
>
> --
> Eric Blake   eblake redhat com    +1-919-301-3266 <+1%20919-301-3266>
> Libvirt virtualization library http://libvirt.org
>
> --
Marc-André Lureau


reply via email to

[Prev in Thread] Current Thread [Next in Thread]