target-s390x: QOM'ify CPU
Embed CPUS390XState as first member of S390CPU.
Since -cpu is being ignored, make TYPE_S390_CPU non-abstract.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Tested-by: Christian Borntraeger <borntraeger@de.ibm.com>
diff --git a/target-s390x/helper.c b/target-s390x/helper.c
index 44d5048..ae57ab3 100644
--- a/target-s390x/helper.c
+++ b/target-s390x/helper.c
@@ -70,6 +70,7 @@
CPUS390XState *cpu_s390x_init(const char *cpu_model)
{
+ S390CPU *cpu;
CPUS390XState *env;
#if !defined (CONFIG_USER_ONLY)
struct tm tm;
@@ -77,7 +78,8 @@
static int inited = 0;
static int cpu_num = 0;
- env = g_malloc0(sizeof(CPUS390XState));
+ cpu = S390_CPU(object_new(TYPE_S390_CPU));
+ env = &cpu->env;
cpu_exec_init(env);
if (tcg_enabled() && !inited) {
inited = 1;