qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 1/6] hw/ide: Convert DeviceClass init to real


From: John Snow
Subject: Re: [Qemu-devel] [PATCH v2 1/6] hw/ide: Convert DeviceClass init to realize
Date: Fri, 15 Sep 2017 17:46:09 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0


On 09/15/2017 05:42 PM, Eric Blake wrote:
> On 09/15/2017 04:35 PM, John Snow wrote:
>>
>>
>> On 08/04/2017 06:26 AM, Mao Zhongyi wrote:
>>> Replace init with realize in IDEDeviceClass, which has errp
>>> as a parameter. So all the implementations now use error_setg
>>> instead of error_report for reporting error.
>>>
> 
>>> @@ -2398,7 +2399,7 @@ int ide_init_drive(IDEState *s, BlockBackend *blk, 
>>> IDEDriveKind kind,
>>>                     const char *version, const char *serial, const char 
>>> *model,
>>>                     uint64_t wwn,
>>>                     uint32_t cylinders, uint32_t heads, uint32_t secs,
>>> -                   int chs_trans)
>>> +                   int chs_trans, Error **errp)
>>
>> this function now requires an additional invariant, which is that we
>> must return -1 AND set errp. Probably wisest to just get rid of the
>> return code so that we don't accidentally goof this up in the future.
>>
>> I think Markus has had some guidance on this in the past, but admittedly
>> I can't remember his preference.
> 

[...]

> So these days, the preference is to KEEP the redundancy rather than
> eliminate it, due to ease-of-use concerns.
> 

OK, that's fine. I only want consistency with whatever the
paradigm-du-jour is for error handling. Thanks for the quick rebuttal.

--js



reply via email to

[Prev in Thread] Current Thread [Next in Thread]