From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43040) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TQK1P-00019F-Gy for qemu-devel@nongnu.org; Mon, 22 Oct 2012 11:34:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TQK1L-0003pJ-8K for qemu-devel@nongnu.org; Mon, 22 Oct 2012 11:34:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:27769) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TQK1K-0003p8-Tx for qemu-devel@nongnu.org; Mon, 22 Oct 2012 11:34:27 -0400 Date: Mon, 22 Oct 2012 13:35:20 -0200 From: Luiz Capitulino Message-ID: <20121022133520.5515bd9f@doriath.home> In-Reply-To: <1350667146-26273-1-git-send-email-peter.maydell@linaro.org> References: <1350667146-26273-1-git-send-email-peter.maydell@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 0/2] qom: detect attempts to add a property that already exists List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Paolo Bonzini , Anthony Liguori , qemu-devel@nongnu.org, patches@linaro.org On Fri, 19 Oct 2012 18:19:04 +0100 Peter Maydell wrote: > The aim of this patch series is to make QEMU exit with a helpful > error message for bugs where multiple properties of the same name > are accidentally added to a QOM object. Does this happen only at build-time or can it happen at command-line too? What about QMP/HMP? > In order to achieve this > for static properties whilst still allowing the hotplug case > to gracefully fail without killing QEMU, we add the concept > of a 'critical' error. A critical error is one which must be > handled somehow -- if we encounter a NULL Error** either when > the error is raised or later when it is propagated, we will > abort() rather than throwing the error away. This gives me the impression that we're fixing it in the wrong layer. Besides, all code calling error_propagate() today can now abort (at least in theory), but that's something we really don't want to happen in QMP. An alternative would be to let users set is_critical, but add a error_is_critical() function and let the code that wants to abort to check for it. But, how difficult it's to add a flag to QPM objects to allow/disallow multiple properties? > > (This is a bit different from the idea we initially discussed on > IRC, which was to have an error_propagate_or_abort() function, > but that approach would mean that the error would get thrown > away by intermediate functions such as qdev_property_add_static() > unless all those functions were changed too. I think this way > is more reliable.) > > Peter Maydell (2): > error: Distinguish critical and non-critical errors > qom: Detect attempts to add a property that already exists > > error.c | 38 ++++++++++++++++++++++++++++++++++---- > error.h | 12 ++++++++++++ > qom/object.c | 13 ++++++++++++- > 3 files changed, 58 insertions(+), 5 deletions(-) >