mirror of https://github.com/xemu-project/xemu.git
qapi: keep names in 'CpuInstanceProperties' in sync with struct CPUCore
struct CPUCore uses 'id' suffix in the property name. As docs for query-hotpluggable-cpus state that the cpu core properties should be passed back to device_add by management in case new members are added and thus the names for the fields should be kept in sync. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> [dwg: Removed a duplicated word in comment] Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
62c9467dff
commit
27393c33d8
16
hmp.c
16
hmp.c
|
@ -2457,17 +2457,17 @@ void hmp_hotpluggable_cpus(Monitor *mon, const QDict *qdict)
|
||||||
|
|
||||||
c = l->value->props;
|
c = l->value->props;
|
||||||
monitor_printf(mon, " CPUInstance Properties:\n");
|
monitor_printf(mon, " CPUInstance Properties:\n");
|
||||||
if (c->has_node) {
|
if (c->has_node_id) {
|
||||||
monitor_printf(mon, " node: \"%" PRIu64 "\"\n", c->node);
|
monitor_printf(mon, " node-id: \"%" PRIu64 "\"\n", c->node_id);
|
||||||
}
|
}
|
||||||
if (c->has_socket) {
|
if (c->has_socket_id) {
|
||||||
monitor_printf(mon, " socket: \"%" PRIu64 "\"\n", c->socket);
|
monitor_printf(mon, " socket-id: \"%" PRIu64 "\"\n", c->socket_id);
|
||||||
}
|
}
|
||||||
if (c->has_core) {
|
if (c->has_core_id) {
|
||||||
monitor_printf(mon, " core: \"%" PRIu64 "\"\n", c->core);
|
monitor_printf(mon, " core-id: \"%" PRIu64 "\"\n", c->core_id);
|
||||||
}
|
}
|
||||||
if (c->has_thread) {
|
if (c->has_thread_id) {
|
||||||
monitor_printf(mon, " thread: \"%" PRIu64 "\"\n", c->thread);
|
monitor_printf(mon, " thread-id: \"%" PRIu64 "\"\n", c->thread_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
l = l->next;
|
l = l->next;
|
||||||
|
|
|
@ -2367,8 +2367,8 @@ static HotpluggableCPUList *spapr_query_hotpluggable_cpus(MachineState *machine)
|
||||||
|
|
||||||
cpu_item->type = spapr_get_cpu_core_type(machine->cpu_model);
|
cpu_item->type = spapr_get_cpu_core_type(machine->cpu_model);
|
||||||
cpu_item->vcpus_count = smp_threads;
|
cpu_item->vcpus_count = smp_threads;
|
||||||
cpu_props->has_core = true;
|
cpu_props->has_core_id = true;
|
||||||
cpu_props->core = i * smt;
|
cpu_props->core_id = i * smt;
|
||||||
/* TODO: add 'has_node/node' here to describe
|
/* TODO: add 'has_node/node' here to describe
|
||||||
to which node core belongs */
|
to which node core belongs */
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,9 @@ typedef struct CPUCore {
|
||||||
int nr_threads;
|
int nr_threads;
|
||||||
} CPUCore;
|
} CPUCore;
|
||||||
|
|
||||||
|
/* Note: topology field names need to be kept in sync with
|
||||||
|
* 'CpuInstanceProperties' */
|
||||||
|
|
||||||
#define CPU_CORE_PROP_CORE_ID "core-id"
|
#define CPU_CORE_PROP_CORE_ID "core-id"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -4268,20 +4268,21 @@
|
||||||
# Note: currently there are 4 properties that could be present
|
# Note: currently there are 4 properties that could be present
|
||||||
# but management should be prepared to pass through other
|
# but management should be prepared to pass through other
|
||||||
# properties with device_add command to allow for future
|
# properties with device_add command to allow for future
|
||||||
# interface extension.
|
# interface extension. This also requires the filed names to be kept in
|
||||||
|
# sync with the properties passed to -device/device_add.
|
||||||
#
|
#
|
||||||
# @node: #optional NUMA node ID the CPU belongs to
|
# @node-id: #optional NUMA node ID the CPU belongs to
|
||||||
# @socket: #optional socket number within node/board the CPU belongs to
|
# @socket-id: #optional socket number within node/board the CPU belongs to
|
||||||
# @core: #optional core number within socket the CPU belongs to
|
# @core-id: #optional core number within socket the CPU belongs to
|
||||||
# @thread: #optional thread number within core the CPU belongs to
|
# @thread-id: #optional thread number within core the CPU belongs to
|
||||||
#
|
#
|
||||||
# Since: 2.7
|
# Since: 2.7
|
||||||
##
|
##
|
||||||
{ 'struct': 'CpuInstanceProperties',
|
{ 'struct': 'CpuInstanceProperties',
|
||||||
'data': { '*node': 'int',
|
'data': { '*node-id': 'int',
|
||||||
'*socket': 'int',
|
'*socket-id': 'int',
|
||||||
'*core': 'int',
|
'*core-id': 'int',
|
||||||
'*thread': 'int'
|
'*thread-id': 'int'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue