[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] qdev: add return value to init() callbacks.

From: Gerd Hoffmann
Subject: Re: [Qemu-devel] [PATCH] qdev: add return value to init() callbacks.
Date: Thu, 13 Aug 2009 09:48:50 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1b3pre) Gecko/20090513 Fedora/3.0-2.3.beta2.fc11 Lightning/1.0pre Thunderbird/3.0b2

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

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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]