[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v9 04/11] msix: check msix_init's return value
From: |
Cao jin |
Subject: |
Re: [Qemu-devel] [PATCH v9 04/11] msix: check msix_init's return value |
Date: |
Thu, 19 Jan 2017 20:25:10 +0800 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 |
On 01/18/2017 11:21 PM, Michael S. Tsirkin wrote:
> On Wed, Jan 18, 2017 at 02:29:19PM +0800, Cao jin wrote:
>>
>>
>> On 01/18/2017 12:01 AM, Michael S. Tsirkin wrote:
>>> On Tue, Jan 17, 2017 at 02:50:38PM +0800, Cao jin wrote:
>>>> forget to cc maintainers in this new patch
>>>>
>>>> On 01/17/2017 02:18 PM, Cao jin wrote:
>>>>> Doesn't do it for megasas & hcd-xhci, later patches will fix them.
>>>>>
>>>>> Signed-off-by: Cao jin <address@hidden>
>>>
>>> I don't like this one, frankly. That's a bunch of code duplication.
>>
>> Yes, code duplication, seems inevitable if move the asserts into a
>> separate patch.
>>
>>> I suspect vfio is the only one who might reasonably get EINVAL here.
>>> So how about e.g. msix_validate_and_init that doesn't assert and use that
>>> from vfio, then switch msix_init to assert instead?
>>>
>>
>> Not sure if I get your idea. Do you mean: do param check via assert in
>> msix_init(), so that no need check its returned error outside, and
>> introduce new api msix_validate_and_init(same content as msix_init,
>> except param check) dedicated to vfio?
>
> Something like this.
>
>> If I understand you right, the way we do param check for msi_init[*] &
>> msix_init will be inconsistent.
>
> Right, we should consolidate these for msi too.
>
>
I got confused: for msi_init, convert assert to return -errno is a
choice from a long discussion:
http://lists.nongnu.org/archive/html/qemu-devel/2016-09/msg08215.html
then now we will revert again? And IIRC, I did use assert in msix_init
to do sanity test, and revert as suggest. And this is the way we have
done for msi_init: assert the return error outside. And if it need to
be modified as your suggestion, I see lots of place need to be taken
care, does that worth the trouble?
I see there is a simpler way helping us: drop this one from the
patchset, at least there is no regression, just a few devices doesn't
assert the return error while other(megasas, hcd-xhci) does. What would
you say?
--
Sincerely,
Cao jin
- [Qemu-devel] [PATCH v9 02/11] hcd-xhci: check & correct param before using it, (continued)
- [Qemu-devel] [PATCH v9 02/11] hcd-xhci: check & correct param before using it, Cao jin, 2017/01/17
- [Qemu-devel] [PATCH v9 01/11] msix: Follow CODING_STYLE, Cao jin, 2017/01/17
- [Qemu-devel] [PATCH v9 10/11] msi_init: convert assert to return -errno, Cao jin, 2017/01/17
- [Qemu-devel] [PATCH v9 05/11] megasas: change behaviour of msix switch, Cao jin, 2017/01/17
- [Qemu-devel] [PATCH v9 04/11] msix: check msix_init's return value, Cao jin, 2017/01/17
- Re: [Qemu-devel] [PATCH v9 04/11] msix: check msix_init's return value, Paolo Bonzini, 2017/01/24
- Re: [Qemu-devel] [PATCH v9 04/11] msix: check msix_init's return value, Michael S. Tsirkin, 2017/01/24
[Qemu-devel] [PATCH v9 03/11] pci: Convert msix_init() to Error and fix callers, Cao jin, 2017/01/17
[Qemu-devel] [PATCH v9 11/11] megasas: remove unnecessary megasas_use_msix(), Cao jin, 2017/01/17
[Qemu-devel] [PATCH v9 09/11] vmxnet3: remove unnecessary internal msix flag, Cao jin, 2017/01/17
[Qemu-devel] [PATCH v9 06/11] hcd-xhci: change behaviour of msix switch, Cao jin, 2017/01/17
[Qemu-devel] [PATCH v9 07/11] megasas: undo the overwrites of msi user configuration, Cao jin, 2017/01/17
[Qemu-devel] [PATCH v9 08/11] vmxnet3: fix reference leak issue, Cao jin, 2017/01/17