From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:44548) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TRPGX-0004qp-Jp for qemu-devel@nongnu.org; Thu, 25 Oct 2012 11:22:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TRPGT-0006cs-Lb for qemu-devel@nongnu.org; Thu, 25 Oct 2012 11:22:37 -0400 Received: from 38.0.169.217.in-addr.arpa ([217.169.0.38]:52403 helo=mnementh.archaic.org.uk) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TRPGT-0006cU-Ez for qemu-devel@nongnu.org; Thu, 25 Oct 2012 11:22:33 -0400 From: Peter Maydell Date: Thu, 25 Oct 2012 16:22:27 +0100 Message-Id: <1351178549-5699-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PATCH v4 0/2] qdev: Detect duplicate device properties List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Anthony Liguori , patches@linaro.org So, v4 takes a different approach (again). The QOM level patch should be pretty uncontroversial, it just reports the duplicate via the Error**. Then in the qdev device_initfn we check for and report errors via assert_no_error() rather than just throwing them away. (In an ideal world maybe there'd be a way for the initfn to report the error up yet another level, but not with the current qdev API.) This time for sure! (I have a theory that passing NULL as an Error** is almost never a good idea. It's a shame it's the path of least resistance for using the API, it would be much better if the wrong thing was the hard thing to do.) Peter Maydell (2): qom: Detect attempts to add a property that already exists hw/qdev: Abort rather than ignoring errors adding device properties hw/qdev.c | 10 +++++++--- qom/object.c | 13 ++++++++++++- 2 files changed, 19 insertions(+), 4 deletions(-) -- 1.7.9.5