qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: qemu-devel@nongnu.org
Cc: eblake@redhat.com, ehabkost@redhat.com, pkrempa@redhat.com,
	armbru@redhat.com
Subject: [Qemu-devel] [PATCH v6 01/11] numa: postpone options post-processing till machine_run_board_init()
Date: Fri, 27 Apr 2018 17:05:13 +0200	[thread overview]
Message-ID: <1524841523-95513-2-git-send-email-imammedo@redhat.com> (raw)
In-Reply-To: <1524841523-95513-1-git-send-email-imammedo@redhat.com>

in preparation for numa options to being handled via QMP before
machine_run_board_init(), move final numa configuration checks
and processing to machine_run_board_init() so it could take into
account both CLI (via parse_numa_opts()) and QMP input

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
---
v2:
  - remove duplicate qemu_opts_foreach() in numa_complete_configuration()
    that was causing non explicitly IDed node "-numa node" parsed twice.
---
 include/sysemu/numa.h |  1 +
 hw/core/machine.c     |  5 +++--
 numa.c                | 13 ++++++++-----
 3 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/include/sysemu/numa.h b/include/sysemu/numa.h
index d99e547..21713b7 100644
--- a/include/sysemu/numa.h
+++ b/include/sysemu/numa.h
@@ -23,6 +23,7 @@ struct NumaNodeMem {
 
 extern NodeInfo numa_info[MAX_NODES];
 void parse_numa_opts(MachineState *ms);
+void numa_complete_configuration(MachineState *ms);
 void query_numa_node_mem(NumaNodeMem node_mem[]);
 extern QemuOptsList qemu_numa_opts;
 void numa_legacy_auto_assign_ram(MachineClass *mc, NodeInfo *nodes,
diff --git a/hw/core/machine.c b/hw/core/machine.c
index 2040177..617e5f8 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -737,7 +737,7 @@ static char *cpu_slot_to_string(const CPUArchId *cpu)
     return g_string_free(s, false);
 }
 
-static void machine_numa_finish_init(MachineState *machine)
+static void machine_numa_finish_cpu_init(MachineState *machine)
 {
     int i;
     bool default_mapping;
@@ -792,7 +792,8 @@ void machine_run_board_init(MachineState *machine)
     MachineClass *machine_class = MACHINE_GET_CLASS(machine);
 
     if (nb_numa_nodes) {
-        machine_numa_finish_init(machine);
+        numa_complete_configuration(machine);
+        machine_numa_finish_cpu_init(machine);
     }
 
     /* If the machine supports the valid_cpu_types check and the user
diff --git a/numa.c b/numa.c
index 78a869e..d0abd7c 100644
--- a/numa.c
+++ b/numa.c
@@ -338,15 +338,11 @@ void numa_default_auto_assign_ram(MachineClass *mc, NodeInfo *nodes,
     nodes[i].node_mem = size - usedmem;
 }
 
-void parse_numa_opts(MachineState *ms)
+void numa_complete_configuration(MachineState *ms)
 {
     int i;
     MachineClass *mc = MACHINE_GET_CLASS(ms);
 
-    if (qemu_opts_foreach(qemu_find_opts("numa"), parse_numa, ms, NULL)) {
-        exit(1);
-    }
-
     /*
      * If memory hotplug is enabled (slots > 0) but without '-numa'
      * options explicitly on CLI, guestes will break.
@@ -433,6 +429,13 @@ void parse_numa_opts(MachineState *ms)
     }
 }
 
+void parse_numa_opts(MachineState *ms)
+{
+    if (qemu_opts_foreach(qemu_find_opts("numa"), parse_numa, ms, NULL)) {
+        exit(1);
+    }
+}
+
 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);
-- 
2.7.4

  reply	other threads:[~2018-04-27 15:06 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-27 15:05 [Qemu-devel] [PATCH v6 00/11] enable numa configuration before machine_init() from QMP Igor Mammedov
2018-04-27 15:05 ` Igor Mammedov [this message]
2018-04-27 15:05 ` [Qemu-devel] [PATCH v6 02/11] numa: split out NumaOptions parsing into set_numa_options() Igor Mammedov
2018-04-27 15:05 ` [Qemu-devel] [PATCH v6 03/11] cli: add --preconfig option Igor Mammedov
2018-04-27 21:44   ` Eric Blake
2018-05-01 15:07   ` Daniel P. Berrangé
2018-05-03 11:35     ` Igor Mammedov
2018-04-27 15:05 ` [Qemu-devel] [PATCH v6 04/11] hmp: disable monitor in preconfig state Igor Mammedov
2018-04-27 21:48   ` Eric Blake
2018-04-27 15:05 ` [Qemu-devel] [PATCH v6 05/11] qapi: introduce new cmd option "allowed-in-preconfig" Igor Mammedov
2018-04-27 22:05   ` Eric Blake
2018-04-28  3:51     ` Peter Xu
2018-04-30 14:49       ` Eric Blake
2018-05-01 14:57     ` Igor Mammedov
2018-05-01 15:29   ` Daniel P. Berrangé
2018-05-03 11:22     ` Igor Mammedov
2018-04-27 15:05 ` [Qemu-devel] [PATCH v6 06/11] tests: let qapi-schema tests detect allowed-in-preconfig Igor Mammedov
2018-04-27 22:08   ` Eric Blake
2018-04-27 22:12     ` Eric Blake
2018-04-27 15:05 ` [Qemu-devel] [PATCH v6 07/11] tests: add allowed-in-preconfig-test for qapi-schema Igor Mammedov
2018-04-27 22:11   ` Eric Blake
2018-04-27 15:05 ` [Qemu-devel] [PATCH v6 08/11] tests: extend qmp test with preconfig checks Igor Mammedov
2018-04-27 15:05 ` [Qemu-devel] [PATCH v6 09/11] qmp: permit query-hotpluggable-cpus in preconfig state Igor Mammedov
2018-04-27 15:05 ` [Qemu-devel] [PATCH v6 10/11] qmp: add set-numa-node command Igor Mammedov
2018-04-27 15:05 ` [Qemu-devel] [PATCH v6 11/11] tests: functional tests for QMP command set-numa-node Igor Mammedov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1524841523-95513-2-git-send-email-imammedo@redhat.com \
    --to=imammedo@redhat.com \
    --cc=armbru@redhat.com \
    --cc=eblake@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=pkrempa@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).