From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:59122) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsgE8-0008O8-Fh for qemu-devel@nongnu.org; Tue, 08 Jan 2013 15:56:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TsgE7-00057E-2g for qemu-devel@nongnu.org; Tue, 08 Jan 2013 15:56:52 -0500 Received: from cantor2.suse.de ([195.135.220.15]:45625 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsgE6-000574-QD for qemu-devel@nongnu.org; Tue, 08 Jan 2013 15:56:51 -0500 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Tue, 8 Jan 2013 21:56:23 +0100 Message-Id: <1357678594-427-7-git-send-email-afaerber@suse.de> In-Reply-To: <1357678594-427-1-git-send-email-afaerber@suse.de> References: <1357678594-427-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 06/17] cpu: Change parent type to Device List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Igor Mammedov , Eduardo Habkost , =?UTF-8?q?Andreas=20F=C3=A4rber?= From: Eduardo Habkost This finally makes the CPU class a subclass of the Device class, allowing us to start using DeviceState properties on CPU subclasses. It has no_user=3D1, as creating CPUs using -device doesn't work yet. Signed-off-by: Igor Mammedov Signed-off-by: Eduardo Habkost Signed-off-by: Andreas F=C3=A4rber --- include/qom/cpu.h | 6 +++--- qom/cpu.c | 6 ++++-- 2 Dateien ge=C3=A4ndert, 7 Zeilen hinzugef=C3=BCgt(+), 5 Zeilen entfernt= (-) diff --git a/include/qom/cpu.h b/include/qom/cpu.h index 3e9fc3a..fbacb27 100644 --- a/include/qom/cpu.h +++ b/include/qom/cpu.h @@ -20,7 +20,7 @@ #ifndef QEMU_CPU_H #define QEMU_CPU_H =20 -#include "qom/object.h" +#include "hw/qdev-core.h" #include "qemu/thread.h" =20 /** @@ -46,7 +46,7 @@ typedef struct CPUState CPUState; */ typedef struct CPUClass { /*< private >*/ - ObjectClass parent_class; + DeviceClass parent_class; /*< public >*/ =20 void (*reset)(CPUState *cpu); @@ -66,7 +66,7 @@ struct kvm_run; */ struct CPUState { /*< private >*/ - Object parent_obj; + DeviceState parent_obj; /*< public >*/ =20 struct QemuThread *thread; diff --git a/qom/cpu.c b/qom/cpu.c index d4d436f..49e5134 100644 --- a/qom/cpu.c +++ b/qom/cpu.c @@ -36,14 +36,16 @@ static void cpu_common_reset(CPUState *cpu) =20 static void cpu_class_init(ObjectClass *klass, void *data) { + DeviceClass *dc =3D DEVICE_CLASS(klass); CPUClass *k =3D CPU_CLASS(klass); =20 k->reset =3D cpu_common_reset; + dc->no_user =3D 1; } =20 -static TypeInfo cpu_type_info =3D { +static const TypeInfo cpu_type_info =3D { .name =3D TYPE_CPU, - .parent =3D TYPE_OBJECT, + .parent =3D TYPE_DEVICE, .instance_size =3D sizeof(CPUState), .abstract =3D true, .class_size =3D sizeof(CPUClass), --=20 1.7.10.4