qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PULL 00/14] Cleanup qdev legacy properties


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PULL 00/14] Cleanup qdev legacy properties
Date: Mon, 10 Feb 2014 17:01:46 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux)

Andreas Färber <address@hidden> writes:

> Am 10.02.2014 10:20, schrieb Markus Armbruster:
[...]
>> You're right to challenge new uses of QERR_*, but the use you spotted is
>> appropriate, since we want consistency with the existing visitors.
>
> OK, I still don't fully understand the logic why sometimes we shouldn't
> use QERR_ at all, in some cases inline the error message for
> compatibility without reusing the QERR_ and sometimes can use QERR_
> directly, but I don't mind it getting applied that way - QERR_ is not my
> fight. :)

The general rule is to use ERROR_CLASS_GENERIC_ERROR except when
backward compatibility with existing usage requires another class.

Corollary: prefer error_setg() over error_set() then.

Corollary: prefer not to use the QERR_ macros then.

However, other considerations can overrule this preference.  Not the
rule, though!  In this particular case, the existing visitor code in the
same file uses QERR_INVALID_PARAMETER_TYPE (which has
ERROR_CLASS_GENERIC_ERROR), and the patch mimicks them for consistency.

[...]



reply via email to

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