@@ -336,7 +336,7 @@ static int error_on_sysbus_device(SysBusDevice *sbdev, void *opaque)
{
error_report("Option '-device %s' cannot be handled by this machine",
object_class_get_name(object_get_class(OBJECT(sbdev))));
- exit(1);
+ exit(EXIT_FAILURE);
}
static void machine_init_notify(Notifier *notifier, void *data)
@@ -122,7 +122,7 @@ static void platform_bus_map_irq(PlatformBusDevice *pbus, SysBusDevice *sbdev,
irqn = find_first_zero_bit(pbus->used_irqs, max_irqs);
if (irqn >= max_irqs) {
error_report("Platform Bus: Can not fit IRQ line");
- exit(1);
+ exit(EXIT_FAILURE);
}
set_bit(irqn, pbus->used_irqs);
@@ -157,7 +157,7 @@ static void platform_bus_map_mmio(PlatformBusDevice *pbus, SysBusDevice *sbdev,
if (!found_region) {
error_report("Platform Bus: Can not fit MMIO region of size %"PRIx64,
size);
- exit(1);
+ exit(EXIT_FAILURE);
}
/* Map the device's region into our Platform Bus MMIO space */
@@ -359,7 +359,7 @@ void qdev_init_nofail(DeviceState *dev)
if (err) {
error_reportf_err(err, "Initialization of device %s failed: ",
object_get_typename(OBJECT(dev)));
- exit(1);
+ exit(EXIT_FAILURE);
}
object_unref(OBJECT(dev));
}
@@ -298,7 +298,7 @@ void parse_numa_opts(MachineClass *mc)
int i;
if (qemu_opts_foreach(qemu_find_opts("numa"), parse_numa, NULL, NULL)) {
- exit(1);
+ exit(EXIT_FAILURE);
}
assert(max_numa_nodeid <= MAX_NODES);
@@ -308,7 +308,7 @@ void parse_numa_opts(MachineClass *mc)
/* Report large node IDs first, to make mistakes easier to spot */
if (!numa_info[i].present) {
error_report("numa: Node ID missing: %d", i);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
@@ -352,7 +352,7 @@ void parse_numa_opts(MachineClass *mc)
error_report("total memory for NUMA nodes (0x%" PRIx64 ")"
" should equal RAM size (0x" RAM_ADDR_FMT ")",
numa_total, ram_size);
- exit(1);
+ exit(EXIT_FAILURE);
}
for (i = 0; i < nb_numa_nodes; i++) {
@@ -416,7 +416,7 @@ static void allocate_system_memory_nonnuma(MemoryRegion *mr, Object *owner,
if (err) {
error_report_err(err);
if (mem_prealloc) {
- exit(1);
+ exit(EXIT_FAILURE);
}
/* Legacy behavior: if allocation failed, fall back to
@@ -426,7 +426,7 @@ static void allocate_system_memory_nonnuma(MemoryRegion *mr, Object *owner,
}
#else
fprintf(stderr, "-mem-path not supported on this host\n");
- exit(1);
+ exit(EXIT_FAILURE);
#endif
} else {
memory_region_init_ram(mr, owner, name, ram_size, &error_fatal);
@@ -461,7 +461,7 @@ void memory_region_allocate_system_memory(MemoryRegion *mr, Object *owner,
error_report("memory backend %s is used multiple times. Each "
"-numa option must use a different memdev value.",
path);
- exit(1);
+ exit(EXIT_FAILURE);
}
host_memory_backend_set_mapped(backend, true);
This patch is the result of coccinelle script scripts/coccinelle/exit.cocci Signed-off-by: Laurent Vivier <lvivier@redhat.com> CC: Marcel Apfelbaum <marcel@redhat.com> --- hw/core/machine.c | 2 +- hw/core/platform-bus.c | 4 ++-- hw/core/qdev.c | 2 +- numa.c | 12 ++++++------ 4 files changed, 10 insertions(+), 10 deletions(-)