[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 45/45] numa: Clean up error reporting in parse_numa()
From: |
Eduardo Habkost |
Subject: |
[Qemu-ppc] [PULL 45/45] numa: Clean up error reporting in parse_numa() |
Date: |
Thu, 18 Oct 2018 17:04:22 -0300 |
From: Markus Armbruster <address@hidden>
Calling error_report() in a function that takes an Error ** argument
is suspicious. parse_numa() does that, and then fails without setting
an error. Its caller main(), via qemu_opts_foreach(), is fine with
it, but clean it up anyway.
While there, give parse_numa() internal linkage.
Cc: Eduardo Habkost <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>
---
include/sysemu/numa.h | 1 -
numa.c | 8 +++-----
2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/include/sysemu/numa.h b/include/sysemu/numa.h
index 7a0ae751aa..21713b7e2f 100644
--- a/include/sysemu/numa.h
+++ b/include/sysemu/numa.h
@@ -22,7 +22,6 @@ struct NumaNodeMem {
};
extern NodeInfo numa_info[MAX_NODES];
-int parse_numa(void *opaque, QemuOpts *opts, Error **errp);
void parse_numa_opts(MachineState *ms);
void numa_complete_configuration(MachineState *ms);
void query_numa_node_mem(NumaNodeMem node_mem[]);
diff --git a/numa.c b/numa.c
index 1d7c49ad43..50ec016013 100644
--- a/numa.c
+++ b/numa.c
@@ -215,7 +215,7 @@ end:
error_propagate(errp, err);
}
-int parse_numa(void *opaque, QemuOpts *opts, Error **errp)
+static int parse_numa(void *opaque, QemuOpts *opts, Error **errp)
{
NumaOptions *object = NULL;
MachineState *ms = MACHINE(opaque);
@@ -239,7 +239,7 @@ int parse_numa(void *opaque, QemuOpts *opts, Error **errp)
end:
qapi_free_NumaOptions(object);
if (err) {
- error_report_err(err);
+ error_propagate(errp, err);
return -1;
}
@@ -444,9 +444,7 @@ void numa_complete_configuration(MachineState *ms)
void parse_numa_opts(MachineState *ms)
{
- if (qemu_opts_foreach(qemu_find_opts("numa"), parse_numa, ms, NULL)) {
- exit(1);
- }
+ qemu_opts_foreach(qemu_find_opts("numa"), parse_numa, ms, &error_fatal);
}
void qmp_set_numa_node(NumaOptions *cmd, Error **errp)
--
2.18.0.rc1.1.g3f1ff2140
- Re: [Qemu-ppc] [PULL 39/45] net: mipsnet: convert SysBus init method to a realize method, (continued)
- [Qemu-ppc] [PULL 40/45] net: opencores_eth: convert SysBus init method to a realize method, Eduardo Habkost, 2018/10/18
- [Qemu-ppc] [PULL 41/45] net: smc91c111: convert SysBus init method to a realize method, Eduardo Habkost, 2018/10/18
- [Qemu-ppc] [PULL 42/45] net: stellaris_enet: convert SysBus init method to a realize method, Eduardo Habkost, 2018/10/18
- [Qemu-ppc] [PULL 43/45] net: stellaris_enet: add a reset method, Eduardo Habkost, 2018/10/18
- [Qemu-ppc] [PULL 44/45] net: xgmac: convert SysBus init method to a realize method, Eduardo Habkost, 2018/10/18
- [Qemu-ppc] [PULL 45/45] numa: Clean up error reporting in parse_numa(),
Eduardo Habkost <=
- Re: [Qemu-ppc] [PULL 00/45] Machine queue, 2018-10-18, Peter Maydell, 2018/10/19
- Re: [Qemu-ppc] [Qemu-devel] [PULL 00/45] Machine queue, 2018-10-18, Philippe Mathieu-Daudé, 2018/10/19
- Re: [Qemu-ppc] [PULL 00/45] Machine queue, 2018-10-18, Eduardo Habkost, 2018/10/19
- Re: [Qemu-ppc] [Qemu-devel] [PULL 00/45] Machine queue, 2018-10-18, Igor Mammedov, 2018/10/19
- Re: [Qemu-ppc] [Qemu-devel] [PULL 00/45] Machine queue, 2018-10-18, Eduardo Habkost, 2018/10/19
- Re: [Qemu-ppc] [Qemu-devel] [PULL 00/45] Machine queue, 2018-10-18, Philippe Mathieu-Daudé, 2018/10/20
- Re: [Qemu-ppc] [Qemu-devel] [PULL 00/45] Machine queue, 2018-10-18, Igor Mammedov, 2018/10/22
- Re: [Qemu-ppc] [Qemu-devel] [PULL 00/45] Machine queue, 2018-10-18, Markus Armbruster, 2018/10/22