[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
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH v2 24/30] usb: replace handle_destroy with unrealize, (continued)
- [Qemu-devel] [PATCH v2 24/30] usb: replace handle_destroy with unrealize, Marc-André Lureau, 2017/02/21
- [Qemu-devel] [PATCH v2 26/30] tests: allows to run single test in usb-hcd-ehci-test, Marc-André Lureau, 2017/02/21
- [Qemu-devel] [PATCH v2 25/30] usb: release the created buses, Marc-André Lureau, 2017/02/21
- [Qemu-devel] [PATCH v2 27/30] tests: fix usb-test leaks, Marc-André Lureau, 2017/02/21
- [Qemu-devel] [PATCH v2 28/30] tests: add specialized device_find function, Marc-André Lureau, 2017/02/21
- Re: [Qemu-devel] [PATCH v2 28/30] tests: add specialized device_find function,
Eric Blake <=
- [Qemu-devel] [PATCH v2 30/30] migration: fix id leak regression, Marc-André Lureau, 2017/02/21
- Re: [Qemu-devel] [PATCH v2 30/30] migration: fix id leak regression, Dr. David Alan Gilbert, 2017/02/28
- [Qemu-devel] [PATCH v2 29/30] tests: fix virtio-blk-test leaks, Marc-André Lureau, 2017/02/21
- Re: [Qemu-devel] [PATCH v2 00/30] Various memory leak fixes, Marc-André Lureau, 2017/02/27