[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.
[...]
- [Qemu-devel] [PULL 11/14] block: handle "rechs" and "large" translation options, (continued)
- [Qemu-devel] [PULL 11/14] block: handle "rechs" and "large" translation options, Paolo Bonzini, 2014/02/08
- [Qemu-devel] [PULL 12/14] qdev: add enum property types to QAPI schema, Paolo Bonzini, 2014/02/08
- [Qemu-devel] [PULL 13/14] qdev: use QAPI type names for properties, Paolo Bonzini, 2014/02/08
- [Qemu-devel] [PULL 14/14] qapi: refine human printing of sizes, Paolo Bonzini, 2014/02/08
- [Qemu-devel] [PULL 07/14] qapi: add human mode to StringOutputVisitor, Paolo Bonzini, 2014/02/08
- Re: [Qemu-devel] [PULL 00/14] Cleanup qdev legacy properties, Andreas Färber, 2014/02/08