From 41868f846d2ca5865c1706dc6529964bfa3dac6c Mon Sep 17 00:00:00 2001 From: David Hildenbrand Date: Mon, 5 Sep 2016 10:52:16 +0200 Subject: s390x/cpumodel: "host" and "qemu" as CPU subclasses This patch introduces two CPU models, "host" and "qemu". "qemu" is used as default when running under TCG. "host" is used as default when running under KVM. "host" cannot be used without KVM. "host" is not migration-safe. They both inherit from the base s390x CPU, which is turned into an abstract class. This patch also changes CPU creation to take care of the passed CPU string and reuses common code parse_features() function for that purpose. Unknown CPU definitions are now reported. The "-cpu ?" and "query-cpu-definition" commands are changed to list all CPU subclasses automatically, including migration-safety and whether static. Acked-by: Cornelia Huck Signed-off-by: David Hildenbrand Message-Id: <20160905085244.99980-3-dahi@linux.vnet.ibm.com> [CH: fix up self-assignments in s390_cpu_list, as spotted by clang] Signed-off-by: Cornelia Huck --- hw/s390x/s390-virtio.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'hw') diff --git a/hw/s390x/s390-virtio.c b/hw/s390x/s390-virtio.c index 544c616..0a96347 100644 --- a/hw/s390x/s390-virtio.c +++ b/hw/s390x/s390-virtio.c @@ -101,7 +101,11 @@ void s390_init_cpus(MachineState *machine) gchar *name; if (machine->cpu_model == NULL) { - machine->cpu_model = "host"; + if (kvm_enabled()) { + machine->cpu_model = "host"; + } else { + machine->cpu_model = "qemu"; + } } cpu_states = g_new0(S390CPU *, max_cpus); -- cgit v1.1