From patchwork Wed Jan 16 05:32:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 212414 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D22E62C008C for ; Wed, 16 Jan 2013 17:53:05 +1100 (EST) Received: from localhost ([::1]:36489 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvLdf-0004um-F9 for incoming@patchwork.ozlabs.org; Wed, 16 Jan 2013 00:34:15 -0500 Received: from eggs.gnu.org ([208.118.235.92]:39552) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvLcv-0003d4-Mu for qemu-devel@nongnu.org; Wed, 16 Jan 2013 00:33:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TvLcs-00082f-04 for qemu-devel@nongnu.org; Wed, 16 Jan 2013 00:33:29 -0500 Received: from cantor2.suse.de ([195.135.220.15]:59599 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvLcr-00082U-PC for qemu-devel@nongnu.org; Wed, 16 Jan 2013 00:33:25 -0500 Received: from relay1.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 49253A5202; Wed, 16 Jan 2013 06:33:25 +0100 (CET) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Wed, 16 Jan 2013 06:32:56 +0100 Message-Id: <1358314380-9400-12-git-send-email-afaerber@suse.de> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1358314380-9400-1-git-send-email-afaerber@suse.de> References: <1358314380-9400-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-Received-From: 195.135.220.15 Cc: Alexander Graf , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Richard Henderson Subject: [Qemu-devel] [RFC qom-cpu 11/15] target-s390x: Introduce QOM realizefn for S390CPU X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Introduce realizefn and set realized = true in cpu_s390x_init(). Signed-off-by: Andreas Färber --- target-s390x/cpu.c | 10 ++++++++++ target-s390x/helper.c | 4 +++- 2 Dateien geändert, 13 Zeilen hinzugefügt(+), 1 Zeile entfernt(-) diff --git a/target-s390x/cpu.c b/target-s390x/cpu.c index 2ed2312..94d8d93 100644 --- a/target-s390x/cpu.c +++ b/target-s390x/cpu.c @@ -45,6 +45,13 @@ static void s390_cpu_reset(CPUState *s) s390_add_running_cpu(env); } +static void s390_cpu_realizefn(DeviceState *dev, Error **errp) +{ + S390CPU *cpu = S390_CPU(dev); + + qemu_init_vcpu(&cpu->env); +} + static void s390_cpu_initfn(Object *obj) { S390CPU *cpu = S390_CPU(obj); @@ -73,6 +80,9 @@ static void s390_cpu_class_init(ObjectClass *oc, void *data) { S390CPUClass *scc = S390_CPU_CLASS(oc); CPUClass *cc = CPU_CLASS(scc); + DeviceClass *dc = DEVICE_CLASS(oc); + + dc->realize = s390_cpu_realizefn; scc->parent_reset = cc->reset; cc->reset = s390_cpu_reset; diff --git a/target-s390x/helper.c b/target-s390x/helper.c index 9a132e6..45020b2 100644 --- a/target-s390x/helper.c +++ b/target-s390x/helper.c @@ -85,7 +85,9 @@ S390CPU *cpu_s390x_init(const char *cpu_model) } env->cpu_model_str = cpu_model; - qemu_init_vcpu(env); + + object_property_set_bool(OBJECT(cpu), true, "realized", NULL); + return cpu; }