mirror of https://github.com/xqemu/xqemu.git
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>
This commit is contained in:
parent
1da45e0c4c
commit
ba31cc7226
|
@ -72,10 +72,18 @@ static void cpu_core_instance_init(Object *obj)
|
||||||
core->nr_threads = smp_threads;
|
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 = {
|
static const TypeInfo cpu_core_type_info = {
|
||||||
.name = TYPE_CPU_CORE,
|
.name = TYPE_CPU_CORE,
|
||||||
.parent = TYPE_DEVICE,
|
.parent = TYPE_DEVICE,
|
||||||
.abstract = true,
|
.abstract = true,
|
||||||
|
.class_init = cpu_core_class_init,
|
||||||
.instance_size = sizeof(CPUCore),
|
.instance_size = sizeof(CPUCore),
|
||||||
.instance_init = cpu_core_instance_init,
|
.instance_init = cpu_core_instance_init,
|
||||||
};
|
};
|
||||||
|
|
|
@ -26,6 +26,7 @@ typedef enum DeviceCategory {
|
||||||
DEVICE_CATEGORY_DISPLAY,
|
DEVICE_CATEGORY_DISPLAY,
|
||||||
DEVICE_CATEGORY_SOUND,
|
DEVICE_CATEGORY_SOUND,
|
||||||
DEVICE_CATEGORY_MISC,
|
DEVICE_CATEGORY_MISC,
|
||||||
|
DEVICE_CATEGORY_CPU,
|
||||||
DEVICE_CATEGORY_MAX
|
DEVICE_CATEGORY_MAX
|
||||||
} DeviceCategory;
|
} DeviceCategory;
|
||||||
|
|
||||||
|
|
|
@ -137,6 +137,7 @@ static void qdev_print_devinfos(bool show_no_user)
|
||||||
[DEVICE_CATEGORY_DISPLAY] = "Display",
|
[DEVICE_CATEGORY_DISPLAY] = "Display",
|
||||||
[DEVICE_CATEGORY_SOUND] = "Sound",
|
[DEVICE_CATEGORY_SOUND] = "Sound",
|
||||||
[DEVICE_CATEGORY_MISC] = "Misc",
|
[DEVICE_CATEGORY_MISC] = "Misc",
|
||||||
|
[DEVICE_CATEGORY_CPU] = "CPU",
|
||||||
[DEVICE_CATEGORY_MAX] = "Uncategorized",
|
[DEVICE_CATEGORY_MAX] = "Uncategorized",
|
||||||
};
|
};
|
||||||
GSList *list, *elt;
|
GSList *list, *elt;
|
||||||
|
|
|
@ -415,6 +415,7 @@ static void cpu_class_init(ObjectClass *klass, void *data)
|
||||||
k->cpu_exec_enter = cpu_common_noop;
|
k->cpu_exec_enter = cpu_common_noop;
|
||||||
k->cpu_exec_exit = cpu_common_noop;
|
k->cpu_exec_exit = cpu_common_noop;
|
||||||
k->cpu_exec_interrupt = cpu_common_exec_interrupt;
|
k->cpu_exec_interrupt = cpu_common_exec_interrupt;
|
||||||
|
set_bit(DEVICE_CATEGORY_CPU, dc->categories);
|
||||||
dc->realize = cpu_common_realizefn;
|
dc->realize = cpu_common_realizefn;
|
||||||
dc->unrealize = cpu_common_unrealizefn;
|
dc->unrealize = cpu_common_unrealizefn;
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue