qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 15/16] pci-assign: propagate errors from assign_


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 15/16] pci-assign: propagate errors from assign_intx()
Date: Tue, 29 Apr 2014 16:41:20 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0

On 04/10/2014 02:24 AM, Laszlo Ersek wrote:
> Among the callers, only assigned_initfn() should set the  monitor's stored

unintentional double space

> error. Other callers may run in contexts where the monitor's stored error
> makes no sense. For example:
> 
> assigned_dev_pci_write_config()
>   assigned_dev_update_msix()
>     assign_intx()
> 
> Signed-off-by: Laszlo Ersek <address@hidden>
> ---
>  hw/i386/kvm/pci-assign.c | 39 ++++++++++++++++++++++++++++-----------
>  1 file changed, 28 insertions(+), 11 deletions(-)
> 

> @@ -954,12 +954,15 @@ static void assigned_dev_update_irq_routing(PCIDevice 
> *dev)
>  {
>      AssignedDevice *assigned_dev = DO_UPCAST(AssignedDevice, dev, dev);
>      Error *err = NULL;
>      int r;
>  
> -    r = assign_intx(assigned_dev);
> +    r = assign_intx(assigned_dev, &err);
>      if (r < 0) {
> +        error_report("%s", error_get_pretty(err));
> +        error_free(err);
> +        err = NULL;

Rather than assigning err = NULL,

>          qdev_unplug(&dev->qdev, &err);
>          assert(!err);

why not also replace these two lines with the one-liner
 qdev_unplug(&dev->qdev, &error_abort);

I'm also a bit surprised this used 'err' instead of 'local_err'; but it
was pre-existing; I'm also not sure if the recent error cleanup patches
from Markus will impact this code.

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]