diff --git a/numa.c b/numa.c index 53bd65a05df94a3418d378c19d609f19b7b06f8c..33572bfa74aa9877751630695ffcc93b9626c0ea 100644 --- a/numa.c +++ b/numa.c @@ -444,6 +444,17 @@ void parse_numa_opts(MachineState *ms) } } +void qmp_set_numa_node(NumaOptions *cmd, Error **errp) +{ + if (!runstate_check(RUN_STATE_PRECONFIG)) { + error_setg(errp, "The command is permitted only in '%s' state", + RunState_str(RUN_STATE_PRECONFIG)); + return; + } + + set_numa_options(MACHINE(qdev_get_machine()), cmd, errp); +} + void numa_cpu_pre_plug(const CPUArchId *slot, DeviceState *dev, Error **errp) { int node_id = object_property_get_int(OBJECT(dev), "node-id", &error_abort); diff --git a/qapi/misc.json b/qapi/misc.json index b155db2642297bd18511ff670b8d12ab5565abad..02bb295c13338b18e919d073206d62870fd5f265 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -3510,3 +3510,17 @@ ## { 'command': 'x-oob-test', 'data' : { 'lock': 'bool' }, 'allow-oob': true } + +## +# @set-numa-node: +# +# Runtime equivalent of '-numa' CLI option, available at +# preconfigure stage to configure numa mapping before initializing +# machine. +# +# Since 3.0 +## +{ 'command': 'set-numa-node', 'boxed': true, + 'data': 'NumaOptions', + 'allow-preconfig': true +}