qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3 8/9] QMP: add set-numa-node command


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v3 8/9] QMP: add set-numa-node command
Date: Tue, 27 Feb 2018 16:17:20 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

On 02/16/2018 06:37 AM, Igor Mammedov wrote:
Command is allowed to run only in preconfig stage and
will allow to configure numa mapping for CPUs depending
on possible CPUs layout (query-hotpluggable-cpus) for
given machine instance.

Signed-off-by: Igor Mammedov <address@hidden>
---
  numa.c           |  5 +++++
  qapi-schema.json | 14 ++++++++++++++
  tests/qmp-test.c |  6 ++++++
  3 files changed, 25 insertions(+)


+++ b/qapi-schema.json
@@ -3201,3 +3201,17 @@
  # Since: 2.11
  ##
  { 'command': 'watchdog-set-action', 'data' : {'action': 'WatchdogAction'} }
+
+##
+# @set-numa-node:
+#
+# Runtime equivalent of '-numa' CLI option, available at
+# preconfigure stage to configure numa mapping before initializing
+# machine.
+#
+# Since 2.12
+##
+{ 'command': 'set-numa-node', 'boxed': true,
+  'data': 'NumaOptions',
+  'runstates': [ 'preconfig' ]
+}

Oh, so you ARE trying to do fine-grained control of which commands are valid in which states. Still, would that be easier through a three-state enum (or pair of bools) instead of making every client enumerate an array of 'all states', 'all but preconfig', and 'preconfig only'?

Also, while preconfig is special (not every command can be made to run during preconfig, so having the state rejection logic centralized makes some sense), there are a lot fewer commands that are preconfig-only - could those commands (just set-numa-node at the moment) be made to perform state checks themselves rather than relying on centralized logic, and then you still only need a single bool in the QAPI schema (safe for preconfig, unsafe for preconfig in central logic; unsafe in other states in a per-command code).

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]