From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58064) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WwxOI-0008Vz-Cu for qemu-devel@nongnu.org; Tue, 17 Jun 2014 13:41:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WwxOB-0005CA-ID for qemu-devel@nongnu.org; Tue, 17 Jun 2014 13:41:50 -0400 Date: Tue, 17 Jun 2014 20:42:07 +0300 From: "Michael S. Tsirkin" Message-ID: <1403021756-15960-95-git-send-email-mst@redhat.com> References: <1403021756-15960-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <1403021756-15960-1-git-send-email-mst@redhat.com> Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL 094/103] qdev: reorganize error reporting in bus_set_realized List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Peter Crosthwaite , qemu-stable@nongnu.org, Anthony Liguori , Paolo Bonzini , Igor Mammedov , =?us-ascii?B?PT9VVEYtOD9xP0FuZHJlYXM9MjBGPUMzPUE0cmJlcj89?= From: Paolo Bonzini No semantic change. Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini Tested-by: Michael S. Tsirkin Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Andreas F=E4rber --- hw/core/qdev.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/hw/core/qdev.c b/hw/core/qdev.c index 3226a71..65aa041 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -573,27 +573,19 @@ static void bus_set_realized(Object *obj, bool valu= e, Error **errp) if (value && !bus->realized) { if (bc->realize) { bc->realize(bus, &local_err); - - if (local_err !=3D NULL) { - goto error; - } - } } else if (!value && bus->realized) { if (bc->unrealize) { bc->unrealize(bus, &local_err); - - if (local_err !=3D NULL) { - goto error; - } } } =20 - bus->realized =3D value; - return; + if (local_err !=3D NULL) { + error_propagate(errp, local_err); + return; + } =20 -error: - error_propagate(errp, local_err); + bus->realized =3D value; } =20 void qbus_create_inplace(void *bus, size_t size, const char *typename, --=20 MST