path: root/qapi-schema.json
diff options
authorIgor Mammedov <imammedo@redhat.com>2017-05-10 13:30:01 +0200
committerEduardo Habkost <ehabkost@redhat.com>2017-05-11 16:08:50 -0300
commit419fcdec3c1ff545cd33d90ade99236c9bcc37cc (patch)
tree60fbc17cc6fd58adb35fd22c5bf87dde913e4103 /qapi-schema.json
parent1171ae9a5b132dc631728ff17688d05ed4534181 (diff)
numa: add '-numa cpu,...' option for property based node mapping
legacy cpu to node mapping is using cpu index values to map VCPU to node with help of '-numa node,nodeid=node,cpus=x[-y]' option. However cpu index is internal concept and QEMU users have to guess /reimplement qemu's logic/ to map it to a concrete cpu socket/core/thread to make sane CPUs placement across numa nodes. This patch allows to map cpu objects to numa nodes using the same properties as used for cpus with -device/device_add (socket-id/core-id/thread-id/node-id). At present valid properties/values to address CPUs could be fetched using hotpluggable-cpus monitor/qmp command, it will require user to start qemu twice when creating domain to fetch possible CPUs for a machine type/-smp layout first and then the second time with numa explicit mapping for actual usage. The first step results could be saved and reused to set/change mapping later as far as machine type/-smp stays the same. Proposed impl. supports exact and wildcard matching to simplify CLI and allow to set mapping for a specific cpu or group of cpu objects specified by matched properties. For example: # exact mapping x86 -numa cpu,node-id=x,socket-id=y,core-id=z,thread-id=n # exact mapping SPAPR -numa cpu,node-id=x,core-id=y # wildcard mapping, all cpu objects that match socket-id=y # are mapped to node-id=x -numa cpu,node-id=x,socket-id=y Signed-off-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <1494415802-227633-18-git-send-email-imammedo@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'qapi-schema.json')
1 files changed, 19 insertions, 2 deletions
diff --git a/qapi-schema.json b/qapi-schema.json
index c3051fb901..80603cfc51 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -5690,10 +5690,12 @@
# @dist: NUMA distance configuration (since 2.10)
+# @cpu: property based CPU(s) to node mapping (Since: 2.10)
# Since: 2.1
{ 'enum': 'NumaOptionsType',
- 'data': [ 'node', 'dist' ] }
+ 'data': [ 'node', 'dist', 'cpu' ] }
# @NumaOptions:
@@ -5707,7 +5709,8 @@
'discriminator': 'type',
'data': {
'node': 'NumaNodeOptions',
- 'dist': 'NumaDistOptions' }}
+ 'dist': 'NumaDistOptions',
+ 'cpu': 'NumaCpuOptions' }}
# @NumaNodeOptions:
@@ -5757,6 +5760,20 @@
'val': 'uint8' }}
+# @NumaCpuOptions:
+# Option "-numa cpu" overrides default cpu to node mapping.
+# It accepts the same set of cpu properties as returned by
+# query-hotpluggable-cpus[].props, where node-id could be used to
+# override default node mapping.
+# Since: 2.10
+{ 'struct': 'NumaCpuOptions',
+ 'base': 'CpuInstanceProperties',
+ 'data' : {} }
# @HostMemPolicy:
# Host memory policy types