qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Luiz Capitulino <lcapitulino@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Anthony Liguori <aliguori@us.ibm.com>,
	qemu-devel@nongnu.org, patches@linaro.org
Subject: Re: [Qemu-devel] [PATCH 0/2] qom: detect attempts to add a property that already exists
Date: Mon, 22 Oct 2012 13:35:20 -0200	[thread overview]
Message-ID: <20121022133520.5515bd9f@doriath.home> (raw)
In-Reply-To: <1350667146-26273-1-git-send-email-peter.maydell@linaro.org>

On Fri, 19 Oct 2012 18:19:04 +0100
Peter Maydell <peter.maydell@linaro.org> 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(-)
> 

  parent reply	other threads:[~2012-10-22 15:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-19 17:19 [Qemu-devel] [PATCH 0/2] qom: detect attempts to add a property that already exists Peter Maydell
2012-10-19 17:19 ` [Qemu-devel] [PATCH 1/2] error: Distinguish critical and non-critical errors Peter Maydell
2012-10-19 17:19 ` [Qemu-devel] [PATCH 2/2] qom: Detect attempts to add a property that already exists Peter Maydell
2012-10-22 15:35 ` Luiz Capitulino [this message]
2012-10-22 16:26   ` [Qemu-devel] [PATCH 0/2] qom: detect " Peter Maydell
2012-10-22 16:51     ` Luiz Capitulino

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121022133520.5515bd9f@doriath.home \
    --to=lcapitulino@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=patches@linaro.org \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).