qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC 0/8]: QError v2


From: Markus Armbruster
Subject: Re: [Qemu-devel] [RFC 0/8]: QError v2
Date: Wed, 18 Nov 2009 16:53:37 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Anthony Liguori <address@hidden> writes:

> Luiz Capitulino wrote:
>>
>>> #define QERR_DEVICE_ALREADY_OPEN "{'class': 'DeviceAlreadyOpen',
>>> data' : {'bus_num': %d, 'addr': %d}"
>>>
>>> qemu_error_new(QERR_DEVICE_ALREADY_OPEN, bus_num, addr);
>>>     
>>
>>  What about DeviceAlreadyOpen errors with a different argument list?
>>   
>
> Why would you have this?  That would seem like a problem to me.  I
> think the errors need to be very well structured (just like everything
> else in QMP).
>
>>> That gives us a nice simple interface with full error checking on
>>> the parameters.
>>>     
>>
>>  I've said this is not so simple because people writing those macros
>> would find out that the 'class' or 'data' _keys_ are missing or incorrect
>> only at run-time, when the error is triggered.
>>   
>
> Sure but introducing new types of errors is not the common case.
> Using existing errors is the common case.

Careful.  (Valid) reuse of existing errors may be more common, but
proper creation of new errors is important.  If you make that too hard
compared to reuse, you risk abuse of existing errors for cases where
they don't quite fit.

[...]




reply via email to

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