From patchwork Mon Jan 30 12:22:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 721461 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vBq9d359Jz9sXx for ; Mon, 30 Jan 2017 23:55:01 +1100 (AEDT) Received: from localhost ([::1]:60130 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cYBU2-0002Dm-Um for incoming@patchwork.ozlabs.org; Mon, 30 Jan 2017 07:54:59 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48073) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cYAyG-0007IG-Tk for qemu-devel@nongnu.org; Mon, 30 Jan 2017 07:22:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cYAyC-0002eE-1V for qemu-devel@nongnu.org; Mon, 30 Jan 2017 07:22:08 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44740) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cYAyB-0002dz-SL; Mon, 30 Jan 2017 07:22:03 -0500 Received: from smtp.corp.redhat.com (int-mx16.intmail.prod.int.phx2.redhat.com [10.5.11.28]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4E2A280F63; Mon, 30 Jan 2017 12:22:03 +0000 (UTC) Received: from thh440s.redhat.com (ovpn-116-73.ams2.redhat.com [10.36.116.73]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0780CB5BDA; Mon, 30 Jan 2017 12:22:01 +0000 (UTC) From: Thomas Huth To: Alistair Francis , qemu-devel@nongnu.org Date: Mon, 30 Jan 2017 13:22:01 +0100 Message-Id: <1485778921-20869-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.74 on 10.5.11.28 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 30 Jan 2017 12:22:03 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2] hw/core/register: Mark the device with cannot_instantiate_with_device_add_yet X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Peter Maydell , Markus Armbruster Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The "qemu,register" device needs to be wired up in source code, there is no way the user can add this device with the "-device" parameter or the "device_add" monitor command yet. Signed-off-by: Thomas Huth Reviewed-by: Markus Armbruster --- v2: Changed patch description and comment hw/core/register.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hw/core/register.c b/hw/core/register.c index 4bfbc50..1416691 100644 --- a/hw/core/register.c +++ b/hw/core/register.c @@ -274,9 +274,18 @@ void register_finalize_block(RegisterInfoArray *r_array) g_free(r_array); } +static void register_class_init(ObjectClass *oc, void *data) +{ + DeviceClass *dc = DEVICE_CLASS(oc); + + /* Needs to be wired up in source code, see register_init_block32() */ + dc->cannot_instantiate_with_device_add_yet = true; +} + static const TypeInfo register_info = { .name = TYPE_REGISTER, .parent = TYPE_DEVICE, + .class_init = register_class_init, }; static void register_register_types(void)