[PATCH 1/2] numa: remove not needed check

Igor Mammedov posted 2 patches 6 years, 1 month ago
Maintainers: Radoslaw Biernacki <radoslaw.biernacki@linaro.org>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Leif Lindholm <leif.lindholm@linaro.org>, Eduardo Habkost <ehabkost@redhat.com>, Peter Maydell <peter.maydell@linaro.org>
[PATCH 1/2] numa: remove not needed check
Posted by Igor Mammedov 6 years, 1 month ago
Currently parse_numa_node() is always called from already numa
enabled context.
Drop unnecessary check if numa is supported.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
 hw/core/numa.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/hw/core/numa.c b/hw/core/numa.c
index e3332a9..19f082d 100644
--- a/hw/core/numa.c
+++ b/hw/core/numa.c
@@ -83,10 +83,6 @@ static void parse_numa_node(MachineState *ms, NumaNodeOptions *node,
         return;
     }
 
-    if (!mc->cpu_index_to_instance_props || !mc->get_default_cpu_node_id) {
-        error_setg(errp, "NUMA is not supported by this machine-type");
-        return;
-    }
     for (cpus = node->cpus; cpus; cpus = cpus->next) {
         CpuInstanceProperties props;
         if (cpus->value >= max_cpus) {
@@ -178,9 +174,8 @@ void parse_numa_distance(MachineState *ms, NumaDistOptions *dist, Error **errp)
 void set_numa_options(MachineState *ms, NumaOptions *object, Error **errp)
 {
     Error *err = NULL;
-    MachineClass *mc = MACHINE_GET_CLASS(ms);
 
-    if (!mc->numa_mem_supported) {
+    if (!ms->numa_state) {
         error_setg(errp, "NUMA is not supported by this machine-type");
         goto end;
     }
-- 
2.7.4


Re: [PATCH 1/2] numa: remove not needed check
Posted by Eduardo Habkost 6 years, 1 month ago
On Thu, Dec 12, 2019 at 01:48:55PM +0100, Igor Mammedov wrote:
> Currently parse_numa_node() is always called from already numa
> enabled context.
> Drop unnecessary check if numa is supported.
> 
> Signed-off-by: Igor Mammedov <imammedo@redhat.com>

Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>

I'm queueing and I plan to send a pull request before the holiday
break.

-- 
Eduardo