Received: from eggs.gnu.org ([2001:4830:134:3::10]:56368) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLzGw-00089Y-GW for qemu-devel@nongnu.org; Fri, 07 Mar 2014 13:13:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WLzGq-0000fn-Hb for qemu-devel@nongnu.org; Fri, 07 Mar 2014 13:13:26 -0500 Received: from cantor2.suse.de ([195.135.220.15]:44137 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLzGq-0000fh-CR for qemu-devel@nongnu.org; Fri, 07 Mar 2014 13:13:20 -0500 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Fri, 7 Mar 2014 19:13:18 +0100 Message-Id: <1394215998-10830-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH] qdev: Fix bus dependency of DeviceState::hotpluggable getter List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Igor Mammedov , =?UTF-8?q?Andreas=20F=C3=A4rber?= , mst@redhat.com Commit 1a37eca107cece3ed454bae29eef0bd1fac4a244 (qdev: add "hotpluggable" property to Device) added a property "hotpluggable" to each device, with its getter accessing parent_bus->allow_hotplug. Add a NULL check. Cc: Igor Mammedov Signed-off-by: Andreas F=C3=A4rber --- hw/core/qdev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/core/qdev.c b/hw/core/qdev.c index 749c83a..cb07863 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -735,7 +735,8 @@ static bool device_get_hotpluggable(Object *obj, Erro= r **err) DeviceClass *dc =3D DEVICE_GET_CLASS(obj); DeviceState *dev =3D DEVICE(obj); =20 - return dc->hotpluggable && dev->parent_bus->allow_hotplug; + return dc->hotpluggable && (dev->parent_bus =3D=3D NULL || + dev->parent_bus->allow_hotplug); } =20 static void device_initfn(Object *obj) --=20 1.8.4.5