qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: Paul Brook <paul@codesourcery.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] qdev: add return value to init() callbacks.
Date: Thu, 13 Aug 2009 09:48:50 +0200	[thread overview]
Message-ID: <4A83C562.1090802@redhat.com> (raw)
In-Reply-To: <873a7w2q6n.fsf@pike.pond.sub.org>

On 08/13/09 08:17, Markus Armbruster wrote:

> One problem with passing up error codes is diagnostics: when we reach
> the point where we can decide on policy, we've lost the context for
> precise diagnostics.  net.c tackles that problem by passing the
> destination for diagnostics down, to let code report errors with
> config_error() while remaining unaware of policy.

I don't want pass additional arguments all the way down just for error 
reporting.  One thing we can do is storing the error message in a global 
or thread-local variable (much like errno).  We could also add a errmsg 
field to DeviceState and use that.

> Issue also exists elsewhere.  Try monitor command "pci_add auto
> model=?".

Thats why I'd tend to use a global variable.  It also works in case 
don't have a DeviceState.

cheers,
   Gerd

  reply	other threads:[~2009-08-13  7:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-12 15:59 [Qemu-devel] [PATCH] qdev: add return value to init() callbacks Gerd Hoffmann
2009-08-12 17:00 ` Markus Armbruster
2009-08-12 19:28 ` Paul Brook
2009-08-12 19:47   ` Gerd Hoffmann
2009-08-13  6:17     ` Markus Armbruster
2009-08-13  7:48       ` Gerd Hoffmann [this message]
2009-08-13  9:06         ` Markus Armbruster
2009-08-13 11:05           ` Gerd Hoffmann
2009-08-13 11:42             ` Markus Armbruster
2009-08-13 14:31               ` Gerd Hoffmann
2009-08-13 17:22                 ` Markus Armbruster

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=4A83C562.1090802@redhat.com \
    --to=kraxel@redhat.com \
    --cc=armbru@redhat.com \
    --cc=paul@codesourcery.com \
    --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).