[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC PATCH] hw/misc/edu: support MSI interrupt
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [RFC PATCH] hw/misc/edu: support MSI interrupt |
Date: |
Wed, 28 Sep 2016 13:18:22 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 |
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