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: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v2 28/30] tests: add specialized device_find function
Date: Tue, 28 Feb 2017 17:21:05 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0

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.

With those cleanups,
Reviewed-by: Eric Blake <address@hidden>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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