summary refs log tree commit diff stats
path: root/hw/cpu/core.c
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2017-01-20 14:01:16 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2017-01-27 18:07:31 +0100
commitba31cc7226ebcee639f18faa90c1542bd364fba3 (patch)
treedfdbb34ad6f79658cd2929f411f0bc19ac6d9277 /hw/cpu/core.c
parent1da45e0c4cf4719fa75898d019e0874b9b2bc774 (diff)
downloadfocaccia-qemu-ba31cc7226ebcee639f18faa90c1542bd364fba3.tar.gz
focaccia-qemu-ba31cc7226ebcee639f18faa90c1542bd364fba3.zip
Introduce DEVICE_CATEGORY_CPU for CPU devices
Now that CPUs show up in the help text of "-device ?",
we should group them into an appropriate category.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Message-Id: <1484917276-7107-1-git-send-email-thuth@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/cpu/core.c')
-rw-r--r--hw/cpu/core.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/hw/cpu/core.c b/hw/cpu/core.c
index eff90c12be..2bf960d6a8 100644
--- a/hw/cpu/core.c
+++ b/hw/cpu/core.c
@@ -72,10 +72,18 @@ static void cpu_core_instance_init(Object *obj)
     core->nr_threads = smp_threads;
 }
 
+static void cpu_core_class_init(ObjectClass *oc, void *data)
+{
+    DeviceClass *dc = DEVICE_CLASS(oc);
+
+    set_bit(DEVICE_CATEGORY_CPU, dc->categories);
+}
+
 static const TypeInfo cpu_core_type_info = {
     .name = TYPE_CPU_CORE,
     .parent = TYPE_DEVICE,
     .abstract = true,
+    .class_init = cpu_core_class_init,
     .instance_size = sizeof(CPUCore),
     .instance_init = cpu_core_instance_init,
 };