diff options
Diffstat (limited to 'hw/core')
-rw-r--r-- | hw/core/numa.c | 44 |
1 files changed, 14 insertions, 30 deletions
diff --git a/hw/core/numa.c b/hw/core/numa.c index de9a2f7e32..1b3267a607 100644 --- a/hw/core/numa.c +++ b/hw/core/numa.c @@ -456,40 +456,33 @@ void parse_numa_hmat_cache(MachineState *ms, NumaHmatCacheOptions *node, void set_numa_options(MachineState *ms, NumaOptions *object, Error **errp) { - Error *err = NULL; - if (!ms->numa_state) { error_setg(errp, "NUMA is not supported by this machine-type"); - goto end; + return; } switch (object->type) { case NUMA_OPTIONS_TYPE_NODE: - parse_numa_node(ms, &object->u.node, &err); - if (err) { - goto end; - } + parse_numa_node(ms, &object->u.node, errp); break; case NUMA_OPTIONS_TYPE_DIST: - parse_numa_distance(ms, &object->u.dist, &err); - if (err) { - goto end; - } + parse_numa_distance(ms, &object->u.dist, errp); break; case NUMA_OPTIONS_TYPE_CPU: if (!object->u.cpu.has_node_id) { - error_setg(&err, "Missing mandatory node-id property"); - goto end; + error_setg(errp, "Missing mandatory node-id property"); + return; } if (!ms->numa_state->nodes[object->u.cpu.node_id].present) { - error_setg(&err, "Invalid node-id=%" PRId64 ", NUMA node must be " - "defined with -numa node,nodeid=ID before it's used with " - "-numa cpu,node-id=ID", object->u.cpu.node_id); - goto end; + error_setg(errp, "Invalid node-id=%" PRId64 ", NUMA node must be " + "defined with -numa node,nodeid=ID before it's used with " + "-numa cpu,node-id=ID", object->u.cpu.node_id); + return; } - machine_set_cpu_numa_node(ms, qapi_NumaCpuOptions_base(&object->u.cpu), - &err); + machine_set_cpu_numa_node(ms, + qapi_NumaCpuOptions_base(&object->u.cpu), + errp); break; case NUMA_OPTIONS_TYPE_HMAT_LB: if (!ms->numa_state->hmat_enabled) { @@ -499,10 +492,7 @@ void set_numa_options(MachineState *ms, NumaOptions *object, Error **errp) return; } - parse_numa_hmat_lb(ms->numa_state, &object->u.hmat_lb, &err); - if (err) { - goto end; - } + parse_numa_hmat_lb(ms->numa_state, &object->u.hmat_lb, errp); break; case NUMA_OPTIONS_TYPE_HMAT_CACHE: if (!ms->numa_state->hmat_enabled) { @@ -512,17 +502,11 @@ void set_numa_options(MachineState *ms, NumaOptions *object, Error **errp) return; } - parse_numa_hmat_cache(ms, &object->u.hmat_cache, &err); - if (err) { - goto end; - } + parse_numa_hmat_cache(ms, &object->u.hmat_cache, errp); break; default: abort(); } - -end: - error_propagate(errp, err); } static int parse_numa(void *opaque, QemuOpts *opts, Error **errp) |