Received: from eggs.gnu.org ([2001:4830:134:3::10]:36010) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WCtIz-0002Wp-9F for qemu-devel@nongnu.org; Mon, 10 Feb 2014 11:02:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WCtIu-0000Pj-Dr for qemu-devel@nongnu.org; Mon, 10 Feb 2014 11:01:57 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56297) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WCtIu-0000Op-57 for qemu-devel@nongnu.org; Mon, 10 Feb 2014 11:01:52 -0500 From: Markus Armbruster References: <1391853717-3837-1-git-send-email-pbonzini@redhat.com> <52F63E05.409@suse.de> <87iosnb9ya.fsf@blackfin.pond.sub.org> <52F8E551.8010605@suse.de> Date: Mon, 10 Feb 2014 17:01:46 +0100 In-Reply-To: <52F8E551.8010605@suse.de> ("Andreas =?utf-8?Q?F=C3=A4rber=22?= =?utf-8?Q?'s?= message of "Mon, 10 Feb 2014 15:42:25 +0100") Message-ID: <87wqh3yn11.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PULL 00/14] Cleanup qdev legacy properties List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andreas =?utf-8?Q?F=C3=A4rber?= Cc: Paolo Bonzini , qemu-devel@nongnu.org, Anthony Liguori , Peter Maydell Andreas F=C3=A4rber 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. [...]