On 28/09/2016 12:54, Peter Xu wrote:
> On Wed, Sep 28, 2016 at 06:42:50PM +0800, Peter Xu wrote:
> 
> [...]
> 
>>>> @@ -341,6 +351,7 @@ static void pci_edu_realize(PCIDevice *pdev, Error 
>>>> **errp)
>>>>                         edu, QEMU_THREAD_JOINABLE);
>>>>  
>>>>      pci_config_set_interrupt_pin(pci_conf, 1);
>>>> +    msi_init(pdev, 0, 1, false, false, errp);
>>>
>>> msi_init(pdev, 0, 1, false, false, &local_err);
>>> if (local_err) {
>>>     error_propagate(errp, local_err);
>>>     return;
>>> }
>>
>> Could I ask why we need the local_err?
> 
> I think I understand now. For this case, I beliveve I could also use:
> 
>   if (msi_init(..., errp)) {
>       return;
>   }

Right, I didn't check if msi_init returned a value.   For functions that
have a return value, there's no need for local_err.  It's only required
to detect failures in void functions.

Paolo

Reply via email to