From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37195) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJIpz-0006pa-Jh for qemu-devel@nongnu.org; Thu, 05 Feb 2015 04:35:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YJIpp-0002EE-Og for qemu-devel@nongnu.org; Thu, 05 Feb 2015 04:35:03 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34518) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJIpp-0002E0-Hz for qemu-devel@nongnu.org; Thu, 05 Feb 2015 04:34:53 -0500 From: Markus Armbruster Date: Thu, 5 Feb 2015 10:34:46 +0100 Message-Id: <1423128889-18260-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [PATCH 0/3] Clean up misuse of qdev_init() in interrupt controller creation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: afaerber@suse.de qdev_init()'s error handling has side effects: it unparents the device, and it calls qerror_report_err(). Unparenting is wanted in realize methods only when we do unusual things like trying a set of devices and keeping the first one that works. This is the case in PATCH 1+2. qerror_report_err() is always inappropriate in realize methods, because it doesn't return the Error object. It either reports the error to stderr or the human monitor, or it stores it in the QMP monitor, where it makes the QMP command fail even though the realize method succeeded. Fortunately, none of the realize methods in this patch are reachable from QMP. Markus Armbruster (3): PPC: Clean up misuse of qdev_init() in kvm-openpic creation spapr: Clean up misuse of qdev_init() in xics-kvm creation s390x: Replace unchecked qdev_init() by qdev_init_nofail() hw/intc/s390_flic.c | 6 +----- hw/ppc/e500.c | 20 +++++++++++--------- hw/ppc/spapr.c | 25 ++++++++++++------------- 3 files changed, 24 insertions(+), 27 deletions(-) -- 1.9.3