summaryrefslogtreecommitdiffstats
path: root/numa.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2015-09-11 15:04:45 +0200
committerTimothy Pearson <tpearson@raptorengineering.com>2019-11-29 19:28:24 -0600
commitc40ca5f0bdb9c0efba26e0cc0789fda1c6d4f288 (patch)
treeef0b9f92477851b9d32edf5e7514cf17ffe4087f /numa.c
parentaff6a93abbc8412cb53c02a136deaaa39469ac72 (diff)
downloadhqemu-c40ca5f0bdb9c0efba26e0cc0789fda1c6d4f288.zip
hqemu-c40ca5f0bdb9c0efba26e0cc0789fda1c6d4f288.tar.gz
Use error_fatal to simplify obvious fatal errors
Done with this Coccinelle semantic patch: @@ type T; identifier FUN, RET; expression list ARGS; expression ERR, EC; @@ ( - T RET = FUN(ARGS, &ERR); + T RET = FUN(ARGS, &error_fatal); | - RET = FUN(ARGS, &ERR); + RET = FUN(ARGS, &error_fatal); | - FUN(ARGS, &ERR); + FUN(ARGS, &error_fatal); ) - if (ERR != NULL) { - error_report_err(ERR); - exit(EC); - } This is actually a more elegant version of my initial semantic patch by courtesy of Eduardo. It leaves dead Error * variables behind, cleaned up manually. Cc: qemu-arm@nongnu.org Cc: "Michael S. Tsirkin" <mst@redhat.com> Cc: Eduardo Habkost <ehabkost@redhat.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'numa.c')
-rw-r--r--numa.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/numa.c b/numa.c
index 1710946..425ef8d 100644
--- a/numa.c
+++ b/numa.c
@@ -450,17 +450,13 @@ void memory_region_allocate_system_memory(MemoryRegion *mr, Object *owner,
memory_region_init(mr, owner, name, ram_size);
for (i = 0; i < MAX_NODES; i++) {
- Error *local_err = NULL;
uint64_t size = numa_info[i].node_mem;
HostMemoryBackend *backend = numa_info[i].node_memdev;
if (!backend) {
continue;
}
- MemoryRegion *seg = host_memory_backend_get_memory(backend, &local_err);
- if (local_err) {
- error_report_err(local_err);
- exit(1);
- }
+ MemoryRegion *seg = host_memory_backend_get_memory(backend,
+ &error_fatal);
if (memory_region_is_mapped(seg)) {
char *path = object_get_canonical_path_component(OBJECT(backend));
OpenPOWER on IntegriCloud