From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34775) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJRAg-0006Pf-CA for qemu-devel@nongnu.org; Thu, 05 Feb 2015 13:29:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YJRAb-0005T9-AO for qemu-devel@nongnu.org; Thu, 05 Feb 2015 13:28:58 -0500 Received: from cantor2.suse.de ([195.135.220.15]:40411 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJRAb-0005Sz-3p for qemu-devel@nongnu.org; Thu, 05 Feb 2015 13:28:53 -0500 Message-ID: <54D3B662.5080303@suse.de> Date: Thu, 05 Feb 2015 19:28:50 +0100 From: =?windows-1252?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1423128555-18018-1-git-send-email-armbru@redhat.com> <20150205135114.36582c1f@nial.brq.redhat.com> In-Reply-To: <20150205135114.36582c1f@nial.brq.redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 1/1] target-i386: Clean up misuse of qdev_init() in realize method List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov , Markus Armbruster Cc: qemu-devel@nongnu.org Am 05.02.2015 um 13:51 schrieb Igor Mammedov: > On Thu, 5 Feb 2015 10:29:15 +0100 > Markus Armbruster wrote: >=20 >> x86_cpu_apic_realize() calls qdev_init() to realize the APIC. >> qdev_init()'s error handling has unwanted side effects: it unparents >> the device, and it calls qerror_report_err(). >> >> 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, qdev_init() can't actually fail here, because realize >> can't fail for any of the three possible APIC device models. >> >> Clean up by cutting out the qdev_init() middle-man: set property >> "realized" directly. >> >> Signed-off-by: Markus Armbruster >=20 > Reviewed-by: Igor Mammedov Thanks, applied to qom-cpu: https://github.com/afaerber/qemu-cpu/commits/qom-cpu Andreas --=20 SUSE Linux GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Felix Imend=F6rffer, Jane Smithard, Jennifer Guild, Dilip Upmanyu, Graham Norton; HRB 21284 (AG N=FCrnberg)