Skip to contentSkip to conversation

error-report: introduce error_report_exit()

PATCH Superseded Peter Xu 4 participants 22 messages Aug 11, 2016 – Aug 17, 2016

Subsystems (4)

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Peter Xu

author
#0 lore raw

cover error-report: introduce error_report_exit()

We use these lines frequently in codes:

  error_report(SOME_ERROR_STRING);
  exit(1|EXIT_FAILURE);

This patchset provide error_report_exit() to do the above in one line.

Peter Xu (2):
error-report: provide error_report_exit()
error-report: leveraging error_report_exit()

 arch_init.c                                |   6 +-
 bootdevice.c                               |   4 +-
 cpus.c                                     |   3 +-
 device_tree.c                              |  42 ++---
 hw/9pfs/9p.c                               |   3 +-
 hw/alpha/dp264.c                           |  14 +-
 hw/arm/armv7m.c                            |   3 +-
 hw/arm/digic_boards.c                      |   6 +-
 hw/arm/fsl-imx6.c                          |   5 +-
 hw/arm/highbank.c                          |   6 +-
 hw/arm/raspi.c                             |   7 +-
 hw/arm/sabrelite.c                         |   8 +-
 hw/arm/strongarm.c                         |   6 +-
 hw/arm/sysbus-fdt.c                        |   5 +-
 hw/arm/vexpress.c                          |  14 +-
 hw/arm/virt.c                              |  42 ++---
 hw/arm/xlnx-ep108.c                        |   9 +-
 hw/block/tc58128.c                         |   3 +-
 hw/block/virtio-blk.c                      |   9 +-
 hw/char/exynos4210_uart.c                  |   9 +-
 hw/core/machine.c                          |   5 +-
 hw/core/platform-bus.c                     |   8 +-
 hw/i386/intel_iommu.c                      |   5 +-
 hw/i386/pc.c                               |  35 ++--
 hw/i386/pc_piix.c                          |   3 +-
 hw/i386/x86-iommu.c                        |   5 +-
 hw/ide/core.c                              |   5 +-
 hw/intc/ioapic.c                           |   5 +-
 hw/intc/xics_kvm.c                         |  15 +-
 hw/m68k/an5206.c                           |   3 +-
 hw/microblaze/boot.c                       |   5 +-
 hw/mips/mips_fulong2e.c                    |   3 +-
 hw/mips/mips_jazz.c                        |   3 +-
 hw/mips/mips_malta.c                       |  26 ++-
 hw/mips/mips_mipssim.c                     |   5 +-
 hw/net/virtio-net.c                        |  27 ++-
 hw/nvram/fw_cfg.c                          |   5 +-
 hw/pci/pci.c                               |   5 +-
 hw/ppc/e500.c                              |   5 +-
 hw/ppc/mac_newworld.c                      |  14 +-
 hw/ppc/mac_oldworld.c                      |  17 +-
 hw/ppc/mpc8544ds.c                         |   3 +-
 hw/ppc/ppc405_boards.c                     |  14 +-
 hw/ppc/prep.c                              |  11 +-
 hw/ppc/spapr.c                             |  85 ++++-----
 hw/ppc/virtex_ml507.c                      |   5 +-
 hw/scsi/vhost-scsi.c                       |  10 +-
 hw/scsi/virtio-scsi.c                      |   9 +-
 hw/sh4/shix.c                              |   3 +-
 hw/smbios/smbios.c                         |  41 ++---
 hw/sparc/sun4m.c                           |  19 +-
 hw/tricore/tricore_testboard.c             |   8 +-
 hw/unicore32/puv3.c                        |   9 +-
 hw/virtio/virtio.c                         |  44 ++---
 hw/xtensa/sim.c                            |   4 +-
 hw/xtensa/xtfpga.c                         |  16 +-
 include/qemu/error-report.h                |   8 +
 numa.c                                     |  22 +--
 qemu-img.c                                 |  15 +-
 qemu-io.c                                  |   9 +-
 qemu-nbd.c                                 | 113 +++++-------
 replay/replay-char.c                       |   6 +-
 replay/replay-events.c                     |  12 +-
 replay/replay-internal.c                   |   4 +-
 replay/replay-time.c                       |   3 +-
 replay/replay.c                            |   9 +-
 scripts/coccinelle/error_report_exit.cocci |  13 ++
 target-arm/machine.c                       |   5 +-
 target-i386/kvm.c                          |   8 +-
 target-ppc/kvm.c                           |   6 +-
 target-s390x/cpu.c                         |   5 +-
 target-s390x/kvm.c                         |   8 +-
 target-s390x/mmu_helper.c                  |   3 +-
 trace/control.c                            |   6 +-
 ui/spice-core.c                            |  40 ++---
 vl.c                                       | 268 +++++++++++------------------
 xen-hvm.c                                  |   3 +-
 77 files changed, 483 insertions(+), 772 deletions(-)
 create mode 100644 scripts/coccinelle/error_report_exit.cocci
Signature · 1 line
2.7.4
author
#1 lore raw

PATCH 1/2 error-report: provide error_report_exit()

There are many places in current QEMU codes that needs to print some error and then quit QEMU. Provide a macro for it.

Also, one coccinelle script is added to convert existing cases to leverage this new macro.

---
 include/qemu/error-report.h                |  8 ++++++++
 scripts/coccinelle/error_report_exit.cocci | 13 +++++++++++++
 2 files changed, 21 insertions(+)
 create mode 100644 scripts/coccinelle/error_report_exit.cocci
include/qemu/error-report.h +8 -0
index 499ec8b..c2d5059 100644
@@ -13,6 +13,8 @@
 #ifndef QEMU_ERROR_REPORT_H
 #define QEMU_ERROR_REPORT_H
 
+#include <unistd.h>
+
 typedef struct Location {
     /* all members are private to qemu-error.c */
     enum { LOC_NONE, LOC_CMDLINE, LOC_FILE } kind;
@@ -36,6 +38,12 @@ void error_printf_unless_qmp(const char *fmt, ...) GCC_FMT_ATTR(1, 2);
 void error_set_progname(const char *argv0);
 void error_vreport(const char *fmt, va_list ap) GCC_FMT_ATTR(1, 0);
 void error_report(const char *fmt, ...) GCC_FMT_ATTR(1, 2);
+
+#define error_report_exit(...) do {             \
+        error_report(__VA_ARGS__);              \
+        exit(1);                                \
+    } while (0)
+
 const char *error_get_progname(void);
 extern bool enable_timestamp_msg;
 
scripts/coccinelle/error_report_exit.cocci new file +13 -0
new file mode 100644
index 0000000..49f6c17
@@ -0,0 +1,13 @@
+@@
+expression list X;
+@@
+
+-error_report(X);
++error_report_exit(X);
+-exit(
+(
+-1
+|
+-EXIT_FAILURE
+)
+-);
Signature · 1 line
2.7.4
author
#15 lore raw

PATCH 2/2 error-report: leveraging error_report_exit()

In reply to Peter Xu

Replace possible places in current codes to leverage the new macro. Most of the changes are done by spatch using error_report_exit.cocci script, with some further manual fixes on the format (line width not exceeding 80 chars).

---
 arch_init.c                    |   6 +-
 bootdevice.c                   |   4 +-
 cpus.c                         |   3 +-
 device_tree.c                  |  42 +++----
 hw/9pfs/9p.c                   |   3 +-
 hw/alpha/dp264.c               |  14 +--
 hw/arm/armv7m.c                |   3 +-
 hw/arm/digic_boards.c          |   6 +-
 hw/arm/fsl-imx6.c              |   5 +-
 hw/arm/highbank.c              |   6 +-
 hw/arm/raspi.c                 |   7 +-
 hw/arm/sabrelite.c             |   8 +-
 hw/arm/strongarm.c             |   6 +-
 hw/arm/sysbus-fdt.c            |   5 +-
 hw/arm/vexpress.c              |  14 +--
 hw/arm/virt.c                  |  42 +++----
 hw/arm/xlnx-ep108.c            |   9 +-
 hw/block/tc58128.c             |   3 +-
 hw/block/virtio-blk.c          |   9 +-
 hw/char/exynos4210_uart.c      |   9 +-
 hw/core/machine.c              |   5 +-
 hw/core/platform-bus.c         |   8 +-
 hw/i386/intel_iommu.c          |   5 +-
 hw/i386/pc.c                   |  35 +++---
 hw/i386/pc_piix.c              |   3 +-
 hw/i386/x86-iommu.c            |   5 +-
 hw/ide/core.c                  |   5 +-
 hw/intc/ioapic.c               |   5 +-
 hw/intc/xics_kvm.c             |  15 +--
 hw/m68k/an5206.c               |   3 +-
 hw/microblaze/boot.c           |   5 +-
 hw/mips/mips_fulong2e.c        |   3 +-
 hw/mips/mips_jazz.c            |   3 +-
 hw/mips/mips_malta.c           |  26 ++--
 hw/mips/mips_mipssim.c         |   5 +-
 hw/net/virtio-net.c            |  27 ++---
 hw/nvram/fw_cfg.c              |   5 +-
 hw/pci/pci.c                   |   5 +-
 hw/ppc/e500.c                  |   5 +-
 hw/ppc/mac_newworld.c          |  14 +--
 hw/ppc/mac_oldworld.c          |  17 +--
 hw/ppc/mpc8544ds.c             |   3 +-
 hw/ppc/ppc405_boards.c         |  14 +--
 hw/ppc/prep.c                  |  11 +-
 hw/ppc/spapr.c                 |  85 +++++--------
 hw/ppc/virtex_ml507.c          |   5 +-
 hw/scsi/vhost-scsi.c           |  10 +-
 hw/scsi/virtio-scsi.c          |   9 +-
 hw/sh4/shix.c                  |   3 +-
 hw/smbios/smbios.c             |  41 +++----
 hw/sparc/sun4m.c               |  19 ++-
 hw/tricore/tricore_testboard.c |   8 +-
 hw/unicore32/puv3.c            |   9 +-
 hw/virtio/virtio.c             |  44 +++----
 hw/xtensa/sim.c                |   4 +-
 hw/xtensa/xtfpga.c             |  16 +--
 numa.c                         |  22 ++--
 qemu-img.c                     |  15 +--
 qemu-io.c                      |   9 +-
 qemu-nbd.c                     | 113 +++++++----------
 replay/replay-char.c           |   6 +-
 replay/replay-events.c         |  12 +-
 replay/replay-internal.c       |   4 +-
 replay/replay-time.c           |   3 +-
 replay/replay.c                |   9 +-
 target-arm/machine.c           |   5 +-
 target-i386/kvm.c              |   8 +-
 target-ppc/kvm.c               |   6 +-
 target-s390x/cpu.c             |   5 +-
 target-s390x/kvm.c             |   8 +-
 target-s390x/mmu_helper.c      |   3 +-
 trace/control.c                |   6 +-
 ui/spice-core.c                |  40 +++---
 vl.c                           | 268 +++++++++++++++--------------------------
 xen-hvm.c                      |   3 +-
 75 files changed, 462 insertions(+), 772 deletions(-)
arch_init.c +2 -4
index fa05973..abb661d 100644
@@ -220,14 +220,12 @@ void audio_init(void)
         if (c->enabled) {
             if (c->isa) {
                 if (!isa_bus) {
-                    error_report("ISA bus not available for %s", c->name);
-                    exit(1);
+                    error_report_exit("ISA bus not available for %s", c->name);
                 }
                 c->init.init_isa(isa_bus);
             } else {
                 if (!pci_bus) {
-                    error_report("PCI bus not available for %s", c->name);
-                    exit(1);
+                    error_report_exit("PCI bus not available for %s", c->name);
                 }
                 c->init.init_pci(pci_bus);
             }
bootdevice.c +2 -2
index 33e3029..f493477 100644
@@ -172,8 +172,8 @@ void add_boot_device_path(int32_t bootindex, DeviceState *dev,
 
     QTAILQ_FOREACH(i, &fw_boot_order, link) {
         if (i->bootindex == bootindex) {
-            error_report("Two devices with same boot index %d", bootindex);
-            exit(1);
+            error_report_exit("Two devices with same boot index %d",
+                              bootindex);
         } else if (i->bootindex < bootindex) {
             continue;
         }
cpus.c +1 -2
index 84c3520..66e2a5c 100644
@@ -975,8 +975,7 @@ void async_run_on_cpu(CPUState *cpu, void (*func)(void *data), void *data)
 static void qemu_kvm_destroy_vcpu(CPUState *cpu)
 {
     if (kvm_destroy_vcpu(cpu) < 0) {
-        error_report("kvm_destroy_vcpu failed");
-        exit(EXIT_FAILURE);
+        error_report_exit("kvm_destroy_vcpu failed");
     }
 }
 
device_tree.c +17 -25

94 lines not on this page · raw message

hw/9pfs/9p.c +1 -2
index b6b02b4..f896631 100644
@@ -3383,8 +3383,7 @@ static void __attribute__((__constructor__)) v9fs_set_fd_limit(void)
 {
     struct rlimit rlim;
     if (getrlimit(RLIMIT_NOFILE, &rlim) < 0) {
-        error_report("Failed to get the resource limit");
-        exit(1);
+        error_report_exit("Failed to get the resource limit");
     }
     open_fd_hw = rlim.rlim_cur - MIN(400, rlim.rlim_cur/3);
     open_fd_rc = rlim.rlim_cur/2;
hw/alpha/dp264.c +5 -9
index f1267b5..eae6fde 100644
@@ -109,15 +109,13 @@ static void clipper_init(MachineState *machine)
     palcode_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS,
                                 bios_name ? bios_name : "palcode-clipper");
     if (palcode_filename == NULL) {
-        error_report("no palcode provided");
-        exit(1);
+        error_report_exit("no palcode provided");
     }
     size = load_elf(palcode_filename, cpu_alpha_superpage_to_phys,
                     NULL, &palcode_entry, &palcode_low, &palcode_high,
                     0, EM_ALPHA, 0, 0);
     if (size < 0) {
-        error_report("could not load palcode '%s'", palcode_filename);
-        exit(1);
+        error_report_exit("could not load palcode '%s'", palcode_filename);
     }
     g_free(palcode_filename);
 
@@ -136,8 +134,7 @@ static void clipper_init(MachineState *machine)
                         NULL, &kernel_entry, &kernel_low, &kernel_high,
                         0, EM_ALPHA, 0, 0);
         if (size < 0) {
-            error_report("could not load kernel '%s'", kernel_filename);
-            exit(1);
+            error_report_exit("could not load kernel '%s'", kernel_filename);
         }
 
         cpus[0]->env.trap_arg1 = kernel_entry;
@@ -153,9 +150,8 @@ static void clipper_init(MachineState *machine)
 
             initrd_size = get_image_size(initrd_filename);
             if (initrd_size < 0) {
-                error_report("could not load initial ram disk '%s'",
-                             initrd_filename);
-                exit(1);
+                error_report_exit("could not load initial ram disk '%s'",
+                                  initrd_filename);
             }
 
             /* Put the initrd image as high in memory as possible.  */
hw/arm/armv7m.c +1 -2
index 49d3078..446ce18 100644
@@ -220,8 +220,7 @@ DeviceState *armv7m_init(MemoryRegion *system_memory, int mem_size, int num_irq,
             lowaddr = 0;
         }
         if (image_size < 0) {
-            error_report("Could not load kernel '%s'", kernel_filename);
-            exit(1);
+            error_report_exit("Could not load kernel '%s'", kernel_filename);
         }
     }
 
hw/arm/digic_boards.c +2 -4
index 520c8e9..9474980 100644
@@ -106,14 +106,12 @@ static void digic_load_rom(DigicBoardState *s, hwaddr addr,
         char *fn = qemu_find_file(QEMU_FILE_TYPE_BIOS, filename);
 
         if (!fn) {
-            error_report("Couldn't find rom image '%s'.", filename);
-            exit(1);
+            error_report_exit("Couldn't find rom image '%s'.", filename);
         }
 
         rom_size = load_image_targphys(fn, addr, max_size);
         if (rom_size < 0 || rom_size > max_size) {
-            error_report("Couldn't load rom image '%s'.", filename);
-            exit(1);
+            error_report_exit("Couldn't load rom image '%s'.", filename);
         }
         g_free(fn);
     }
hw/arm/fsl-imx6.c +2 -3
index 6a1bf26..ab1d845 100644
@@ -36,9 +36,8 @@ static void fsl_imx6_init(Object *obj)
     int i;
 
     if (smp_cpus > FSL_IMX6_NUM_CPUS) {
-        error_report("%s: Only %d CPUs are supported (%d requested)",
-                     TYPE_FSL_IMX6, FSL_IMX6_NUM_CPUS, smp_cpus);
-        exit(1);
+        error_report_exit("%s: Only %d CPUs are supported (%d requested)",
+                          TYPE_FSL_IMX6, FSL_IMX6_NUM_CPUS, smp_cpus);
     }
 
     for (i = 0; i < smp_cpus; i++) {
hw/arm/highbank.c +2 -4
index 80e5fd4..efacaa6 100644
@@ -283,13 +283,11 @@ static void calxeda_init(MachineState *machine, enum cxmachines machine_id)
         sysboot_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
         if (sysboot_filename != NULL) {
             if (load_image_targphys(sysboot_filename, 0xfff88000, 0x8000) < 0) {
-                error_report("Unable to load %s", bios_name);
-                exit(1);
+                error_report_exit("Unable to load %s", bios_name);
             }
             g_free(sysboot_filename);
         } else {
-            error_report("Unable to find %s", bios_name);
-            exit(1);
+            error_report_exit("Unable to find %s", bios_name);
         }
     }
 
hw/arm/raspi.c +3 -4
index 2b295f1..ef40879 100644
@@ -98,8 +98,8 @@ static void setup_boot(MachineState *machine, int version, size_t ram_size)
         r = load_image_targphys(machine->firmware, FIRMWARE_ADDR,
                                 ram_size - FIRMWARE_ADDR);
         if (r < 0) {
-            error_report("Failed to load firmware from %s", machine->firmware);
-            exit(1);
+            error_report_exit("Failed to load firmware from %s",
+                              machine->firmware);
         }
 
         binfo.entry = FIRMWARE_ADDR;
@@ -146,8 +146,7 @@ static void raspi2_init(MachineState *machine)
     blk = di ? blk_by_legacy_dinfo(di) : NULL;
     bus = qdev_get_child_bus(DEVICE(&s->soc), "sd-bus");
     if (bus == NULL) {
-        error_report("No SD bus found in SOC object");
-        exit(1);
+        error_report_exit("No SD bus found in SOC object");
     }
     carddev = qdev_create(bus, TYPE_SD_CARD);
     qdev_prop_set_drive(carddev, "drive", blk, &error_fatal);
hw/arm/sabrelite.c +3 -5
index 4e7ac8c..44decc2 100644
@@ -50,9 +50,8 @@ static void sabrelite_init(MachineState *machine)
 
     /* Check the amount of memory is compatible with the SOC */
     if (machine->ram_size > FSL_IMX6_MMDC_SIZE) {
-        error_report("RAM size " RAM_ADDR_FMT " above max supported (%08x)",
-                     machine->ram_size, FSL_IMX6_MMDC_SIZE);
-        exit(1);
+        error_report_exit("RAM size " RAM_ADDR_FMT " above max supported (%08x)",
+                          machine->ram_size, FSL_IMX6_MMDC_SIZE);
     }
 
     object_initialize(&s->soc, sizeof(s->soc), TYPE_FSL_IMX6);
@@ -61,8 +60,7 @@ static void sabrelite_init(MachineState *machine)
 
     object_property_set_bool(OBJECT(&s->soc), true, "realized", &err);
     if (err != NULL) {
-        error_report("%s", error_get_pretty(err));
-        exit(1);
+        error_report_exit("%s", error_get_pretty(err));
     }
 
     memory_region_allocate_system_memory(&s->ram, NULL, "sabrelite.ram",
hw/arm/strongarm.c +2 -4
index f1b2c6c..2c2c283 100644
@@ -1589,15 +1589,13 @@ StrongARMState *sa1110_init(MemoryRegion *sysmem,
     }
 
     if (strncmp(rev, "sa1110", 6)) {
-        error_report("Machine requires a SA1110 processor.");
-        exit(1);
+        error_report_exit("Machine requires a SA1110 processor.");
     }
 
     s->cpu = cpu_arm_init(rev);
 
     if (!s->cpu) {
-        error_report("Unable to find CPU definition");
-        exit(1);
+        error_report_exit("Unable to find CPU definition");
     }
 
     memory_region_allocate_system_memory(&s->sdram, NULL, "strongarm.sdram",
hw/arm/sysbus-fdt.c +2 -3
index 5debb33..be5245d 100644
@@ -448,9 +448,8 @@ static int add_fdt_node(SysBusDevice *sbdev, void *opaque)
             return 0;
         }
     }
-    error_report("Device %s can not be dynamically instantiated",
-                     qdev_fw_name(DEVICE(sbdev)));
-    exit(1);
+    error_report_exit("Device %s can not be dynamically instantiated",
+                      qdev_fw_name(DEVICE(sbdev)));
 }
 
 /**
hw/arm/vexpress.c +6 -8
index 58760f4..2e98554 100644
@@ -568,22 +568,20 @@ static void vexpress_common_init(MachineState *machine)
         int image_size;
 
         if (drive_get(IF_PFLASH, 0, 0)) {
-            error_report("The contents of the first flash device may be "
-                         "specified with -bios or with -drive if=pflash... "
-                         "but you cannot use both options at once");
-            exit(1);
+            error_report_exit("The contents of the first flash device may "
+                              "be specified with -bios or with -drive "
+                              "if=pflash... but you cannot use both "
+                              "options at once");
         }
         fn = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
         if (!fn) {
-            error_report("Could not find ROM image '%s'", bios_name);
-            exit(1);
+            error_report_exit("Could not find ROM image '%s'", bios_name);
         }
         image_size = load_image_targphys(fn, map[VE_NORFLASH0],
                                          VEXPRESS_FLASH_SIZE);
         g_free(fn);
         if (image_size < 0) {
-            error_report("Could not load ROM image '%s'", bios_name);
-            exit(1);
+            error_report_exit("Could not load ROM image '%s'", bios_name);
         }
     }
 
hw/arm/virt.c +16 -26

98 lines not on this page · raw message

hw/arm/xlnx-ep108.c +3 -6
index 4ec590a..d2aca6e 100644
@@ -40,10 +40,8 @@ static void xlnx_ep108_init(MachineState *machine)
 
     /* Create the memory region to pass to the SoC */
     if (ram_size > XLNX_ZYNQMP_MAX_RAM_SIZE) {
-        error_report("ERROR: RAM size 0x%" PRIx64 " above max supported of "
-                     "0x%llx", ram_size,
-                     XLNX_ZYNQMP_MAX_RAM_SIZE);
-        exit(1);
+        error_report_exit("ERROR: RAM size 0x%" PRIx64 " above max supported "
+                          "of 0x%llx", ram_size, XLNX_ZYNQMP_MAX_RAM_SIZE);
     }
 
     if (ram_size < 0x08000000) {
@@ -75,8 +73,7 @@ static void xlnx_ep108_init(MachineState *machine)
         bus = qdev_get_child_bus(DEVICE(&s->soc), bus_name);
         g_free(bus_name);
         if (!bus) {
-            error_report("No SD bus found for SD card %d", i);
-            exit(1);
+            error_report_exit("No SD bus found for SD card %d", i);
         }
         carddev = qdev_create(bus, TYPE_SD_CARD);
         qdev_prop_set_drive(carddev, "drive", blk, &error_fatal);
hw/block/tc58128.c +1 -2
index 1d9f7ee..e408b42 100644
@@ -40,8 +40,7 @@ static void init_dev(tc58128_dev * dev, const char *filename)
 	ret = load_image(filename, dev->flash_contents + 528 * 32);
 	if (ret < 0) {
             if (!qtest_enabled()) {
-                error_report("Could not load flash image %s", filename);
-                exit(1);
+                error_report_exit("Could not load flash image %s", filename);
             }
 	} else {
 	    /* Build first block with number of blocks */
hw/block/virtio-blk.c +3 -6
index 331d766..0f4f99f 100644
@@ -477,21 +477,18 @@ void virtio_blk_handle_request(VirtIOBlockReq *req, MultiReqBuffer *mrb)
     unsigned out_num = req->elem.out_num;
 
     if (req->elem.out_num < 1 || req->elem.in_num < 1) {
-        error_report("virtio-blk missing headers");
-        exit(1);
+        error_report_exit("virtio-blk missing headers");
     }
 
     if (unlikely(iov_to_buf(iov, out_num, 0, &req->out,
                             sizeof(req->out)) != sizeof(req->out))) {
-        error_report("virtio-blk request outhdr too short");
-        exit(1);
+        error_report_exit("virtio-blk request outhdr too short");
     }
 
     iov_discard_front(&iov, &out_num, sizeof(req->out));
 
     if (in_iov[in_num - 1].iov_len < sizeof(struct virtio_blk_inhdr)) {
-        error_report("virtio-blk request inhdr too short");
-        exit(1);
+        error_report_exit("virtio-blk request inhdr too short");
     }
 
     /* We always touch the last byte, so just see how big in_iov is.  */
hw/char/exynos4210_uart.c +4 -5
index 885ecc0..dce0acf 100644
@@ -597,17 +597,16 @@ DeviceState *exynos4210_uart_create(hwaddr addr,
 
     if (!chr) {
         if (channel >= MAX_SERIAL_PORTS) {
-            error_report("Only %d serial ports are supported by QEMU",
-                         MAX_SERIAL_PORTS);
-            exit(1);
+            error_report_exit("Only %d serial ports are supported by QEMU",
+                              MAX_SERIAL_PORTS);
         }
         chr = serial_hds[channel];
         if (!chr) {
             snprintf(label, ARRAY_SIZE(label), "%s%d", chr_name, channel);
             chr = qemu_chr_new(label, "null", NULL);
             if (!(chr)) {
-                error_report("Can't assign serial port to UART%d", channel);
-                exit(1);
+                error_report_exit("Can't assign serial port to UART%d",
+                                  channel);
             }
         }
     }
hw/core/machine.c +2 -3
index e5a456f..4d7fdb6 100644
@@ -334,9 +334,8 @@ static bool machine_get_enforce_config_section(Object *obj, Error **errp)
 
 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);
+    error_report_exit("Option '-device %s' cannot be handled by this machine",
+                      object_class_get_name(object_get_class(OBJECT(sbdev))));
 }
 
 static void machine_init_notify(Notifier *notifier, void *data)
hw/core/platform-bus.c +3 -5
index 36f84ab..e97e1a3 100644
@@ -121,8 +121,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);
+        error_report_exit("Platform Bus: Can not fit IRQ line");
     }
 
     set_bit(irqn, pbus->used_irqs);
@@ -155,9 +154,8 @@ 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);
+        error_report_exit("Platform Bus: Can not fit MMIO region of size %" PRIx64,
+                          size);
     }
 
     /* Map the device's region into our Platform Bus MMIO space */
hw/i386/intel_iommu.c +2 -3
index 28c31a2..a763c7a 100644
@@ -2471,9 +2471,8 @@ static void vtd_realize(DeviceState *dev, Error **errp)
     /* Currently Intel IOMMU IR only support "kernel-irqchip={off|split}" */
     if (x86_iommu->intr_supported && kvm_irqchip_in_kernel() &&
         !kvm_irqchip_is_split()) {
-        error_report("Intel Interrupt Remapping cannot work with "
-                     "kernel-irqchip=on, please use 'split|off'.");
-        exit(1);
+        error_report_exit("Intel Interrupt Remapping cannot work with "
+                          "kernel-irqchip=on, please use 'split|off'.");
     }
 }
 
hw/i386/pc.c +14 -21
index 022dd1b..dc90ad9 100644
@@ -1168,14 +1168,13 @@ void pc_cpus_init(PCMachineState *pcms)
 
     model_pieces = g_strsplit(machine->cpu_model, ",", 2);
     if (!model_pieces[0]) {
-        error_report("Invalid/empty CPU model name");
-        exit(1);
+        error_report_exit("Invalid/empty CPU model name");
     }
 
     oc = cpu_class_by_name(TYPE_X86_CPU, model_pieces[0]);
     if (oc == NULL) {
-        error_report("Unable to find CPU definition: %s", model_pieces[0]);
-        exit(1);
+        error_report_exit("Unable to find CPU definition: %s",
+                          model_pieces[0]);
     }
     typename = object_class_get_name(oc);
     cc = CPU_CLASS(oc);
@@ -1191,9 +1190,8 @@ void pc_cpus_init(PCMachineState *pcms)
      */
     pcms->apic_id_limit = x86_cpu_apic_id_from_index(max_cpus - 1) + 1;
     if (pcms->apic_id_limit > ACPI_CPU_HOTPLUG_ID_LIMIT) {
-        error_report("max_cpus is too large. APIC ID of last CPU is %u",
-                     pcms->apic_id_limit - 1);
-        exit(1);
+        error_report_exit("max_cpus is too large. APIC ID of last CPU is %u",
+                          pcms->apic_id_limit - 1);
     }
 
     pcms->possible_cpus = g_malloc0(sizeof(CPUArchIdList) +
@@ -1392,9 +1390,8 @@ void pc_memory_init(PCMachineState *pcms,
          (machine->maxram_size > machine->ram_size))) {
         MachineClass *mc = MACHINE_GET_CLASS(machine);
 
-        error_report("\"-memory 'slots|maxmem'\" is not supported by: %s",
-                     mc->name);
-        exit(EXIT_FAILURE);
+        error_report_exit("\"-memory 'slots|maxmem'\" is not supported by: %s",
+                          mc->name);
     }
 
     /* initialize hotplug memory address space */
@@ -1404,16 +1401,14 @@ void pc_memory_init(PCMachineState *pcms,
             machine->maxram_size - machine->ram_size;
 
         if (machine->ram_slots > ACPI_MAX_RAM_SLOTS) {
-            error_report("unsupported amount of memory slots: %"PRIu64,
-                         machine->ram_slots);
-            exit(EXIT_FAILURE);
+            error_report_exit("unsupported amount of memory slots: %" PRIu64,
+                              machine->ram_slots);
         }
 
         if (QEMU_ALIGN_UP(machine->maxram_size,
                           TARGET_PAGE_SIZE) != machine->maxram_size) {
-            error_report("maximum memory size must by aligned to multiple of "
-                         "%d bytes", TARGET_PAGE_SIZE);
-            exit(EXIT_FAILURE);
+            error_report_exit("maximum memory size must by aligned to multiple"
+                              " of %d bytes", TARGET_PAGE_SIZE);
         }
 
         pcms->hotplug_memory.base =
@@ -1426,9 +1421,8 @@ void pc_memory_init(PCMachineState *pcms,
 
         if ((pcms->hotplug_memory.base + hotplug_mem_size) <
             hotplug_mem_size) {
-            error_report("unsupported amount of maximum memory: " RAM_ADDR_FMT,
-                         machine->maxram_size);
-            exit(EXIT_FAILURE);
+            error_report_exit("unsupported amount of maximum memory: " RAM_ADDR_FMT,
+                              machine->maxram_size);
         }
 
         memory_region_init(&pcms->hotplug_memory.mr, OBJECT(pcms),
@@ -2092,8 +2086,7 @@ bool pc_machine_is_smm_enabled(PCMachineState *pcms)
     }
 
     if (pcms->smm == ON_OFF_AUTO_ON) {
-        error_report("System Management Mode not supported by this hypervisor.");
-        exit(1);
+        error_report_exit("System Management Mode not supported by this hypervisor.");
     }
     return false;
 }
hw/i386/pc_piix.c +1 -2
index a07dc81..f4d15ef 100644
@@ -404,8 +404,7 @@ static void pc_xen_hvm_init(MachineState *machine)
     PCIBus *bus;
 
     if (!xen_enabled()) {
-        error_report("xenfv machine requires the xen accelerator");
-        exit(1);
+        error_report_exit("xenfv machine requires the xen accelerator");
     }
 
     pc_xen_hvm_init_pci(machine);
hw/i386/x86-iommu.c +2 -3
index ce26b2a..12429a6 100644
@@ -58,9 +58,8 @@ static void x86_iommu_set_default(X86IOMMUState *x86_iommu)
     assert(x86_iommu);
 
     if (x86_iommu_default) {
-        error_report("QEMU does not support multiple vIOMMUs "
-                     "for x86 yet.");
-        exit(1);
+        error_report_exit("QEMU does not support multiple vIOMMUs "
+                          "for x86 yet.");
     }
 
     x86_iommu_default = x86_iommu;
hw/ide/core.c +2 -3
index 45b6df1..aa85502 100644
@@ -2851,9 +2851,8 @@ void ide_drive_get(DriveInfo **hd, int n)
      */
 
     if (highest_bus > n_buses) {
-        error_report("Too many IDE buses defined (%d > %d)",
-                     highest_bus, n_buses);
-        exit(1);
+        error_report_exit("Too many IDE buses defined (%d > %d)", highest_bus,
+                          n_buses);
     }
 
     for (i = 0; i < n; i++) {
hw/intc/ioapic.c +2 -3
index 31791b0..aaa06fe 100644
@@ -400,9 +400,8 @@ static void ioapic_realize(DeviceState *dev, Error **errp)
     IOAPICCommonState *s = IOAPIC_COMMON(dev);
 
     if (s->version != 0x11 && s->version != 0x20) {
-        error_report("IOAPIC only supports version 0x11 or 0x20 "
-                     "(default: 0x11).");
-        exit(1);
+        error_report_exit("IOAPIC only supports version 0x11 or 0x20 "
+                          "(default: 0x11).");
     }
 
     memory_region_init_io(&s->io_memory, OBJECT(s), &ioapic_io_ops, s,
hw/intc/xics_kvm.c +6 -9
index edbd62f..f35e42c 100644
@@ -65,9 +65,8 @@ static void icp_get_kvm_state(ICPState *ss)
 
     ret = kvm_vcpu_ioctl(ss->cs, KVM_GET_ONE_REG, &reg);
     if (ret != 0) {
-        error_report("Unable to retrieve KVM interrupt controller state"
-                " for CPU %ld: %s", kvm_arch_vcpu_id(ss->cs), strerror(errno));
-        exit(1);
+        error_report_exit("Unable to retrieve KVM interrupt controller state" " for CPU %ld: %s",
+                          kvm_arch_vcpu_id(ss->cs), strerror(errno));
     }
 
     ss->xirr = state >> KVM_REG_PPC_ICP_XISR_SHIFT;
@@ -162,9 +161,8 @@ static void ics_get_kvm_state(ICSState *ics)
 
         ret = ioctl(xicskvm->kernel_xics_fd, KVM_GET_DEVICE_ATTR, &attr);
         if (ret != 0) {
-            error_report("Unable to retrieve KVM interrupt controller state"
-                    " for IRQ %d: %s", i + ics->offset, strerror(errno));
-            exit(1);
+            error_report_exit("Unable to retrieve KVM interrupt controller state" " for IRQ %d: %s",
+                              i + ics->offset, strerror(errno));
         }
 
         irq->server = state & KVM_XICS_DESTINATION_MASK;
@@ -354,9 +352,8 @@ static void xics_kvm_cpu_setup(XICSState *xics, PowerPCCPU *cpu)
                                   xicskvm->kernel_xics_fd,
                                   kvm_arch_vcpu_id(cs));
         if (ret < 0) {
-            error_report("Unable to connect CPU%ld to kernel XICS: %s",
-                    kvm_arch_vcpu_id(cs), strerror(errno));
-            exit(1);
+            error_report_exit("Unable to connect CPU%ld to kernel XICS: %s",
+                              kvm_arch_vcpu_id(cs), strerror(errno));
         }
         ss->cap_irq_xics_enabled = true;
     }
hw/m68k/an5206.c +1 -2
index 142bab9..03879c5 100644
@@ -44,8 +44,7 @@ static void an5206_init(MachineState *machine)
     }
     cpu = cpu_m68k_init(cpu_model);
     if (!cpu) {
-        error_report("Unable to find m68k CPU definition");
-        exit(1);
+        error_report_exit("Unable to find m68k CPU definition");
     }
     env = &cpu->env;
 
hw/microblaze/boot.c +2 -3
index 9eebb1a..f5132c0 100644
@@ -190,9 +190,8 @@ void microblaze_load_kernel(MicroBlazeCPU *cpu, hwaddr ddr_base,
                                                   ram_size - initrd_offset);
             }
             if (initrd_size < 0) {
-                error_report("qemu: could not load initrd '%s'",
-                             initrd_filename);
-                exit(EXIT_FAILURE);
+                error_report_exit("qemu: could not load initrd '%s'",
+                                  initrd_filename);
             }
             boot_info.initrd_end = boot_info.initrd_start + initrd_size;
             high = ROUND_UP(high + initrd_size, 4);
hw/mips/mips_fulong2e.c +1 -2
index 889cdc7..75fe1a3 100644
@@ -328,8 +328,7 @@ static void mips_fulong2e_init(MachineState *machine)
 
         if ((bios_size < 0 || bios_size > BIOS_SIZE) &&
             !kernel_filename && !qtest_enabled()) {
-            error_report("Could not load MIPS bios '%s'", bios_name);
-            exit(1);
+            error_report_exit("Could not load MIPS bios '%s'", bios_name);
         }
     }
 
hw/mips/mips_jazz.c +1 -2
index 73f6c9f..5d46691 100644
@@ -196,8 +196,7 @@ static void mips_jazz_init(MachineState *machine,
         bios_size = -1;
     }
     if ((bios_size < 0 || bios_size > MAGNUM_BIOS_SIZE) && !qtest_enabled()) {
-        error_report("Could not load MIPS bios '%s'", bios_name);
-        exit(1);
+        error_report_exit("Could not load MIPS bios '%s'", bios_name);
     }
 
     /* Init CPU internal devices */
hw/mips/mips_malta.c +12 -14
index e90857e..404046d 100644
@@ -809,17 +809,16 @@ static int64_t load_kernel (void)
     /* Sanity check where the kernel has been linked */
     if (kvm_enabled()) {
         if (kernel_entry & 0x80000000ll) {
-            error_report("KVM guest kernels must be linked in useg. "
-                         "Did you forget to enable CONFIG_KVM_GUEST?");
-            exit(1);
+            error_report_exit("KVM guest kernels must be linked in useg. "
+                              "Did you forget to enable CONFIG_KVM_GUEST?");
         }
 
         xlate_to_kseg0 = cpu_mips_kvm_um_phys_to_kseg0;
     } else {
         if (!(kernel_entry & 0x80000000ll)) {
-            error_report("KVM guest kernels aren't supported with TCG. "
-                         "Did you unintentionally enable CONFIG_KVM_GUEST?");
-            exit(1);
+            error_report_exit("KVM guest kernels aren't supported with TCG. "
+                              "Did you unintentionally enable "
+                              "CONFIG_KVM_GUEST?");
         }
 
         xlate_to_kseg0 = cpu_mips_phys_to_kseg0;
@@ -949,8 +948,7 @@ static void create_cps(MaltaState *s, const char *cpu_model,
     object_property_set_int(OBJECT(s->cps), smp_cpus, "num-vp", &err);
     object_property_set_bool(OBJECT(s->cps), true, "realized", &err);
     if (err != NULL) {
-        error_report("%s", error_get_pretty(err));
-        exit(1);
+        error_report_exit("%s", error_get_pretty(err));
     }
 
     sysbus_mmio_map_overlap(SYS_BUS_DEVICE(s->cps), 0, 0, 1);
@@ -1119,9 +1117,9 @@ void mips_malta_init(MachineState *machine)
     } else {
         /* The flash region isn't executable from a KVM guest */
         if (kvm_enabled()) {
-            error_report("KVM enabled but no -kernel argument was specified. "
-                         "Booting from flash is not supported with KVM.");
-            exit(1);
+            error_report_exit("KVM enabled but no -kernel argument was "
+                              "specified. Booting from flash is not "
+                              "supported with KVM.");
         }
         /* Load firmware from flash. */
         if (!dinfo) {
@@ -1139,9 +1137,9 @@ void mips_malta_init(MachineState *machine)
             }
             if ((bios_size < 0 || bios_size > BIOS_SIZE) &&
                 !kernel_filename && !qtest_enabled()) {
-                error_report("Could not load MIPS bios '%s', and no "
-                             "-kernel argument was specified", bios_name);
-                exit(1);
+                error_report_exit("Could not load MIPS bios '%s', and no "
+                                  "-kernel argument was specified",
+                                  bios_name);
             }
         }
         /* In little endian mode the 32bit words in the bios are swapped,
hw/mips/mips_mipssim.c +2 -3
index 1b91195..8c8f09b 100644
@@ -199,9 +199,8 @@ mips_mipssim_init(MachineState *machine)
     if ((bios_size < 0 || bios_size > BIOS_SIZE) &&
         !kernel_filename && !qtest_enabled()) {
         /* Bail out if we have neither a kernel image nor boot vector code. */
-        error_report("Could not load MIPS bios '%s', and no "
-                     "-kernel argument was specified", bios_name);
-        exit(1);
+        error_report_exit("Could not load MIPS bios '%s', and no "
+                          "-kernel argument was specified", bios_name);
     } else {
         /* We have a boot vector start address. */
         env->active_tc.PC = (target_long)(int32_t)0xbfc00000;
hw/net/virtio-net.c +11 -16
index 01f1351..d2c31dd 100644
@@ -892,8 +892,7 @@ static void virtio_net_handle_ctrl(VirtIODevice *vdev, VirtQueue *vq)
         }
         if (iov_size(elem->in_sg, elem->in_num) < sizeof(status) ||
             iov_size(elem->out_sg, elem->out_num) < sizeof(ctrl)) {
-            error_report("virtio-net ctrl missing headers");
-            exit(1);
+            error_report_exit("virtio-net ctrl missing headers");
         }
 
         iov_cnt = elem->out_num;
@@ -1124,19 +1123,17 @@ static ssize_t virtio_net_receive(NetClientState *nc, const uint8_t *buf, size_t
         if (!elem) {
             if (i == 0)
                 return -1;
-            error_report("virtio-net unexpected empty queue: "
-                         "i %zd mergeable %d offset %zd, size %zd, "
-                         "guest hdr len %zd, host hdr len %zd "
-                         "guest features 0x%" PRIx64,
-                         i, n->mergeable_rx_bufs, offset, size,
-                         n->guest_hdr_len, n->host_hdr_len,
-                         vdev->guest_features);
-            exit(1);
+            error_report_exit("virtio-net unexpected empty queue: "
+                              "i %zd mergeable %d offset %zd, size %zd, "
+                              "guest hdr len %zd, host hdr len %zd "
+                              "guest features 0x%" PRIx64,
+                              i, n->mergeable_rx_bufs, offset, size,
+                              n->guest_hdr_len, n->host_hdr_len,
+                              vdev->guest_features);
         }
 
         if (elem->in_num < 1) {
-            error_report("virtio-net receive queue contains no in buffers");
-            exit(1);
+            error_report_exit("virtio-net receive queue contains no in buffers");
         }
 
         sg = elem->in_sg;
@@ -1238,15 +1235,13 @@ static int32_t virtio_net_flush_tx(VirtIONetQueue *q)
         out_num = elem->out_num;
         out_sg = elem->out_sg;
         if (out_num < 1) {
-            error_report("virtio-net header not in first element");
-            exit(1);
+            error_report_exit("virtio-net header not in first element");
         }
 
         if (n->has_vnet_hdr) {
             if (iov_to_buf(out_sg, out_num, 0, &mhdr, n->guest_hdr_len) <
                 n->guest_hdr_len) {
-                error_report("virtio-net header incorrect");
-                exit(1);
+                error_report_exit("virtio-net header incorrect");
             }
             if (n->needs_vnet_hdr_swap) {
                 virtio_net_hdr_swap(vdev, (void *) &mhdr);
hw/nvram/fw_cfg.c +2 -3
index 6a68e59..19ca9e0 100644
@@ -805,9 +805,8 @@ void fw_cfg_add_file_callback(FWCfgState *s,  const char *filename,
     for (i = 0; i <= count; i++) {
         if (i != index &&
             strcmp(s->files->f[index].name, s->files->f[i].name) == 0) {
-            error_report("duplicate fw_cfg file name: %s",
-                         s->files->f[index].name);
-            exit(1);
+            error_report_exit("duplicate fw_cfg file name: %s",
+                              s->files->f[index].name);
         }
     }
 
hw/pci/pci.c +2 -3
index 24fae16..f2893e5 100644
@@ -1797,9 +1797,8 @@ PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
 
     bus = pci_get_bus_devfn(&devfn, rootbus, devaddr);
     if (!bus) {
-        error_report("Invalid PCI device address %s for device %s",
-                     devaddr, pci_nic_names[i]);
-        exit(1);
+        error_report_exit("Invalid PCI device address %s for device %s",
+                          devaddr, pci_nic_names[i]);
     }
 
     pci_dev = pci_create(bus, devfn, pci_nic_names[i]);
hw/ppc/e500.c +2 -3
index 0cd534d..a864e81 100644
@@ -207,9 +207,8 @@ static int sysbus_device_create_devtree(SysBusDevice *sbdev, void *opaque)
     }
 
     if (!matched) {
-        error_report("Device %s is not supported by this machine yet.",
-                     qdev_fw_name(DEVICE(sbdev)));
-        exit(1);
+        error_report_exit("Device %s is not supported by this machine yet.",
+                          qdev_fw_name(DEVICE(sbdev)));
     }
 
     return 0;
hw/ppc/mac_newworld.c +5 -9
index 7d25106..4e6c310 100644
@@ -230,8 +230,7 @@ static void ppc_core99_init(MachineState *machine)
         bios_size = -1;
     }
     if (bios_size < 0 || bios_size > BIOS_SIZE) {
-        error_report("could not load PowerPC bios '%s'", bios_name);
-        exit(1);
+        error_report_exit("could not load PowerPC bios '%s'", bios_name);
     }
 
     if (linux_boot) {
@@ -257,8 +256,7 @@ static void ppc_core99_init(MachineState *machine)
                                               kernel_base,
                                               ram_size - kernel_base);
         if (kernel_size < 0) {
-            error_report("could not load kernel '%s'", kernel_filename);
-            exit(1);
+            error_report_exit("could not load kernel '%s'", kernel_filename);
         }
         /* load initrd */
         if (initrd_filename) {
@@ -266,9 +264,8 @@ static void ppc_core99_init(MachineState *machine)
             initrd_size = load_image_targphys(initrd_filename, initrd_base,
                                               ram_size - initrd_base);
             if (initrd_size < 0) {
-                error_report("could not load initial ram disk '%s'",
-                             initrd_filename);
-                exit(1);
+                error_report_exit("could not load initial ram disk '%s'",
+                                  initrd_filename);
             }
             cmdline_base = round_page(initrd_base + initrd_size);
         } else {
@@ -349,8 +346,7 @@ static void ppc_core99_init(MachineState *machine)
             break;
 #endif /* defined(TARGET_PPC64) */
         default:
-            error_report("Bus model not supported on mac99 machine");
-            exit(1);
+            error_report_exit("Bus model not supported on mac99 machine");
         }
     }
 
hw/ppc/mac_oldworld.c +6 -11
index 4479487..30b59c2 100644
@@ -157,8 +157,7 @@ static void ppc_heathrow_init(MachineState *machine)
         bios_size = -1;
     }
     if (bios_size < 0 || bios_size > BIOS_SIZE) {
-        error_report("could not load PowerPC bios '%s'", bios_name);
-        exit(1);
+        error_report_exit("could not load PowerPC bios '%s'", bios_name);
     }
 
     if (linux_boot) {
@@ -183,8 +182,7 @@ static void ppc_heathrow_init(MachineState *machine)
                                               kernel_base,
                                               ram_size - kernel_base);
         if (kernel_size < 0) {
-            error_report("could not load kernel '%s'", kernel_filename);
-            exit(1);
+            error_report_exit("could not load kernel '%s'", kernel_filename);
         }
         /* load initrd */
         if (initrd_filename) {
@@ -192,9 +190,8 @@ static void ppc_heathrow_init(MachineState *machine)
             initrd_size = load_image_targphys(initrd_filename, initrd_base,
                                               ram_size - initrd_base);
             if (initrd_size < 0) {
-                error_report("could not load initial ram disk '%s'",
-                             initrd_filename);
-                exit(1);
+                error_report_exit("could not load initial ram disk '%s'",
+                                  initrd_filename);
             }
             cmdline_base = round_page(initrd_base + initrd_size);
         } else {
@@ -250,8 +247,7 @@ static void ppc_heathrow_init(MachineState *machine)
                 ((qemu_irq *)env->irq_inputs)[PPC6xx_INPUT_INT];
             break;
         default:
-            error_report("Bus model not supported on OldWorld Mac machine");
-            exit(1);
+            error_report_exit("Bus model not supported on OldWorld Mac machine");
         }
     }
 
@@ -264,8 +260,7 @@ static void ppc_heathrow_init(MachineState *machine)
 
     /* init basic PC hardware */
     if (PPC_INPUT(env) != PPC_FLAGS_INPUT_6xx) {
-        error_report("Only 6xx bus is supported on heathrow machine");
-        exit(1);
+        error_report_exit("Only 6xx bus is supported on heathrow machine");
     }
     pic = heathrow_pic_init(&pic_mem, 1, heathrow_irqs);
     pci_bus = pci_grackle_init(0xfec00000, pic,
hw/ppc/mpc8544ds.c +1 -2
index 27b8289..a8d5604 100644
@@ -42,8 +42,7 @@ static void mpc8544ds_init(MachineState *machine)
     };
 
     if (machine->ram_size > 0xc0000000) {
-        error_report("The MPC8544DS board only supports up to 3GB of RAM");
-        exit(1);
+        error_report_exit("The MPC8544DS board only supports up to 3GB of RAM");
     }
 
     ppce500_init(machine, &params);
hw/ppc/ppc405_boards.c +6 -8
index 4b2f07a..3eb96b9 100644
@@ -265,14 +265,13 @@ static void ref405ep_init(MachineState *machine)
             bios_size = load_image(filename, memory_region_get_ram_ptr(bios));
             g_free(filename);
             if (bios_size < 0 || bios_size > BIOS_SIZE) {
-                error_report("Could not load PowerPC BIOS '%s'", bios_name);
-                exit(1);
+                error_report_exit("Could not load PowerPC BIOS '%s'",
+                                  bios_name);
             }
             bios_size = (bios_size + 0xfff) & ~0xfff;
             memory_region_add_subregion(sysmem, (uint32_t)(-bios_size), bios);
         } else if (!qtest_enabled() || kernel_filename != NULL) {
-            error_report("Could not load PowerPC BIOS '%s'", bios_name);
-            exit(1);
+            error_report_exit("Could not load PowerPC BIOS '%s'", bios_name);
         } else {
             /* Avoid an uninitialized variable warning */
             bios_size = -1;
@@ -563,14 +562,13 @@ static void taihu_405ep_init(MachineState *machine)
             bios_size = load_image(filename, memory_region_get_ram_ptr(bios));
             g_free(filename);
             if (bios_size < 0 || bios_size > BIOS_SIZE) {
-                error_report("Could not load PowerPC BIOS '%s'", bios_name);
-                exit(1);
+                error_report_exit("Could not load PowerPC BIOS '%s'",
+                                  bios_name);
             }
             bios_size = (bios_size + 0xfff) & ~0xfff;
             memory_region_add_subregion(sysmem, (uint32_t)(-bios_size), bios);
         } else if (!qtest_enabled()) {
-            error_report("Could not load PowerPC BIOS '%s'", bios_name);
-            exit(1);
+            error_report_exit("Could not load PowerPC BIOS '%s'", bios_name);
         }
         memory_region_set_readonly(bios, true);
     }
hw/ppc/prep.c +4 -7
index 054af1e..08bb268 100644
@@ -536,8 +536,7 @@ static void ppc_prep_init(MachineState *machine)
         kernel_size = load_image_targphys(kernel_filename, kernel_base,
                                           ram_size - kernel_base);
         if (kernel_size < 0) {
-            error_report("could not load kernel '%s'", kernel_filename);
-            exit(1);
+            error_report_exit("could not load kernel '%s'", kernel_filename);
         }
         /* load initrd */
         if (initrd_filename) {
@@ -545,9 +544,8 @@ static void ppc_prep_init(MachineState *machine)
             initrd_size = load_image_targphys(initrd_filename, initrd_base,
                                               ram_size - initrd_base);
             if (initrd_size < 0) {
-                error_report("could not load initial ram disk '%s'",
-                             initrd_filename);
-                exit(1);
+                error_report_exit("could not load initial ram disk '%s'",
+                                  initrd_filename);
             }
         } else {
             initrd_base = 0;
@@ -574,8 +572,7 @@ static void ppc_prep_init(MachineState *machine)
     }
 
     if (PPC_INPUT(env) != PPC_FLAGS_INPUT_6xx) {
-        error_report("Only 6xx bus is supported on PREP machine");
-        exit(1);
+        error_report_exit("Only 6xx bus is supported on PREP machine");
     }
 
     dev = qdev_create(NULL, "raven-pcihost");
hw/ppc/spapr.c +31 -54

194 lines not on this page · raw message

hw/ppc/virtex_ml507.c +2 -3
index b97d966..1031113 100644
@@ -282,9 +282,8 @@ static void virtex_init(MachineState *machine)
                                               high, ram_size - high);
 
             if (initrd_size < 0) {
-                error_report("couldn't load ram disk '%s'",
-                             machine->initrd_filename);
-                exit(1);
+                error_report_exit("couldn't load ram disk '%s'",
+                                  machine->initrd_filename);
             }
             high = ROUND_UP(high + initrd_size, 4);
         }
hw/scsi/vhost-scsi.c +3 -7
index 5b26946..5dc9320 100644
@@ -171,8 +171,7 @@ static void vhost_scsi_set_config(VirtIODevice *vdev,
 
     if ((uint32_t) virtio_ldl_p(vdev, &scsiconf->sense_size) != vs->sense_size ||
         (uint32_t) virtio_ldl_p(vdev, &scsiconf->cdb_size) != vs->cdb_size) {
-        error_report("vhost-scsi does not support changing the sense data and CDB sizes");
-        exit(1);
+        error_report_exit("vhost-scsi does not support changing the sense data and CDB sizes");
     }
 }
 
@@ -190,11 +189,8 @@ static void vhost_scsi_set_status(VirtIODevice *vdev, uint8_t val)
 
         ret = vhost_scsi_start(s);
         if (ret < 0) {
-            error_report("virtio-scsi: unable to start vhost: %s",
-                         strerror(-ret));
-
-            /* There is no userspace virtio-scsi fallback so exit */
-            exit(1);
+            error_report_exit("virtio-scsi: unable to start vhost: %s",
+                              strerror(-ret));
         }
     } else {
         vhost_scsi_stop(s);
hw/scsi/virtio-scsi.c +3 -6
index ce57ef6..f6d6869 100644
@@ -83,8 +83,7 @@ static void virtio_scsi_complete_req(VirtIOSCSIReq *req)
 
 static void virtio_scsi_bad_req(void)
 {
-    error_report("wrong size for virtio-scsi headers");
-    exit(1);
+    error_report_exit("wrong size for virtio-scsi headers");
 }
 
 static size_t qemu_sgl_concat(VirtIOSCSIReq *req, struct iovec *iov,
@@ -207,8 +206,7 @@ static void *virtio_scsi_load_request(QEMUFile *f, SCSIRequest *sreq)
 
     if (virtio_scsi_parse_req(req, sizeof(VirtIOSCSICmdReq) + vs->cdb_size,
                               sizeof(VirtIOSCSICmdResp) + vs->sense_size) < 0) {
-        error_report("invalid SCSI request migration data");
-        exit(1);
+        error_report_exit("invalid SCSI request migration data");
     }
 
     scsi_req_ref(sreq);
@@ -624,8 +622,7 @@ static void virtio_scsi_set_config(VirtIODevice *vdev,
 
     if ((uint32_t) virtio_ldl_p(vdev, &scsiconf->sense_size) >= 65536 ||
         (uint32_t) virtio_ldl_p(vdev, &scsiconf->cdb_size) >= 256) {
-        error_report("bad data written to virtio-scsi configuration space");
-        exit(1);
+        error_report_exit("bad data written to virtio-scsi configuration space");
     }
 
     vs->sense_size = virtio_ldl_p(vdev, &scsiconf->sense_size);
hw/sh4/shix.c +1 -2
index ccc9e75..b388189 100644
@@ -81,8 +81,7 @@ static void shix_init(MachineState *machine)
         bios_name = BIOS_FILENAME;
     ret = load_image_targphys(bios_name, 0, 0x4000);
     if (ret < 0 && !qtest_enabled()) {
-        error_report("Could not load SHIX bios '%s'", bios_name);
-        exit(1);
+        error_report_exit("Could not load SHIX bios '%s'", bios_name);
     }
 
     /* Register peripherals */
hw/smbios/smbios.c +15 -26

96 lines not on this page · raw message

hw/sparc/sun4m.c +7 -12
index 478fda8..51d3bad 100644
@@ -943,22 +943,19 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef,
                              slavio_irq[16], iommu, &ledma_irq, 1);
 
     if (graphic_depth != 8 && graphic_depth != 24) {
-        error_report("Unsupported depth: %d", graphic_depth);
-        exit (1);
+        error_report_exit("Unsupported depth: %d", graphic_depth);
     }
     num_vsimms = 0;
     if (num_vsimms == 0) {
         if (vga_interface_type == VGA_CG3) {
             if (graphic_depth != 8) {
-                error_report("Unsupported depth: %d", graphic_depth);
-                exit(1);
+                error_report_exit("Unsupported depth: %d", graphic_depth);
             }
 
             if (!(graphic_width == 1024 && graphic_height == 768) &&
                 !(graphic_width == 1152 && graphic_height == 900)) {
-                error_report("Unsupported resolution: %d x %d", graphic_width,
-                             graphic_height);
-                exit(1);
+                error_report_exit("Unsupported resolution: %d x %d",
+                                  graphic_width, graphic_height);
             }
 
             /* sbus irq 5 */
@@ -967,14 +964,12 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef,
         } else {
             /* If no display specified, default to TCX */
             if (graphic_depth != 8 && graphic_depth != 24) {
-                error_report("Unsupported depth: %d", graphic_depth);
-                exit(1);
+                error_report_exit("Unsupported depth: %d", graphic_depth);
             }
 
             if (!(graphic_width == 1024 && graphic_height == 768)) {
-                error_report("Unsupported resolution: %d x %d",
-                             graphic_width, graphic_height);
-                exit(1);
+                error_report_exit("Unsupported resolution: %d x %d",
+                                  graphic_width, graphic_height);
             }
 
             tcx_init(hwdef->tcx_base, slavio_irq[11], 0x00100000,
hw/tricore/tricore_testboard.c +3 -5
index 8d3520f..e987c9f 100644
@@ -50,9 +50,8 @@ static void tricore_load_kernel(CPUTriCoreState *env)
                            NULL, 0,
                            EM_TRICORE, 1, 0);
     if (kernel_size <= 0) {
-        error_report("qemu: no kernel file '%s'",
-                tricoretb_binfo.kernel_filename);
-        exit(1);
+        error_report_exit("qemu: no kernel file '%s'",
+                          tricoretb_binfo.kernel_filename);
     }
     env->PC = entry;
 
@@ -76,8 +75,7 @@ static void tricore_testboard_init(MachineState *machine, int board_id)
     }
     cpu = cpu_tricore_init(machine->cpu_model);
     if (!cpu) {
-        error_report("Unable to find CPU definition");
-        exit(1);
+        error_report_exit("Unable to find CPU definition");
     }
     env = &cpu->env;
     memory_region_init_ram(ext_cram, NULL, "powerlink_ext_c.ram", 2*1024*1024,
hw/unicore32/puv3.c +3 -6
index 31cd171..b21c6c3 100644
@@ -100,8 +100,7 @@ static void puv3_load_kernel(const char *kernel_filename)
     size = load_image_targphys(kernel_filename, KERNEL_LOAD_ADDR,
             KERNEL_MAX_SIZE);
     if (size < 0) {
-        error_report("Load kernel error: '%s'", kernel_filename);
-        exit(1);
+        error_report_exit("Load kernel error: '%s'", kernel_filename);
     }
 
     /* cheat curses that we have a graphic console, only under ocd console */
@@ -118,8 +117,7 @@ static void puv3_init(MachineState *machine)
     UniCore32CPU *cpu;
 
     if (initrd_filename) {
-        error_report("Please use kernel built-in initramdisk");
-        exit(1);
+        error_report_exit("Please use kernel built-in initramdisk");
     }
 
     if (!cpu_model) {
@@ -128,8 +126,7 @@ static void puv3_init(MachineState *machine)
 
     cpu = uc32_cpu_init(cpu_model);
     if (!cpu) {
-        error_report("Unable to find CPU definition");
-        exit(1);
+        error_report_exit("Unable to find CPU definition");
     }
     env = &cpu->env;
 
hw/virtio/virtio.c +15 -29

122 lines not on this page · raw message

hw/xtensa/sim.c +1 -3
index 5e94004..9c8408e 100644
@@ -68,9 +68,7 @@ static void xtensa_sim_init(MachineState *machine)
     for (n = 0; n < smp_cpus; n++) {
         cpu = cpu_xtensa_init(cpu_model);
         if (cpu == NULL) {
-            error_report("unable to find CPU definition '%s'",
-                         cpu_model);
-            exit(EXIT_FAILURE);
+            error_report_exit("unable to find CPU definition '%s'", cpu_model);
         }
         env = &cpu->env;
 
hw/xtensa/xtfpga.c +6 -10
index ac75949..1ec19e8 100644
@@ -234,9 +234,7 @@ static void lx_init(const LxBoardDesc *board, MachineState *machine)
     for (n = 0; n < smp_cpus; n++) {
         cpu = cpu_xtensa_init(cpu_model);
         if (cpu == NULL) {
-            error_report("unable to find CPU definition '%s'",
-                         cpu_model);
-            exit(EXIT_FAILURE);
+            error_report_exit("unable to find CPU definition '%s'", cpu_model);
         }
         env = &cpu->env;
 
@@ -323,8 +321,7 @@ static void lx_init(const LxBoardDesc *board, MachineState *machine)
             uint32_t dtb_addr = tswap32(cur_lowmem);
 
             if (!fdt) {
-                error_report("could not load DTB '%s'", dtb_filename);
-                exit(EXIT_FAILURE);
+                error_report_exit("could not load DTB '%s'", dtb_filename);
             }
 
             cpu_physical_memory_write(cur_lowmem, fdt, fdt_size);
@@ -343,8 +340,8 @@ static void lx_init(const LxBoardDesc *board, MachineState *machine)
                                                   lowmem_end - cur_lowmem);
             }
             if (initrd_size < 0) {
-                error_report("could not load initrd '%s'", initrd_filename);
-                exit(EXIT_FAILURE);
+                error_report_exit("could not load initrd '%s'",
+                                  initrd_filename);
             }
             initrd_location.start = tswap32(cur_lowmem);
             initrd_location.end = tswap32(cur_lowmem + initrd_size);
@@ -369,9 +366,8 @@ static void lx_init(const LxBoardDesc *board, MachineState *machine)
             if (success > 0 && is_linux) {
                 entry_point = ep;
             } else {
-                error_report("could not load kernel '%s'",
-                             kernel_filename);
-                exit(EXIT_FAILURE);
+                error_report_exit("could not load kernel '%s'",
+                                  kernel_filename);
             }
         }
         if (entry_point != env->pc) {
numa.c +9 -13
index 6289f46..8dc3565 100644
@@ -274,9 +274,8 @@ static void validate_numa_cpus(void)
                               MAX_CPUMASK_BITS)) {
             bitmap_and(seen_cpus, seen_cpus,
                        numa_info[i].node_cpu, MAX_CPUMASK_BITS);
-            error_report("CPU(s) present in multiple NUMA nodes: %s",
-                         enumerate_cpus(seen_cpus, max_cpus));
-            exit(EXIT_FAILURE);
+            error_report_exit("CPU(s) present in multiple NUMA nodes: %s",
+                              enumerate_cpus(seen_cpus, max_cpus));
         }
         bitmap_or(seen_cpus, seen_cpus,
                   numa_info[i].node_cpu, MAX_CPUMASK_BITS);
@@ -307,8 +306,7 @@ void parse_numa_opts(MachineClass *mc)
     for (i = max_numa_nodeid - 1; i >= 0; i--) {
         /* 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);
+            error_report_exit("numa: Node ID missing: %d", i);
         }
     }
 
@@ -349,10 +347,9 @@ void parse_numa_opts(MachineClass *mc)
             numa_total += numa_info[i].node_mem;
         }
         if (numa_total != ram_size) {
-            error_report("total memory for NUMA nodes (0x%" PRIx64 ")"
-                         " should equal RAM size (0x" RAM_ADDR_FMT ")",
-                         numa_total, ram_size);
-            exit(1);
+            error_report_exit("total memory for NUMA nodes (0x%" PRIx64 ")"
+                              " should equal RAM size (0x" RAM_ADDR_FMT ")",
+                              numa_total, ram_size);
         }
 
         for (i = 0; i < nb_numa_nodes; i++) {
@@ -458,10 +455,9 @@ void memory_region_allocate_system_memory(MemoryRegion *mr, Object *owner,
 
         if (memory_region_is_mapped(seg)) {
             char *path = object_get_canonical_path_component(OBJECT(backend));
-            error_report("memory backend %s is used multiple times. Each "
-                         "-numa option must use a different memdev value.",
-                         path);
-            exit(1);
+            error_report_exit("memory backend %s is used multiple times. Each "
+                              "-numa option must use a different memdev value.",
+                              path);
         }
 
         host_memory_backend_set_mapped(backend, true);
qemu-img.c +5 -10
index d2865a5..1ad6530 100644
@@ -2415,8 +2415,7 @@ static void dump_map_entry(OutputFormat output_format, MapEntry *e,
     switch (output_format) {
     case OFORMAT_HUMAN:
         if (e->data && !e->has_offset) {
-            error_report("File contains external, encrypted or compressed clusters.");
-            exit(1);
+            error_report_exit("File contains external, encrypted or compressed clusters.");
         }
         if (e->data && !e->zero) {
             printf("%#-16"PRIx64"%#-16"PRIx64"%#-16"PRIx64"%s\n",
@@ -3490,8 +3489,7 @@ typedef struct BenchData {
 static void bench_undrained_flush_cb(void *opaque, int ret)
 {
     if (ret < 0) {
-        error_report("Failed flush request: %s", strerror(-ret));
-        exit(EXIT_FAILURE);
+        error_report_exit("Failed flush request: %s", strerror(-ret));
     }
 }
 
@@ -3501,8 +3499,7 @@ static void bench_cb(void *opaque, int ret)
     BlockAIOCB *acb;
 
     if (ret < 0) {
-        error_report("Failed request: %s", strerror(-ret));
-        exit(EXIT_FAILURE);
+        error_report_exit("Failed request: %s", strerror(-ret));
     }
 
     if (b->in_flush) {
@@ -3529,8 +3526,7 @@ static void bench_cb(void *opaque, int ret)
 
                 acb = blk_aio_flush(b->blk, cb, b);
                 if (!acb) {
-                    error_report("Failed to issue flush request");
-                    exit(EXIT_FAILURE);
+                    error_report_exit("Failed to issue flush request");
                 }
             }
             if (b->drain_on_flush) {
@@ -3548,8 +3544,7 @@ static void bench_cb(void *opaque, int ret)
                                  bench_cb, b);
         }
         if (!acb) {
-            error_report("Failed to issue request");
-            exit(EXIT_FAILURE);
+            error_report_exit("Failed to issue request");
         }
         b->in_flight++;
         b->offset += b->step;
qemu-io.c +3 -6
index db129ea..d7b4c5a 100644
@@ -488,8 +488,7 @@ int main(int argc, char **argv)
             break;
         case 'd':
             if (bdrv_parse_discard_flags(optarg, &flags) < 0) {
-                error_report("Invalid discard option: %s", optarg);
-                exit(1);
+                error_report_exit("Invalid discard option: %s", optarg);
             }
             break;
         case 'f':
@@ -509,8 +508,7 @@ int main(int argc, char **argv)
             break;
         case 't':
             if (bdrv_parse_cache_mode(optarg, &flags, &writethrough) < 0) {
-                error_report("Invalid cache option: %s", optarg);
-                exit(1);
+                error_report_exit("Invalid cache option: %s", optarg);
             }
             break;
         case 'T':
@@ -546,8 +544,7 @@ int main(int argc, char **argv)
     }
 
     if (format && imageOpts) {
-        error_report("--image-opts and -f are mutually exclusive");
-        exit(1);
+        error_report_exit("--image-opts and -f are mutually exclusive");
     }
 
     if (qemu_init_main_loop(&local_error)) {
qemu-nbd.c +42 -71

271 lines not on this page · raw message

replay/replay-char.c +2 -4
index edf46ab..209c9c0 100755
@@ -115,8 +115,7 @@ void replay_char_write_event_load(int *res, int *offset)
         replay_mutex_unlock();
     } else {
         replay_mutex_unlock();
-        error_report("Missing character write event in the replay log");
-        exit(1);
+        error_report_exit("Missing character write event in the replay log");
     }
 }
 
@@ -139,8 +138,7 @@ int replay_char_read_all_load(uint8_t *buf)
         return res;
     } else {
         replay_mutex_unlock();
-        error_report("Missing character read all event in the replay log");
-        exit(1);
+        error_report_exit("Missing character read all event in the replay log");
     }
 }
 
replay/replay-events.c +5 -7
index 3807245..cffaa08 100644
@@ -55,9 +55,8 @@ static void replay_run_event(Event *event)
         aio_bh_call(event->opaque);
         break;
     default:
-        error_report("Replay: invalid async event ID (%d) in the queue",
-                    event->event_kind);
-        exit(1);
+        error_report_exit("Replay: invalid async event ID (%d) in the queue",
+                          event->event_kind);
         break;
     }
 }
@@ -190,8 +189,8 @@ static void replay_save_event(Event *event, int checkpoint)
             replay_put_qword(event->id);
             break;
         default:
-            error_report("Unknown ID %" PRId64 " of replay event", event->id);
-            exit(1);
+            error_report_exit("Unknown ID %" PRId64 " of replay event",
+                              event->id);
         }
     }
 }
@@ -253,8 +252,7 @@ static Event *replay_read_event(int checkpoint)
         }
         break;
     default:
-        error_report("Unknown ID %d of replay event", read_event_kind);
-        exit(1);
+        error_report_exit("Unknown ID %d of replay event", read_event_kind);
         break;
     }
 
replay/replay-internal.c +2 -2
index 5835e8d..9bb4a1c 100644
@@ -158,8 +158,8 @@ void replay_fetch_data_kind(void)
             replay_check_error();
             replay_has_unread_data = 1;
             if (replay_data_kind >= EVENT_COUNT) {
-                error_report("Replay: unknown event kind %d", replay_data_kind);
-                exit(1);
+                error_report_exit("Replay: unknown event kind %d",
+                                  replay_data_kind);
             }
         }
     }
replay/replay-time.c +1 -2
index fffe072..c074e25 100644
@@ -60,6 +60,5 @@ int64_t replay_read_clock(ReplayClockKind kind)
         return ret;
     }
 
-    error_report("REPLAY INTERNAL ERROR %d", __LINE__);
-    exit(1);
+    error_report_exit("REPLAY INTERNAL ERROR %d", __LINE__);
 }
replay/replay.c +3 -6
index 167fd29..f4d96aa 100644
@@ -281,14 +281,12 @@ void replay_configure(QemuOpts *opts)
     } else if (!strcmp(rr, "replay")) {
         mode = REPLAY_MODE_PLAY;
     } else {
-        error_report("Invalid icount rr option: %s", rr);
-        exit(1);
+        error_report_exit("Invalid icount rr option: %s", rr);
     }
 
     fname = qemu_opt_get(opts, "rrfile");
     if (!fname) {
-        error_report("File name not specified for replay");
-        exit(1);
+        error_report_exit("File name not specified for replay");
     }
 
     replay_enable(fname, mode);
@@ -308,8 +306,7 @@ void replay_start(void)
         exit(1);
     }
     if (!use_icount) {
-        error_report("Please enable icount to use record/replay");
-        exit(1);
+        error_report_exit("Please enable icount to use record/replay");
     }
 
     /* Timer for snapshotting will be set up here. */
target-arm/machine.c +2 -3
index 7a6ca31..39fd251 100644
@@ -338,9 +338,8 @@ const char *gicv3_class_name(void)
 #ifdef TARGET_AARCH64
         return "kvm-arm-gicv3";
 #else
-        error_report("KVM GICv3 acceleration is not supported on this "
-                     "platform");
-        exit(1);
+        error_report_exit("KVM GICv3 acceleration is not supported on this "
+                          "platform");
 #endif
     } else {
         return "arm-gicv3";
target-i386/kvm.c +3 -5
index 0b2016a..04f542b 100644
@@ -3237,8 +3237,7 @@ void kvm_arch_init_irq_routing(KVMState *s)
            MSI routes for signaling interrupts to the local apics. */
         for (i = 0; i < IOAPIC_NUM_PINS; i++) {
             if (kvm_irqchip_add_msi_route(s, 0, NULL) < 0) {
-                error_report("Could not enable split IRQ mode.");
-                exit(1);
+                error_report_exit("Could not enable split IRQ mode.");
             }
         }
     }
@@ -3250,9 +3249,8 @@ int kvm_arch_irqchip_create(MachineState *ms, KVMState *s)
     if (machine_kernel_irqchip_split(ms)) {
         ret = kvm_vm_enable_cap(s, KVM_CAP_SPLIT_IRQCHIP, 0, 24);
         if (ret) {
-            error_report("Could not enable split irqchip mode: %s",
-                         strerror(-ret));
-            exit(1);
+            error_report_exit("Could not enable split irqchip mode: %s",
+                              strerror(-ret));
         } else {
             DPRINTF("Enabled KVM_CAP_SPLIT_IRQCHIP\n");
             kvm_split_irqchip = true;
target-ppc/kvm.c +2 -4
index dcb68b9..206ab3b 100644
@@ -2062,8 +2062,7 @@ void kvmppc_set_papr(PowerPCCPU *cpu)
 
     ret = kvm_vcpu_enable_cap(cs, KVM_CAP_PPC_PAPR, 0);
     if (ret) {
-        error_report("This vCPU type or KVM version does not support PAPR");
-        exit(1);
+        error_report_exit("This vCPU type or KVM version does not support PAPR");
     }
 
     /* Update the capability flag so we sync the right information
@@ -2083,8 +2082,7 @@ void kvmppc_set_mpic_proxy(PowerPCCPU *cpu, int mpic_proxy)
 
     ret = kvm_vcpu_enable_cap(cs, KVM_CAP_PPC_EPR, 0, mpic_proxy);
     if (ret && mpic_proxy) {
-        error_report("This KVM version does not support EPR");
-        exit(1);
+        error_report_exit("This KVM version does not support EPR");
     }
 }
 
target-s390x/cpu.c +2 -3
index e43e2d6..7d122d8 100644
@@ -400,9 +400,8 @@ unsigned int s390_cpu_set_state(uint8_t cpu_state, S390CPU *cpu)
         s390_cpu_unhalt(cpu);
         break;
     default:
-        error_report("Requested CPU state is not a valid S390 CPU state: %u",
-                     cpu_state);
-        exit(1);
+        error_report_exit("Requested CPU state is not a valid S390 CPU state: %u",
+                          cpu_state);
     }
     if (kvm_enabled() && cpu->env.cpu_state != cpu_state) {
         kvm_s390_set_cpu_state(cpu, cpu_state);
target-s390x/kvm.c +3 -5
index 80ac621..7029c0e 100644
@@ -909,8 +909,7 @@ void kvm_s390_vcpu_interrupt(S390CPU *cpu, struct kvm_s390_irq *irq)
         if (!r) {
             return;
         }
-        error_report("KVM failed to inject interrupt %llx", irq->type);
-        exit(1);
+        error_report_exit("KVM failed to inject interrupt %llx", irq->type);
     }
 
     inject_vcpu_irq_legacy(cs, irq);
@@ -2181,9 +2180,8 @@ int kvm_s390_set_cpu_state(S390CPU *cpu, uint8_t cpu_state)
         mp_state.mp_state = KVM_MP_STATE_LOAD;
         break;
     default:
-        error_report("Requested CPU state is not a valid S390 CPU state: %u",
-                     cpu_state);
-        exit(1);
+        error_report_exit("Requested CPU state is not a valid S390 CPU state: %u",
+                          cpu_state);
     }
 
     ret = kvm_vcpu_ioctl(CPU(cpu), KVM_SET_MP_STATE, &mp_state);
target-s390x/mmu_helper.c +1 -2
index b11a027..a410bfa 100644
@@ -413,8 +413,7 @@ static bool lowprot_enabled(const CPUS390XState *env)
         return !(env->cregs[13] & _ASCE_PRIVATE_SPACE);
     default:
         /* We don't support access register mode */
-        error_report("unsupported addressing mode");
-        exit(1);
+        error_report_exit("unsupported addressing mode");
     }
 }
 
trace/control.c +2 -4
index d173c09..16b0705 100644
@@ -192,8 +192,7 @@ static void trace_init_events(const char *fname)
     loc_set_file(fname, 0);
     fp = fopen(fname, "r");
     if (!fp) {
-        error_report("%s", strerror(errno));
-        exit(1);
+        error_report_exit("%s", strerror(errno));
     }
     while (fgets(line_buf, sizeof(line_buf), fp)) {
         loc_set_file(fname, ++line_idx);
@@ -208,8 +207,7 @@ static void trace_init_events(const char *fname)
     }
     if (fclose(fp) != 0) {
         loc_set_file(fname, 0);
-        error_report("%s", strerror(errno));
-        exit(1);
+        error_report_exit("%s", strerror(errno));
     }
     loc_pop(&loc);
 }
ui/spice-core.c +15 -25
index da05054..b523fd5 100644
@@ -332,8 +332,7 @@ static int parse_name(const char *string, const char *optname,
     if (value != -1) {
         return value;
     }
-    error_report("spice: invalid %s: %s", optname, string);
-    exit(1);
+    error_report_exit("spice: invalid %s: %s", optname, string);
 }
 
 static const char *stream_video_names[] = {
@@ -603,9 +602,8 @@ static int add_channel(void *opaque, const char *name, const char *value,
     if (strcmp(name, "tls-channel") == 0) {
         int *tls_port = opaque;
         if (!*tls_port) {
-            error_report("spice: tried to setup tls-channel"
-                         " without specifying a TLS port");
-            exit(1);
+            error_report_exit("spice: tried to setup tls-channel"
+                              " without specifying a TLS port");
         }
         security = SPICE_CHANNEL_SECURITY_SSL;
     }
@@ -621,8 +619,8 @@ static int add_channel(void *opaque, const char *name, const char *value,
         rc = spice_server_set_channel_security(spice_server, value, security);
     }
     if (rc != 0) {
-        error_report("spice: failed to set channel security for %s", value);
-        exit(1);
+        error_report_exit("spice: failed to set channel security for %s",
+                          value);
     }
     return 0;
 }
@@ -660,12 +658,10 @@ void qemu_spice_init(void)
     port = qemu_opt_get_number(opts, "port", 0);
     tls_port = qemu_opt_get_number(opts, "tls-port", 0);
     if (port < 0 || port > 65535) {
-        error_report("spice port is out of range");
-        exit(1);
+        error_report_exit("spice port is out of range");
     }
     if (tls_port < 0 || tls_port > 65535) {
-        error_report("spice tls-port is out of range");
-        exit(1);
+        error_report_exit("spice tls-port is out of range");
     }
     password = qemu_opt_get(opts, "password");
 
@@ -735,8 +731,7 @@ void qemu_spice_init(void)
     }
     if (qemu_opt_get_bool(opts, "sasl", 0)) {
         if (spice_server_set_sasl(spice_server, 1) == -1) {
-            error_report("spice: failed to enable sasl");
-            exit(1);
+            error_report_exit("spice: failed to enable sasl");
         }
         auth = "sasl";
     }
@@ -753,9 +748,8 @@ void qemu_spice_init(void)
 #if SPICE_SERVER_VERSION >= 0x000c04
         spice_server_set_agent_file_xfer(spice_server, false);
 #else
-        error_report("this qemu build does not support the "
-                     "\"disable-agent-file-xfer\" option");
-        exit(1);
+        error_report_exit("this qemu build does not support the "
+                          "\"disable-agent-file-xfer\" option");
 #endif
     }
 
@@ -802,8 +796,7 @@ void qemu_spice_init(void)
     spice_server_set_seamless_migration(spice_server, seamless_migration);
     spice_server_set_sasl_appname(spice_server, "qemu");
     if (spice_server_init(spice_server, &core_interface) != 0) {
-        error_report("failed to initialize spice server");
-        exit(1);
+        error_report_exit("failed to initialize spice server");
     };
     using_spice = 1;
 
@@ -829,13 +822,11 @@ void qemu_spice_init(void)
 #ifdef HAVE_SPICE_GL
     if (qemu_opt_get_bool(opts, "gl", 0)) {
         if ((port != 0) || (tls_port != 0)) {
-            error_report("SPICE GL support is local-only for now and "
-                         "incompatible with -spice port/tls-port");
-            exit(1);
+            error_report_exit("SPICE GL support is local-only for now and "
+                              "incompatible with -spice port/tls-port");
         }
         if (egl_rendernode_init() != 0) {
-            error_report("Failed to initialize EGL render node for SPICE GL");
-            exit(1);
+            error_report_exit("Failed to initialize EGL render node for SPICE GL");
         }
         display_opengl = 1;
     }
@@ -846,8 +837,7 @@ int qemu_spice_add_interface(SpiceBaseInstance *sin)
 {
     if (!spice_server) {
         if (QTAILQ_FIRST(&qemu_spice_opts.head) != NULL) {
-            error_report("Oops: spice configured but not active");
-            exit(1);
+            error_report_exit("Oops: spice configured but not active");
         }
         /*
          * Create a spice server instance.
vl.c +99 -169

658 lines not on this page · raw message

xen-hvm.c +1 -2
index 3b0343a..24e9a1d 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.7.4

Part of the diff is not shown here. View the raw message.

#21 lore raw
In reply to Peter Xu
Your series seems to have some coding style problems. See output below for more information:

Hi,

Your series seems to have some coding style problems. See output below for more information:

Subject: [Qemu-devel] [PATCH 0/2] error-report: introduce error_report_exit()
Message-id: [email protected]
Type: series

=== TEST SCRIPT BEGIN ===
#!/bin/bash

BASE=base
n=1
total=$(git log --oneline $BASE.. | wc -l)
failed=0

commits="$(git log --format=%H --reverse $BASE..)" for c in $commits; do

    echo "Checking PATCH $n/$total: $(git show --no-patch --format=%s $c)..."
    if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then
        failed=1
        echo
    fi
    n=$((n+1))

done

exit $failed
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384 From https://github.com/patchew-project/qemu
* [new tag] patchew/[email protected] -> patchew/[email protected]
Switched to a new branch 'test'
8ca226c error-report: leveraging error_report_exit() dccdb8b error-report: provide error_report_exit()

=== OUTPUT BEGIN ===
Checking PATCH 1/2: error-report: provide error_report_exit()... Checking PATCH 2/2: error-report: leveraging error_report_exit()...
WARNING: line over 80 characters
#335: FILE: hw/arm/sabrelite.c:53:
+ error_report_exit("RAM size " RAM_ADDR_FMT " above max supported (%08x)",

WARNING: line over 80 characters
#475: FILE: hw/arm/virt.c:1199:
+ error_report_exit("Unable to determine GIC version supported by host");

WARNING: line over 80 characters
#515: FILE: hw/arm/virt.c:1247:
+ error_report_exit("mach-virt: KVM does not support Security extensions");

WARNING: line over 80 characters
#662: FILE: hw/core/platform-bus.c:157:
+ error_report_exit("Platform Bus: Can not fit MMIO region of size %" PRIx64,

WARNING: line over 80 characters
#757: FILE: hw/i386/pc.c:1424:
+ error_report_exit("unsupported amount of maximum memory: " RAM_ADDR_FMT,

WARNING: line over 80 characters
#768: FILE: hw/i386/pc.c:2089:
+ error_report_exit("System Management Mode not supported by this hypervisor.");

ERROR: line over 90 characters
#845: FILE: hw/intc/xics_kvm.c:68:
+ error_report_exit("Unable to retrieve KVM interrupt controller state" " for CPU %ld: %s",

ERROR: line over 90 characters
#857: FILE: hw/intc/xics_kvm.c:164:
+ error_report_exit("Unable to retrieve KVM interrupt controller state" " for IRQ %d: %s",

WARNING: line over 80 characters
#1049: FILE: hw/net/virtio-net.c:1136:
+ error_report_exit("virtio-net receive queue contains no in buffers");

WARNING: line over 80 characters
#1207: FILE: hw/ppc/mac_oldworld.c:250:
+ error_report_exit("Bus model not supported on OldWorld Mac machine");

WARNING: line over 80 characters
#1394: FILE: hw/ppc/spapr.c:1786:
+ error_report_exit("Numa node 0 has to span the RMA (%#08" HWADDR_PRIx ")",

ERROR: line over 90 characters
#1427: FILE: hw/ppc/spapr.c:1878:
+ error_report_exit("Specified number of memory slots %" PRIu64 " exceeds max supported %d",

ERROR: line over 90 characters
#1469: FILE: hw/ppc/spapr.c:1975:
+ error_report_exit("pSeries SLOF firmware requires >= %ldM guest RMA (Real Mode Area memory)",

ERROR: line over 90 characters
#1550: FILE: hw/scsi/vhost-scsi.c:174:
+ error_report_exit("vhost-scsi does not support changing the sense data and CDB sizes");

WARNING: line over 80 characters
#1598: FILE: hw/scsi/virtio-scsi.c:625:
+ error_report_exit("bad data written to virtio-scsi configuration space");

WARNING: line over 80 characters
#1667: FILE: hw/smbios/smbios.c:915:
+ error_report_exit("can't load type %d struct, fields already specified!",

WARNING: line over 80 characters
#1715: FILE: hw/smbios/smbios.c:1039:
+ error_report_exit("Don't know how to build fields for SMBIOS type %ld",

WARNING: line over 80 characters
#1911: FILE: hw/virtio/virtio.c:463:
+ error_report_exit("virtio: too many write descriptors in indirect table");

ERROR: line over 90 characters
#2097: FILE: qemu-img.c:2418:
+ error_report_exit("File contains external, encrypted or compressed clusters.");

WARNING: line over 80 characters
#2252: FILE: qemu-nbd.c:594:
+ error_report_exit("setting detect-zeroes to unmap is not allowed "

WARNING: line over 80 characters
#2318: FILE: qemu-nbd.c:656:
+ error_report_exit("Shared device number must be greater than 0");

WARNING: line over 80 characters
#2641: FILE: target-ppc/kvm.c:2065:
+ error_report_exit("This vCPU type or KVM version does not support PAPR");

WARNING: line over 80 characters
#2666: FILE: target-s390x/cpu.c:403:
+ error_report_exit("Requested CPU state is not a valid S390 CPU state: %u",

WARNING: line over 80 characters
#2692: FILE: target-s390x/kvm.c:2183:
+ error_report_exit("Requested CPU state is not a valid S390 CPU state: %u",

WARNING: line over 80 characters
#2832: FILE: ui/spice-core.c:829:
+ error_report_exit("Failed to initialize EGL render node for SPICE GL");

WARNING: line over 80 characters
#3211: FILE: vl.c:3187:
+ error_report_exit("only 90, 180, 270 deg rotation is available");

WARNING: line over 80 characters
#3323: FILE: vl.c:3681:
+ error_report_exit("failed to parse UUID string: wrong format");

WARNING: line over 80 characters
#3352: FILE: vl.c:3722:
+ error_report_exit("unsupported semihosting-config %s",

total: 6 errors, 22 warnings, 3019 lines checked

Your patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

=== OUTPUT END ===

Test command exited with code: 1

---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to [email protected]

author
#16 lore raw

PATCH v2 1/1 error-report: leveraging error_report_exit()

In reply to Peter Xu

Replace possible places in current codes to leverage the new macro. Most of the changes are done by spatch using error_report_exit.cocci script, with some further manual fixes on the format (line width not exceeding 80 chars).

---

V1 of this patch didn't pass checkpatch...

Some more tunings on line width. This V2 survives.

 arch_init.c                    |   6 +-
 bootdevice.c                   |   4 +-
 cpus.c                         |   3 +-
 device_tree.c                  |  42 +++----
 hw/9pfs/9p.c                   |   3 +-
 hw/alpha/dp264.c               |  14 +--
 hw/arm/armv7m.c                |   3 +-
 hw/arm/digic_boards.c          |   6 +-
 hw/arm/fsl-imx6.c              |   5 +-
 hw/arm/highbank.c              |   6 +-
 hw/arm/raspi.c                 |   7 +-
 hw/arm/sabrelite.c             |   8 +-
 hw/arm/strongarm.c             |   6 +-
 hw/arm/sysbus-fdt.c            |   5 +-
 hw/arm/vexpress.c              |  14 +--
 hw/arm/virt.c                  |  44 +++----
 hw/arm/xlnx-ep108.c            |   9 +-
 hw/block/tc58128.c             |   3 +-
 hw/block/virtio-blk.c          |   9 +-
 hw/char/exynos4210_uart.c      |   9 +-
 hw/core/machine.c              |   5 +-
 hw/core/platform-bus.c         |   8 +-
 hw/i386/intel_iommu.c          |   5 +-
 hw/i386/pc.c                   |  36 +++---
 hw/i386/pc_piix.c              |   3 +-
 hw/i386/x86-iommu.c            |   5 +-
 hw/ide/core.c                  |   5 +-
 hw/intc/ioapic.c               |   5 +-
 hw/intc/xics_kvm.c             |  17 ++-
 hw/m68k/an5206.c               |   3 +-
 hw/microblaze/boot.c           |   5 +-
 hw/mips/mips_fulong2e.c        |   3 +-
 hw/mips/mips_jazz.c            |   3 +-
 hw/mips/mips_malta.c           |  26 ++--
 hw/mips/mips_mipssim.c         |   5 +-
 hw/net/virtio-net.c            |  28 ++---
 hw/nvram/fw_cfg.c              |   5 +-
 hw/pci/pci.c                   |   5 +-
 hw/ppc/e500.c                  |   5 +-
 hw/ppc/mac_newworld.c          |  14 +--
 hw/ppc/mac_oldworld.c          |  18 ++-
 hw/ppc/mpc8544ds.c             |   3 +-
 hw/ppc/ppc405_boards.c         |  14 +--
 hw/ppc/prep.c                  |  11 +-
 hw/ppc/spapr.c                 |  87 +++++--------
 hw/ppc/virtex_ml507.c          |   5 +-
 hw/scsi/vhost-scsi.c           |  11 +-
 hw/scsi/virtio-scsi.c          |  10 +-
 hw/sh4/shix.c                  |   3 +-
 hw/smbios/smbios.c             |  41 +++----
 hw/sparc/sun4m.c               |  19 ++-
 hw/tricore/tricore_testboard.c |   8 +-
 hw/unicore32/puv3.c            |   9 +-
 hw/virtio/virtio.c             |  45 +++----
 hw/xtensa/sim.c                |   4 +-
 hw/xtensa/xtfpga.c             |  16 +--
 numa.c                         |  22 ++--
 qemu-img.c                     |  16 +--
 qemu-io.c                      |   9 +-
 qemu-nbd.c                     | 115 +++++++-----------
 replay/replay-char.c           |   6 +-
 replay/replay-events.c         |  12 +-
 replay/replay-internal.c       |   4 +-
 replay/replay-time.c           |   3 +-
 replay/replay.c                |   9 +-
 target-arm/machine.c           |   5 +-
 target-i386/kvm.c              |   8 +-
 target-ppc/kvm.c               |   7 +-
 target-s390x/cpu.c             |   5 +-
 target-s390x/kvm.c             |   8 +-
 target-s390x/mmu_helper.c      |   3 +-
 trace/control.c                |   6 +-
 ui/spice-core.c                |  41 +++----
 vl.c                           | 270 +++++++++++++++--------------------------
 xen-hvm.c                      |   3 +-
 75 files changed, 481 insertions(+), 772 deletions(-)
arch_init.c +2 -4
index fa05973..abb661d 100644
@@ -220,14 +220,12 @@ void audio_init(void)
         if (c->enabled) {
             if (c->isa) {
                 if (!isa_bus) {
-                    error_report("ISA bus not available for %s", c->name);
-                    exit(1);
+                    error_report_exit("ISA bus not available for %s", c->name);
                 }
                 c->init.init_isa(isa_bus);
             } else {
                 if (!pci_bus) {
-                    error_report("PCI bus not available for %s", c->name);
-                    exit(1);
+                    error_report_exit("PCI bus not available for %s", c->name);
                 }
                 c->init.init_pci(pci_bus);
             }
bootdevice.c +2 -2
index 33e3029..f493477 100644
@@ -172,8 +172,8 @@ void add_boot_device_path(int32_t bootindex, DeviceState *dev,
 
     QTAILQ_FOREACH(i, &fw_boot_order, link) {
         if (i->bootindex == bootindex) {
-            error_report("Two devices with same boot index %d", bootindex);
-            exit(1);
+            error_report_exit("Two devices with same boot index %d",
+                              bootindex);
         } else if (i->bootindex < bootindex) {
             continue;
         }
cpus.c +1 -2
index 84c3520..66e2a5c 100644
@@ -975,8 +975,7 @@ void async_run_on_cpu(CPUState *cpu, void (*func)(void *data), void *data)
 static void qemu_kvm_destroy_vcpu(CPUState *cpu)
 {
     if (kvm_destroy_vcpu(cpu) < 0) {
-        error_report("kvm_destroy_vcpu failed");
-        exit(EXIT_FAILURE);
+        error_report_exit("kvm_destroy_vcpu failed");
     }
 }
 
device_tree.c +17 -25

94 lines not on this page · raw message

hw/9pfs/9p.c +1 -2
index b6b02b4..f896631 100644
@@ -3383,8 +3383,7 @@ static void __attribute__((__constructor__)) v9fs_set_fd_limit(void)
 {
     struct rlimit rlim;
     if (getrlimit(RLIMIT_NOFILE, &rlim) < 0) {
-        error_report("Failed to get the resource limit");
-        exit(1);
+        error_report_exit("Failed to get the resource limit");
     }
     open_fd_hw = rlim.rlim_cur - MIN(400, rlim.rlim_cur/3);
     open_fd_rc = rlim.rlim_cur/2;
hw/alpha/dp264.c +5 -9
index f1267b5..eae6fde 100644
@@ -109,15 +109,13 @@ static void clipper_init(MachineState *machine)
     palcode_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS,
                                 bios_name ? bios_name : "palcode-clipper");
     if (palcode_filename == NULL) {
-        error_report("no palcode provided");
-        exit(1);
+        error_report_exit("no palcode provided");
     }
     size = load_elf(palcode_filename, cpu_alpha_superpage_to_phys,
                     NULL, &palcode_entry, &palcode_low, &palcode_high,
                     0, EM_ALPHA, 0, 0);
     if (size < 0) {
-        error_report("could not load palcode '%s'", palcode_filename);
-        exit(1);
+        error_report_exit("could not load palcode '%s'", palcode_filename);
     }
     g_free(palcode_filename);
 
@@ -136,8 +134,7 @@ static void clipper_init(MachineState *machine)
                         NULL, &kernel_entry, &kernel_low, &kernel_high,
                         0, EM_ALPHA, 0, 0);
         if (size < 0) {
-            error_report("could not load kernel '%s'", kernel_filename);
-            exit(1);
+            error_report_exit("could not load kernel '%s'", kernel_filename);
         }
 
         cpus[0]->env.trap_arg1 = kernel_entry;
@@ -153,9 +150,8 @@ static void clipper_init(MachineState *machine)
 
             initrd_size = get_image_size(initrd_filename);
             if (initrd_size < 0) {
-                error_report("could not load initial ram disk '%s'",
-                             initrd_filename);
-                exit(1);
+                error_report_exit("could not load initial ram disk '%s'",
+                                  initrd_filename);
             }
 
             /* Put the initrd image as high in memory as possible.  */
hw/arm/armv7m.c +1 -2
index 49d3078..446ce18 100644
@@ -220,8 +220,7 @@ DeviceState *armv7m_init(MemoryRegion *system_memory, int mem_size, int num_irq,
             lowaddr = 0;
         }
         if (image_size < 0) {
-            error_report("Could not load kernel '%s'", kernel_filename);
-            exit(1);
+            error_report_exit("Could not load kernel '%s'", kernel_filename);
         }
     }
 
hw/arm/digic_boards.c +2 -4
index 520c8e9..9474980 100644
@@ -106,14 +106,12 @@ static void digic_load_rom(DigicBoardState *s, hwaddr addr,
         char *fn = qemu_find_file(QEMU_FILE_TYPE_BIOS, filename);
 
         if (!fn) {
-            error_report("Couldn't find rom image '%s'.", filename);
-            exit(1);
+            error_report_exit("Couldn't find rom image '%s'.", filename);
         }
 
         rom_size = load_image_targphys(fn, addr, max_size);
         if (rom_size < 0 || rom_size > max_size) {
-            error_report("Couldn't load rom image '%s'.", filename);
-            exit(1);
+            error_report_exit("Couldn't load rom image '%s'.", filename);
         }
         g_free(fn);
     }
hw/arm/fsl-imx6.c +2 -3
index 6a1bf26..ab1d845 100644
@@ -36,9 +36,8 @@ static void fsl_imx6_init(Object *obj)
     int i;
 
     if (smp_cpus > FSL_IMX6_NUM_CPUS) {
-        error_report("%s: Only %d CPUs are supported (%d requested)",
-                     TYPE_FSL_IMX6, FSL_IMX6_NUM_CPUS, smp_cpus);
-        exit(1);
+        error_report_exit("%s: Only %d CPUs are supported (%d requested)",
+                          TYPE_FSL_IMX6, FSL_IMX6_NUM_CPUS, smp_cpus);
     }
 
     for (i = 0; i < smp_cpus; i++) {
hw/arm/highbank.c +2 -4
index 80e5fd4..efacaa6 100644
@@ -283,13 +283,11 @@ static void calxeda_init(MachineState *machine, enum cxmachines machine_id)
         sysboot_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
         if (sysboot_filename != NULL) {
             if (load_image_targphys(sysboot_filename, 0xfff88000, 0x8000) < 0) {
-                error_report("Unable to load %s", bios_name);
-                exit(1);
+                error_report_exit("Unable to load %s", bios_name);
             }
             g_free(sysboot_filename);
         } else {
-            error_report("Unable to find %s", bios_name);
-            exit(1);
+            error_report_exit("Unable to find %s", bios_name);
         }
     }
 
hw/arm/raspi.c +3 -4
index 2b295f1..ef40879 100644
@@ -98,8 +98,8 @@ static void setup_boot(MachineState *machine, int version, size_t ram_size)
         r = load_image_targphys(machine->firmware, FIRMWARE_ADDR,
                                 ram_size - FIRMWARE_ADDR);
         if (r < 0) {
-            error_report("Failed to load firmware from %s", machine->firmware);
-            exit(1);
+            error_report_exit("Failed to load firmware from %s",
+                              machine->firmware);
         }
 
         binfo.entry = FIRMWARE_ADDR;
@@ -146,8 +146,7 @@ static void raspi2_init(MachineState *machine)
     blk = di ? blk_by_legacy_dinfo(di) : NULL;
     bus = qdev_get_child_bus(DEVICE(&s->soc), "sd-bus");
     if (bus == NULL) {
-        error_report("No SD bus found in SOC object");
-        exit(1);
+        error_report_exit("No SD bus found in SOC object");
     }
     carddev = qdev_create(bus, TYPE_SD_CARD);
     qdev_prop_set_drive(carddev, "drive", blk, &error_fatal);
hw/arm/sabrelite.c +3 -5
index 4e7ac8c..26a7ac3 100644
@@ -50,9 +50,8 @@ static void sabrelite_init(MachineState *machine)
 
     /* Check the amount of memory is compatible with the SOC */
     if (machine->ram_size > FSL_IMX6_MMDC_SIZE) {
-        error_report("RAM size " RAM_ADDR_FMT " above max supported (%08x)",
-                     machine->ram_size, FSL_IMX6_MMDC_SIZE);
-        exit(1);
+        error_report_exit("RAM size " RAM_ADDR_FMT " above max supported "
+                          "(%08x)", machine->ram_size, FSL_IMX6_MMDC_SIZE);
     }
 
     object_initialize(&s->soc, sizeof(s->soc), TYPE_FSL_IMX6);
@@ -61,8 +60,7 @@ static void sabrelite_init(MachineState *machine)
 
     object_property_set_bool(OBJECT(&s->soc), true, "realized", &err);
     if (err != NULL) {
-        error_report("%s", error_get_pretty(err));
-        exit(1);
+        error_report_exit("%s", error_get_pretty(err));
     }
 
     memory_region_allocate_system_memory(&s->ram, NULL, "sabrelite.ram",
hw/arm/strongarm.c +2 -4
index f1b2c6c..2c2c283 100644
@@ -1589,15 +1589,13 @@ StrongARMState *sa1110_init(MemoryRegion *sysmem,
     }
 
     if (strncmp(rev, "sa1110", 6)) {
-        error_report("Machine requires a SA1110 processor.");
-        exit(1);
+        error_report_exit("Machine requires a SA1110 processor.");
     }
 
     s->cpu = cpu_arm_init(rev);
 
     if (!s->cpu) {
-        error_report("Unable to find CPU definition");
-        exit(1);
+        error_report_exit("Unable to find CPU definition");
     }
 
     memory_region_allocate_system_memory(&s->sdram, NULL, "strongarm.sdram",
hw/arm/sysbus-fdt.c +2 -3
index 5debb33..be5245d 100644
@@ -448,9 +448,8 @@ static int add_fdt_node(SysBusDevice *sbdev, void *opaque)
             return 0;
         }
     }
-    error_report("Device %s can not be dynamically instantiated",
-                     qdev_fw_name(DEVICE(sbdev)));
-    exit(1);
+    error_report_exit("Device %s can not be dynamically instantiated",
+                      qdev_fw_name(DEVICE(sbdev)));
 }
 
 /**
hw/arm/vexpress.c +6 -8
index 58760f4..2e98554 100644
@@ -568,22 +568,20 @@ static void vexpress_common_init(MachineState *machine)
         int image_size;
 
         if (drive_get(IF_PFLASH, 0, 0)) {
-            error_report("The contents of the first flash device may be "
-                         "specified with -bios or with -drive if=pflash... "
-                         "but you cannot use both options at once");
-            exit(1);
+            error_report_exit("The contents of the first flash device may "
+                              "be specified with -bios or with -drive "
+                              "if=pflash... but you cannot use both "
+                              "options at once");
         }
         fn = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
         if (!fn) {
-            error_report("Could not find ROM image '%s'", bios_name);
-            exit(1);
+            error_report_exit("Could not find ROM image '%s'", bios_name);
         }
         image_size = load_image_targphys(fn, map[VE_NORFLASH0],
                                          VEXPRESS_FLASH_SIZE);
         g_free(fn);
         if (image_size < 0) {
-            error_report("Could not load ROM image '%s'", bios_name);
-            exit(1);
+            error_report_exit("Could not load ROM image '%s'", bios_name);
         }
     }
 
hw/arm/virt.c +18 -26

100 lines not on this page · raw message

hw/arm/xlnx-ep108.c +3 -6
index 4ec590a..d2aca6e 100644
@@ -40,10 +40,8 @@ static void xlnx_ep108_init(MachineState *machine)
 
     /* Create the memory region to pass to the SoC */
     if (ram_size > XLNX_ZYNQMP_MAX_RAM_SIZE) {
-        error_report("ERROR: RAM size 0x%" PRIx64 " above max supported of "
-                     "0x%llx", ram_size,
-                     XLNX_ZYNQMP_MAX_RAM_SIZE);
-        exit(1);
+        error_report_exit("ERROR: RAM size 0x%" PRIx64 " above max supported "
+                          "of 0x%llx", ram_size, XLNX_ZYNQMP_MAX_RAM_SIZE);
     }
 
     if (ram_size < 0x08000000) {
@@ -75,8 +73,7 @@ static void xlnx_ep108_init(MachineState *machine)
         bus = qdev_get_child_bus(DEVICE(&s->soc), bus_name);
         g_free(bus_name);
         if (!bus) {
-            error_report("No SD bus found for SD card %d", i);
-            exit(1);
+            error_report_exit("No SD bus found for SD card %d", i);
         }
         carddev = qdev_create(bus, TYPE_SD_CARD);
         qdev_prop_set_drive(carddev, "drive", blk, &error_fatal);
hw/block/tc58128.c +1 -2
index 1d9f7ee..e408b42 100644
@@ -40,8 +40,7 @@ static void init_dev(tc58128_dev * dev, const char *filename)
 	ret = load_image(filename, dev->flash_contents + 528 * 32);
 	if (ret < 0) {
             if (!qtest_enabled()) {
-                error_report("Could not load flash image %s", filename);
-                exit(1);
+                error_report_exit("Could not load flash image %s", filename);
             }
 	} else {
 	    /* Build first block with number of blocks */
hw/block/virtio-blk.c +3 -6
index 331d766..0f4f99f 100644
@@ -477,21 +477,18 @@ void virtio_blk_handle_request(VirtIOBlockReq *req, MultiReqBuffer *mrb)
     unsigned out_num = req->elem.out_num;
 
     if (req->elem.out_num < 1 || req->elem.in_num < 1) {
-        error_report("virtio-blk missing headers");
-        exit(1);
+        error_report_exit("virtio-blk missing headers");
     }
 
     if (unlikely(iov_to_buf(iov, out_num, 0, &req->out,
                             sizeof(req->out)) != sizeof(req->out))) {
-        error_report("virtio-blk request outhdr too short");
-        exit(1);
+        error_report_exit("virtio-blk request outhdr too short");
     }
 
     iov_discard_front(&iov, &out_num, sizeof(req->out));
 
     if (in_iov[in_num - 1].iov_len < sizeof(struct virtio_blk_inhdr)) {
-        error_report("virtio-blk request inhdr too short");
-        exit(1);
+        error_report_exit("virtio-blk request inhdr too short");
     }
 
     /* We always touch the last byte, so just see how big in_iov is.  */
hw/char/exynos4210_uart.c +4 -5
index 885ecc0..dce0acf 100644
@@ -597,17 +597,16 @@ DeviceState *exynos4210_uart_create(hwaddr addr,
 
     if (!chr) {
         if (channel >= MAX_SERIAL_PORTS) {
-            error_report("Only %d serial ports are supported by QEMU",
-                         MAX_SERIAL_PORTS);
-            exit(1);
+            error_report_exit("Only %d serial ports are supported by QEMU",
+                              MAX_SERIAL_PORTS);
         }
         chr = serial_hds[channel];
         if (!chr) {
             snprintf(label, ARRAY_SIZE(label), "%s%d", chr_name, channel);
             chr = qemu_chr_new(label, "null", NULL);
             if (!(chr)) {
-                error_report("Can't assign serial port to UART%d", channel);
-                exit(1);
+                error_report_exit("Can't assign serial port to UART%d",
+                                  channel);
             }
         }
     }
hw/core/machine.c +2 -3
index e5a456f..4d7fdb6 100644
@@ -334,9 +334,8 @@ static bool machine_get_enforce_config_section(Object *obj, Error **errp)
 
 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);
+    error_report_exit("Option '-device %s' cannot be handled by this machine",
+                      object_class_get_name(object_get_class(OBJECT(sbdev))));
 }
 
 static void machine_init_notify(Notifier *notifier, void *data)
hw/core/platform-bus.c +3 -5
index 36f84ab..4f7bcae 100644
@@ -121,8 +121,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);
+        error_report_exit("Platform Bus: Can not fit IRQ line");
     }
 
     set_bit(irqn, pbus->used_irqs);
@@ -155,9 +154,8 @@ 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);
+        error_report_exit("Platform Bus: Can not fit MMIO region of "
+                          "size %" PRIx64, size);
     }
 
     /* Map the device's region into our Platform Bus MMIO space */
hw/i386/intel_iommu.c +2 -3
index 28c31a2..a763c7a 100644
@@ -2471,9 +2471,8 @@ static void vtd_realize(DeviceState *dev, Error **errp)
     /* Currently Intel IOMMU IR only support "kernel-irqchip={off|split}" */
     if (x86_iommu->intr_supported && kvm_irqchip_in_kernel() &&
         !kvm_irqchip_is_split()) {
-        error_report("Intel Interrupt Remapping cannot work with "
-                     "kernel-irqchip=on, please use 'split|off'.");
-        exit(1);
+        error_report_exit("Intel Interrupt Remapping cannot work with "
+                          "kernel-irqchip=on, please use 'split|off'.");
     }
 }
 
hw/i386/pc.c +15 -21
index 022dd1b..5cd77c2 100644
@@ -1168,14 +1168,13 @@ void pc_cpus_init(PCMachineState *pcms)
 
     model_pieces = g_strsplit(machine->cpu_model, ",", 2);
     if (!model_pieces[0]) {
-        error_report("Invalid/empty CPU model name");
-        exit(1);
+        error_report_exit("Invalid/empty CPU model name");
     }
 
     oc = cpu_class_by_name(TYPE_X86_CPU, model_pieces[0]);
     if (oc == NULL) {
-        error_report("Unable to find CPU definition: %s", model_pieces[0]);
-        exit(1);
+        error_report_exit("Unable to find CPU definition: %s",
+                          model_pieces[0]);
     }
     typename = object_class_get_name(oc);
     cc = CPU_CLASS(oc);
@@ -1191,9 +1190,8 @@ void pc_cpus_init(PCMachineState *pcms)
      */
     pcms->apic_id_limit = x86_cpu_apic_id_from_index(max_cpus - 1) + 1;
     if (pcms->apic_id_limit > ACPI_CPU_HOTPLUG_ID_LIMIT) {
-        error_report("max_cpus is too large. APIC ID of last CPU is %u",
-                     pcms->apic_id_limit - 1);
-        exit(1);
+        error_report_exit("max_cpus is too large. APIC ID of last CPU is %u",
+                          pcms->apic_id_limit - 1);
     }
 
     pcms->possible_cpus = g_malloc0(sizeof(CPUArchIdList) +
@@ -1392,9 +1390,8 @@ void pc_memory_init(PCMachineState *pcms,
          (machine->maxram_size > machine->ram_size))) {
         MachineClass *mc = MACHINE_GET_CLASS(machine);
 
-        error_report("\"-memory 'slots|maxmem'\" is not supported by: %s",
-                     mc->name);
-        exit(EXIT_FAILURE);
+        error_report_exit("\"-memory 'slots|maxmem'\" is not supported by: %s",
+                          mc->name);
     }
 
     /* initialize hotplug memory address space */
@@ -1404,16 +1401,14 @@ void pc_memory_init(PCMachineState *pcms,
             machine->maxram_size - machine->ram_size;
 
         if (machine->ram_slots > ACPI_MAX_RAM_SLOTS) {
-            error_report("unsupported amount of memory slots: %"PRIu64,
-                         machine->ram_slots);
-            exit(EXIT_FAILURE);
+            error_report_exit("unsupported amount of memory slots: %" PRIu64,
+                              machine->ram_slots);
         }
 
         if (QEMU_ALIGN_UP(machine->maxram_size,
                           TARGET_PAGE_SIZE) != machine->maxram_size) {
-            error_report("maximum memory size must by aligned to multiple of "
-                         "%d bytes", TARGET_PAGE_SIZE);
-            exit(EXIT_FAILURE);
+            error_report_exit("maximum memory size must by aligned to multiple"
+                              " of %d bytes", TARGET_PAGE_SIZE);
         }
 
         pcms->hotplug_memory.base =
@@ -1426,9 +1421,8 @@ void pc_memory_init(PCMachineState *pcms,
 
         if ((pcms->hotplug_memory.base + hotplug_mem_size) <
             hotplug_mem_size) {
-            error_report("unsupported amount of maximum memory: " RAM_ADDR_FMT,
-                         machine->maxram_size);
-            exit(EXIT_FAILURE);
+            error_report_exit("unsupported amount of maximum memory: "
+                              RAM_ADDR_FMT, machine->maxram_size);
         }
 
         memory_region_init(&pcms->hotplug_memory.mr, OBJECT(pcms),
@@ -2092,8 +2086,8 @@ bool pc_machine_is_smm_enabled(PCMachineState *pcms)
     }
 
     if (pcms->smm == ON_OFF_AUTO_ON) {
-        error_report("System Management Mode not supported by this hypervisor.");
-        exit(1);
+        error_report_exit("System Management Mode not supported "
+                          "by this hypervisor.");
     }
     return false;
 }
hw/i386/pc_piix.c +1 -2
index a07dc81..f4d15ef 100644
@@ -404,8 +404,7 @@ static void pc_xen_hvm_init(MachineState *machine)
     PCIBus *bus;
 
     if (!xen_enabled()) {
-        error_report("xenfv machine requires the xen accelerator");
-        exit(1);
+        error_report_exit("xenfv machine requires the xen accelerator");
     }
 
     pc_xen_hvm_init_pci(machine);
hw/i386/x86-iommu.c +2 -3
index ce26b2a..12429a6 100644
@@ -58,9 +58,8 @@ static void x86_iommu_set_default(X86IOMMUState *x86_iommu)
     assert(x86_iommu);
 
     if (x86_iommu_default) {
-        error_report("QEMU does not support multiple vIOMMUs "
-                     "for x86 yet.");
-        exit(1);
+        error_report_exit("QEMU does not support multiple vIOMMUs "
+                          "for x86 yet.");
     }
 
     x86_iommu_default = x86_iommu;
hw/ide/core.c +2 -3
index 45b6df1..aa85502 100644
@@ -2851,9 +2851,8 @@ void ide_drive_get(DriveInfo **hd, int n)
      */
 
     if (highest_bus > n_buses) {
-        error_report("Too many IDE buses defined (%d > %d)",
-                     highest_bus, n_buses);
-        exit(1);
+        error_report_exit("Too many IDE buses defined (%d > %d)", highest_bus,
+                          n_buses);
     }
 
     for (i = 0; i < n; i++) {
hw/intc/ioapic.c +2 -3
index 31791b0..aaa06fe 100644
@@ -400,9 +400,8 @@ static void ioapic_realize(DeviceState *dev, Error **errp)
     IOAPICCommonState *s = IOAPIC_COMMON(dev);
 
     if (s->version != 0x11 && s->version != 0x20) {
-        error_report("IOAPIC only supports version 0x11 or 0x20 "
-                     "(default: 0x11).");
-        exit(1);
+        error_report_exit("IOAPIC only supports version 0x11 or 0x20 "
+                          "(default: 0x11).");
     }
 
     memory_region_init_io(&s->io_memory, OBJECT(s), &ioapic_io_ops, s,
hw/intc/xics_kvm.c +8 -9
index edbd62f..3ae72b0 100644
@@ -65,9 +65,9 @@ static void icp_get_kvm_state(ICPState *ss)
 
     ret = kvm_vcpu_ioctl(ss->cs, KVM_GET_ONE_REG, &reg);
     if (ret != 0) {
-        error_report("Unable to retrieve KVM interrupt controller state"
-                " for CPU %ld: %s", kvm_arch_vcpu_id(ss->cs), strerror(errno));
-        exit(1);
+        error_report_exit("Unable to retrieve KVM interrupt controller state"
+                          " for CPU %ld: %s",
+                          kvm_arch_vcpu_id(ss->cs), strerror(errno));
     }
 
     ss->xirr = state >> KVM_REG_PPC_ICP_XISR_SHIFT;
@@ -162,9 +162,9 @@ static void ics_get_kvm_state(ICSState *ics)
 
         ret = ioctl(xicskvm->kernel_xics_fd, KVM_GET_DEVICE_ATTR, &attr);
         if (ret != 0) {
-            error_report("Unable to retrieve KVM interrupt controller state"
-                    " for IRQ %d: %s", i + ics->offset, strerror(errno));
-            exit(1);
+            error_report_exit("Unable to retrieve KVM interrupt controller "
+                              "state for IRQ %d: %s",
+                              i + ics->offset, strerror(errno));
         }
 
         irq->server = state & KVM_XICS_DESTINATION_MASK;
@@ -354,9 +354,8 @@ static void xics_kvm_cpu_setup(XICSState *xics, PowerPCCPU *cpu)
                                   xicskvm->kernel_xics_fd,
                                   kvm_arch_vcpu_id(cs));
         if (ret < 0) {
-            error_report("Unable to connect CPU%ld to kernel XICS: %s",
-                    kvm_arch_vcpu_id(cs), strerror(errno));
-            exit(1);
+            error_report_exit("Unable to connect CPU%ld to kernel XICS: %s",
+                              kvm_arch_vcpu_id(cs), strerror(errno));
         }
         ss->cap_irq_xics_enabled = true;
     }
hw/m68k/an5206.c +1 -2
index 142bab9..03879c5 100644
@@ -44,8 +44,7 @@ static void an5206_init(MachineState *machine)
     }
     cpu = cpu_m68k_init(cpu_model);
     if (!cpu) {
-        error_report("Unable to find m68k CPU definition");
-        exit(1);
+        error_report_exit("Unable to find m68k CPU definition");
     }
     env = &cpu->env;
 
hw/microblaze/boot.c +2 -3
index 9eebb1a..f5132c0 100644
@@ -190,9 +190,8 @@ void microblaze_load_kernel(MicroBlazeCPU *cpu, hwaddr ddr_base,
                                                   ram_size - initrd_offset);
             }
             if (initrd_size < 0) {
-                error_report("qemu: could not load initrd '%s'",
-                             initrd_filename);
-                exit(EXIT_FAILURE);
+                error_report_exit("qemu: could not load initrd '%s'",
+                                  initrd_filename);
             }
             boot_info.initrd_end = boot_info.initrd_start + initrd_size;
             high = ROUND_UP(high + initrd_size, 4);
hw/mips/mips_fulong2e.c +1 -2
index 889cdc7..75fe1a3 100644
@@ -328,8 +328,7 @@ static void mips_fulong2e_init(MachineState *machine)
 
         if ((bios_size < 0 || bios_size > BIOS_SIZE) &&
             !kernel_filename && !qtest_enabled()) {
-            error_report("Could not load MIPS bios '%s'", bios_name);
-            exit(1);
+            error_report_exit("Could not load MIPS bios '%s'", bios_name);
         }
     }
 
hw/mips/mips_jazz.c +1 -2
index 73f6c9f..5d46691 100644
@@ -196,8 +196,7 @@ static void mips_jazz_init(MachineState *machine,
         bios_size = -1;
     }
     if ((bios_size < 0 || bios_size > MAGNUM_BIOS_SIZE) && !qtest_enabled()) {
-        error_report("Could not load MIPS bios '%s'", bios_name);
-        exit(1);
+        error_report_exit("Could not load MIPS bios '%s'", bios_name);
     }
 
     /* Init CPU internal devices */
hw/mips/mips_malta.c +12 -14
index e90857e..404046d 100644
@@ -809,17 +809,16 @@ static int64_t load_kernel (void)
     /* Sanity check where the kernel has been linked */
     if (kvm_enabled()) {
         if (kernel_entry & 0x80000000ll) {
-            error_report("KVM guest kernels must be linked in useg. "
-                         "Did you forget to enable CONFIG_KVM_GUEST?");
-            exit(1);
+            error_report_exit("KVM guest kernels must be linked in useg. "
+                              "Did you forget to enable CONFIG_KVM_GUEST?");
         }
 
         xlate_to_kseg0 = cpu_mips_kvm_um_phys_to_kseg0;
     } else {
         if (!(kernel_entry & 0x80000000ll)) {
-            error_report("KVM guest kernels aren't supported with TCG. "
-                         "Did you unintentionally enable CONFIG_KVM_GUEST?");
-            exit(1);
+            error_report_exit("KVM guest kernels aren't supported with TCG. "
+                              "Did you unintentionally enable "
+                              "CONFIG_KVM_GUEST?");
         }
 
         xlate_to_kseg0 = cpu_mips_phys_to_kseg0;
@@ -949,8 +948,7 @@ static void create_cps(MaltaState *s, const char *cpu_model,
     object_property_set_int(OBJECT(s->cps), smp_cpus, "num-vp", &err);
     object_property_set_bool(OBJECT(s->cps), true, "realized", &err);
     if (err != NULL) {
-        error_report("%s", error_get_pretty(err));
-        exit(1);
+        error_report_exit("%s", error_get_pretty(err));
     }
 
     sysbus_mmio_map_overlap(SYS_BUS_DEVICE(s->cps), 0, 0, 1);
@@ -1119,9 +1117,9 @@ void mips_malta_init(MachineState *machine)
     } else {
         /* The flash region isn't executable from a KVM guest */
         if (kvm_enabled()) {
-            error_report("KVM enabled but no -kernel argument was specified. "
-                         "Booting from flash is not supported with KVM.");
-            exit(1);
+            error_report_exit("KVM enabled but no -kernel argument was "
+                              "specified. Booting from flash is not "
+                              "supported with KVM.");
         }
         /* Load firmware from flash. */
         if (!dinfo) {
@@ -1139,9 +1137,9 @@ void mips_malta_init(MachineState *machine)
             }
             if ((bios_size < 0 || bios_size > BIOS_SIZE) &&
                 !kernel_filename && !qtest_enabled()) {
-                error_report("Could not load MIPS bios '%s', and no "
-                             "-kernel argument was specified", bios_name);
-                exit(1);
+                error_report_exit("Could not load MIPS bios '%s', and no "
+                                  "-kernel argument was specified",
+                                  bios_name);
             }
         }
         /* In little endian mode the 32bit words in the bios are swapped,
hw/mips/mips_mipssim.c +2 -3
index 1b91195..8c8f09b 100644
@@ -199,9 +199,8 @@ mips_mipssim_init(MachineState *machine)
     if ((bios_size < 0 || bios_size > BIOS_SIZE) &&
         !kernel_filename && !qtest_enabled()) {
         /* Bail out if we have neither a kernel image nor boot vector code. */
-        error_report("Could not load MIPS bios '%s', and no "
-                     "-kernel argument was specified", bios_name);
-        exit(1);
+        error_report_exit("Could not load MIPS bios '%s', and no "
+                          "-kernel argument was specified", bios_name);
     } else {
         /* We have a boot vector start address. */
         env->active_tc.PC = (target_long)(int32_t)0xbfc00000;
hw/net/virtio-net.c +12 -16
index 01f1351..cd6d981 100644
@@ -892,8 +892,7 @@ static void virtio_net_handle_ctrl(VirtIODevice *vdev, VirtQueue *vq)
         }
         if (iov_size(elem->in_sg, elem->in_num) < sizeof(status) ||
             iov_size(elem->out_sg, elem->out_num) < sizeof(ctrl)) {
-            error_report("virtio-net ctrl missing headers");
-            exit(1);
+            error_report_exit("virtio-net ctrl missing headers");
         }
 
         iov_cnt = elem->out_num;
@@ -1124,19 +1123,18 @@ static ssize_t virtio_net_receive(NetClientState *nc, const uint8_t *buf, size_t
         if (!elem) {
             if (i == 0)
                 return -1;
-            error_report("virtio-net unexpected empty queue: "
-                         "i %zd mergeable %d offset %zd, size %zd, "
-                         "guest hdr len %zd, host hdr len %zd "
-                         "guest features 0x%" PRIx64,
-                         i, n->mergeable_rx_bufs, offset, size,
-                         n->guest_hdr_len, n->host_hdr_len,
-                         vdev->guest_features);
-            exit(1);
+            error_report_exit("virtio-net unexpected empty queue: "
+                              "i %zd mergeable %d offset %zd, size %zd, "
+                              "guest hdr len %zd, host hdr len %zd "
+                              "guest features 0x%" PRIx64,
+                              i, n->mergeable_rx_bufs, offset, size,
+                              n->guest_hdr_len, n->host_hdr_len,
+                              vdev->guest_features);
         }
 
         if (elem->in_num < 1) {
-            error_report("virtio-net receive queue contains no in buffers");
-            exit(1);
+            error_report_exit("virtio-net receive queue contains "
+                              "no in buffers");
         }
 
         sg = elem->in_sg;
@@ -1238,15 +1236,13 @@ static int32_t virtio_net_flush_tx(VirtIONetQueue *q)
         out_num = elem->out_num;
         out_sg = elem->out_sg;
         if (out_num < 1) {
-            error_report("virtio-net header not in first element");
-            exit(1);
+            error_report_exit("virtio-net header not in first element");
         }
 
         if (n->has_vnet_hdr) {
             if (iov_to_buf(out_sg, out_num, 0, &mhdr, n->guest_hdr_len) <
                 n->guest_hdr_len) {
-                error_report("virtio-net header incorrect");
-                exit(1);
+                error_report_exit("virtio-net header incorrect");
             }
             if (n->needs_vnet_hdr_swap) {
                 virtio_net_hdr_swap(vdev, (void *) &mhdr);
hw/nvram/fw_cfg.c +2 -3
index 6a68e59..19ca9e0 100644
@@ -805,9 +805,8 @@ void fw_cfg_add_file_callback(FWCfgState *s,  const char *filename,
     for (i = 0; i <= count; i++) {
         if (i != index &&
             strcmp(s->files->f[index].name, s->files->f[i].name) == 0) {
-            error_report("duplicate fw_cfg file name: %s",
-                         s->files->f[index].name);
-            exit(1);
+            error_report_exit("duplicate fw_cfg file name: %s",
+                              s->files->f[index].name);
         }
     }
 
hw/pci/pci.c +2 -3
index 24fae16..f2893e5 100644
@@ -1797,9 +1797,8 @@ PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
 
     bus = pci_get_bus_devfn(&devfn, rootbus, devaddr);
     if (!bus) {
-        error_report("Invalid PCI device address %s for device %s",
-                     devaddr, pci_nic_names[i]);
-        exit(1);
+        error_report_exit("Invalid PCI device address %s for device %s",
+                          devaddr, pci_nic_names[i]);
     }
 
     pci_dev = pci_create(bus, devfn, pci_nic_names[i]);
hw/ppc/e500.c +2 -3
index 0cd534d..a864e81 100644
@@ -207,9 +207,8 @@ static int sysbus_device_create_devtree(SysBusDevice *sbdev, void *opaque)
     }
 
     if (!matched) {
-        error_report("Device %s is not supported by this machine yet.",
-                     qdev_fw_name(DEVICE(sbdev)));
-        exit(1);
+        error_report_exit("Device %s is not supported by this machine yet.",
+                          qdev_fw_name(DEVICE(sbdev)));
     }
 
     return 0;
hw/ppc/mac_newworld.c +5 -9
index 7d25106..4e6c310 100644
@@ -230,8 +230,7 @@ static void ppc_core99_init(MachineState *machine)
         bios_size = -1;
     }
     if (bios_size < 0 || bios_size > BIOS_SIZE) {
-        error_report("could not load PowerPC bios '%s'", bios_name);
-        exit(1);
+        error_report_exit("could not load PowerPC bios '%s'", bios_name);
     }
 
     if (linux_boot) {
@@ -257,8 +256,7 @@ static void ppc_core99_init(MachineState *machine)
                                               kernel_base,
                                               ram_size - kernel_base);
         if (kernel_size < 0) {
-            error_report("could not load kernel '%s'", kernel_filename);
-            exit(1);
+            error_report_exit("could not load kernel '%s'", kernel_filename);
         }
         /* load initrd */
         if (initrd_filename) {
@@ -266,9 +264,8 @@ static void ppc_core99_init(MachineState *machine)
             initrd_size = load_image_targphys(initrd_filename, initrd_base,
                                               ram_size - initrd_base);
             if (initrd_size < 0) {
-                error_report("could not load initial ram disk '%s'",
-                             initrd_filename);
-                exit(1);
+                error_report_exit("could not load initial ram disk '%s'",
+                                  initrd_filename);
             }
             cmdline_base = round_page(initrd_base + initrd_size);
         } else {
@@ -349,8 +346,7 @@ static void ppc_core99_init(MachineState *machine)
             break;
 #endif /* defined(TARGET_PPC64) */
         default:
-            error_report("Bus model not supported on mac99 machine");
-            exit(1);
+            error_report_exit("Bus model not supported on mac99 machine");
         }
     }
 
hw/ppc/mac_oldworld.c +7 -11
index 4479487..b96114c 100644
@@ -157,8 +157,7 @@ static void ppc_heathrow_init(MachineState *machine)
         bios_size = -1;
     }
     if (bios_size < 0 || bios_size > BIOS_SIZE) {
-        error_report("could not load PowerPC bios '%s'", bios_name);
-        exit(1);
+        error_report_exit("could not load PowerPC bios '%s'", bios_name);
     }
 
     if (linux_boot) {
@@ -183,8 +182,7 @@ static void ppc_heathrow_init(MachineState *machine)
                                               kernel_base,
                                               ram_size - kernel_base);
         if (kernel_size < 0) {
-            error_report("could not load kernel '%s'", kernel_filename);
-            exit(1);
+            error_report_exit("could not load kernel '%s'", kernel_filename);
         }
         /* load initrd */
         if (initrd_filename) {
@@ -192,9 +190,8 @@ static void ppc_heathrow_init(MachineState *machine)
             initrd_size = load_image_targphys(initrd_filename, initrd_base,
                                               ram_size - initrd_base);
             if (initrd_size < 0) {
-                error_report("could not load initial ram disk '%s'",
-                             initrd_filename);
-                exit(1);
+                error_report_exit("could not load initial ram disk '%s'",
+                                  initrd_filename);
             }
             cmdline_base = round_page(initrd_base + initrd_size);
         } else {
@@ -250,8 +247,8 @@ static void ppc_heathrow_init(MachineState *machine)
                 ((qemu_irq *)env->irq_inputs)[PPC6xx_INPUT_INT];
             break;
         default:
-            error_report("Bus model not supported on OldWorld Mac machine");
-            exit(1);
+            error_report_exit("Bus model not supported on "
+                              "OldWorld Mac machine");
         }
     }
 
@@ -264,8 +261,7 @@ static void ppc_heathrow_init(MachineState *machine)
 
     /* init basic PC hardware */
     if (PPC_INPUT(env) != PPC_FLAGS_INPUT_6xx) {
-        error_report("Only 6xx bus is supported on heathrow machine");
-        exit(1);
+        error_report_exit("Only 6xx bus is supported on heathrow machine");
     }
     pic = heathrow_pic_init(&pic_mem, 1, heathrow_irqs);
     pci_bus = pci_grackle_init(0xfec00000, pic,
hw/ppc/mpc8544ds.c +1 -2
index 27b8289..a8d5604 100644
@@ -42,8 +42,7 @@ static void mpc8544ds_init(MachineState *machine)
     };
 
     if (machine->ram_size > 0xc0000000) {
-        error_report("The MPC8544DS board only supports up to 3GB of RAM");
-        exit(1);
+        error_report_exit("The MPC8544DS board only supports up to 3GB of RAM");
     }
 
     ppce500_init(machine, &params);
hw/ppc/ppc405_boards.c +6 -8
index 4b2f07a..3eb96b9 100644
@@ -265,14 +265,13 @@ static void ref405ep_init(MachineState *machine)
             bios_size = load_image(filename, memory_region_get_ram_ptr(bios));
             g_free(filename);
             if (bios_size < 0 || bios_size > BIOS_SIZE) {
-                error_report("Could not load PowerPC BIOS '%s'", bios_name);
-                exit(1);
+                error_report_exit("Could not load PowerPC BIOS '%s'",
+                                  bios_name);
             }
             bios_size = (bios_size + 0xfff) & ~0xfff;
             memory_region_add_subregion(sysmem, (uint32_t)(-bios_size), bios);
         } else if (!qtest_enabled() || kernel_filename != NULL) {
-            error_report("Could not load PowerPC BIOS '%s'", bios_name);
-            exit(1);
+            error_report_exit("Could not load PowerPC BIOS '%s'", bios_name);
         } else {
             /* Avoid an uninitialized variable warning */
             bios_size = -1;
@@ -563,14 +562,13 @@ static void taihu_405ep_init(MachineState *machine)
             bios_size = load_image(filename, memory_region_get_ram_ptr(bios));
             g_free(filename);
             if (bios_size < 0 || bios_size > BIOS_SIZE) {
-                error_report("Could not load PowerPC BIOS '%s'", bios_name);
-                exit(1);
+                error_report_exit("Could not load PowerPC BIOS '%s'",
+                                  bios_name);
             }
             bios_size = (bios_size + 0xfff) & ~0xfff;
             memory_region_add_subregion(sysmem, (uint32_t)(-bios_size), bios);
         } else if (!qtest_enabled()) {
-            error_report("Could not load PowerPC BIOS '%s'", bios_name);
-            exit(1);
+            error_report_exit("Could not load PowerPC BIOS '%s'", bios_name);
         }
         memory_region_set_readonly(bios, true);
     }
hw/ppc/prep.c +4 -7
index 054af1e..08bb268 100644
@@ -536,8 +536,7 @@ static void ppc_prep_init(MachineState *machine)
         kernel_size = load_image_targphys(kernel_filename, kernel_base,
                                           ram_size - kernel_base);
         if (kernel_size < 0) {
-            error_report("could not load kernel '%s'", kernel_filename);
-            exit(1);
+            error_report_exit("could not load kernel '%s'", kernel_filename);
         }
         /* load initrd */
         if (initrd_filename) {
@@ -545,9 +544,8 @@ static void ppc_prep_init(MachineState *machine)
             initrd_size = load_image_targphys(initrd_filename, initrd_base,
                                               ram_size - initrd_base);
             if (initrd_size < 0) {
-                error_report("could not load initial ram disk '%s'",
-                             initrd_filename);
-                exit(1);
+                error_report_exit("could not load initial ram disk '%s'",
+                                  initrd_filename);
             }
         } else {
             initrd_base = 0;
@@ -574,8 +572,7 @@ static void ppc_prep_init(MachineState *machine)
     }
 
     if (PPC_INPUT(env) != PPC_FLAGS_INPUT_6xx) {
-        error_report("Only 6xx bus is supported on PREP machine");
-        exit(1);
+        error_report_exit("Only 6xx bus is supported on PREP machine");
     }
 
     dev = qdev_create(NULL, "raven-pcihost");
hw/ppc/spapr.c +33 -54

196 lines not on this page · raw message

hw/ppc/virtex_ml507.c +2 -3
index b97d966..1031113 100644
@@ -282,9 +282,8 @@ static void virtex_init(MachineState *machine)
                                               high, ram_size - high);
 
             if (initrd_size < 0) {
-                error_report("couldn't load ram disk '%s'",
-                             machine->initrd_filename);
-                exit(1);
+                error_report_exit("couldn't load ram disk '%s'",
+                                  machine->initrd_filename);
             }
             high = ROUND_UP(high + initrd_size, 4);
         }
hw/scsi/vhost-scsi.c +4 -7
index 5b26946..3160921 100644
@@ -171,8 +171,8 @@ static void vhost_scsi_set_config(VirtIODevice *vdev,
 
     if ((uint32_t) virtio_ldl_p(vdev, &scsiconf->sense_size) != vs->sense_size ||
         (uint32_t) virtio_ldl_p(vdev, &scsiconf->cdb_size) != vs->cdb_size) {
-        error_report("vhost-scsi does not support changing the sense data and CDB sizes");
-        exit(1);
+        error_report_exit("vhost-scsi does not support changing "
+                          "the sense data and CDB sizes");
     }
 }
 
@@ -190,11 +190,8 @@ static void vhost_scsi_set_status(VirtIODevice *vdev, uint8_t val)
 
         ret = vhost_scsi_start(s);
         if (ret < 0) {
-            error_report("virtio-scsi: unable to start vhost: %s",
-                         strerror(-ret));
-
-            /* There is no userspace virtio-scsi fallback so exit */
-            exit(1);
+            error_report_exit("virtio-scsi: unable to start vhost: %s",
+                              strerror(-ret));
         }
     } else {
         vhost_scsi_stop(s);
hw/scsi/virtio-scsi.c +4 -6
index ce57ef6..048f569 100644
@@ -83,8 +83,7 @@ static void virtio_scsi_complete_req(VirtIOSCSIReq *req)
 
 static void virtio_scsi_bad_req(void)
 {
-    error_report("wrong size for virtio-scsi headers");
-    exit(1);
+    error_report_exit("wrong size for virtio-scsi headers");
 }
 
 static size_t qemu_sgl_concat(VirtIOSCSIReq *req, struct iovec *iov,
@@ -207,8 +206,7 @@ static void *virtio_scsi_load_request(QEMUFile *f, SCSIRequest *sreq)
 
     if (virtio_scsi_parse_req(req, sizeof(VirtIOSCSICmdReq) + vs->cdb_size,
                               sizeof(VirtIOSCSICmdResp) + vs->sense_size) < 0) {
-        error_report("invalid SCSI request migration data");
-        exit(1);
+        error_report_exit("invalid SCSI request migration data");
     }
 
     scsi_req_ref(sreq);
@@ -624,8 +622,8 @@ static void virtio_scsi_set_config(VirtIODevice *vdev,
 
     if ((uint32_t) virtio_ldl_p(vdev, &scsiconf->sense_size) >= 65536 ||
         (uint32_t) virtio_ldl_p(vdev, &scsiconf->cdb_size) >= 256) {
-        error_report("bad data written to virtio-scsi configuration space");
-        exit(1);
+        error_report_exit("bad data written to virtio-scsi "
+                          "configuration space");
     }
 
     vs->sense_size = virtio_ldl_p(vdev, &scsiconf->sense_size);
hw/sh4/shix.c +1 -2
index ccc9e75..b388189 100644
@@ -81,8 +81,7 @@ static void shix_init(MachineState *machine)
         bios_name = BIOS_FILENAME;
     ret = load_image_targphys(bios_name, 0, 0x4000);
     if (ret < 0 && !qtest_enabled()) {
-        error_report("Could not load SHIX bios '%s'", bios_name);
-        exit(1);
+        error_report_exit("Could not load SHIX bios '%s'", bios_name);
     }
 
     /* Register peripherals */
hw/smbios/smbios.c +15 -26

96 lines not on this page · raw message

hw/sparc/sun4m.c +7 -12
index 478fda8..51d3bad 100644
@@ -943,22 +943,19 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef,
                              slavio_irq[16], iommu, &ledma_irq, 1);
 
     if (graphic_depth != 8 && graphic_depth != 24) {
-        error_report("Unsupported depth: %d", graphic_depth);
-        exit (1);
+        error_report_exit("Unsupported depth: %d", graphic_depth);
     }
     num_vsimms = 0;
     if (num_vsimms == 0) {
         if (vga_interface_type == VGA_CG3) {
             if (graphic_depth != 8) {
-                error_report("Unsupported depth: %d", graphic_depth);
-                exit(1);
+                error_report_exit("Unsupported depth: %d", graphic_depth);
             }
 
             if (!(graphic_width == 1024 && graphic_height == 768) &&
                 !(graphic_width == 1152 && graphic_height == 900)) {
-                error_report("Unsupported resolution: %d x %d", graphic_width,
-                             graphic_height);
-                exit(1);
+                error_report_exit("Unsupported resolution: %d x %d",
+                                  graphic_width, graphic_height);
             }
 
             /* sbus irq 5 */
@@ -967,14 +964,12 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef,
         } else {
             /* If no display specified, default to TCX */
             if (graphic_depth != 8 && graphic_depth != 24) {
-                error_report("Unsupported depth: %d", graphic_depth);
-                exit(1);
+                error_report_exit("Unsupported depth: %d", graphic_depth);
             }
 
             if (!(graphic_width == 1024 && graphic_height == 768)) {
-                error_report("Unsupported resolution: %d x %d",
-                             graphic_width, graphic_height);
-                exit(1);
+                error_report_exit("Unsupported resolution: %d x %d",
+                                  graphic_width, graphic_height);
             }
 
             tcx_init(hwdef->tcx_base, slavio_irq[11], 0x00100000,
hw/tricore/tricore_testboard.c +3 -5
index 8d3520f..e987c9f 100644
@@ -50,9 +50,8 @@ static void tricore_load_kernel(CPUTriCoreState *env)
                            NULL, 0,
                            EM_TRICORE, 1, 0);
     if (kernel_size <= 0) {
-        error_report("qemu: no kernel file '%s'",
-                tricoretb_binfo.kernel_filename);
-        exit(1);
+        error_report_exit("qemu: no kernel file '%s'",
+                          tricoretb_binfo.kernel_filename);
     }
     env->PC = entry;
 
@@ -76,8 +75,7 @@ static void tricore_testboard_init(MachineState *machine, int board_id)
     }
     cpu = cpu_tricore_init(machine->cpu_model);
     if (!cpu) {
-        error_report("Unable to find CPU definition");
-        exit(1);
+        error_report_exit("Unable to find CPU definition");
     }
     env = &cpu->env;
     memory_region_init_ram(ext_cram, NULL, "powerlink_ext_c.ram", 2*1024*1024,
hw/unicore32/puv3.c +3 -6
index 31cd171..b21c6c3 100644
@@ -100,8 +100,7 @@ static void puv3_load_kernel(const char *kernel_filename)
     size = load_image_targphys(kernel_filename, KERNEL_LOAD_ADDR,
             KERNEL_MAX_SIZE);
     if (size < 0) {
-        error_report("Load kernel error: '%s'", kernel_filename);
-        exit(1);
+        error_report_exit("Load kernel error: '%s'", kernel_filename);
     }
 
     /* cheat curses that we have a graphic console, only under ocd console */
@@ -118,8 +117,7 @@ static void puv3_init(MachineState *machine)
     UniCore32CPU *cpu;
 
     if (initrd_filename) {
-        error_report("Please use kernel built-in initramdisk");
-        exit(1);
+        error_report_exit("Please use kernel built-in initramdisk");
     }
 
     if (!cpu_model) {
@@ -128,8 +126,7 @@ static void puv3_init(MachineState *machine)
 
     cpu = uc32_cpu_init(cpu_model);
     if (!cpu) {
-        error_report("Unable to find CPU definition");
-        exit(1);
+        error_report_exit("Unable to find CPU definition");
     }
     env = &cpu->env;
 
hw/virtio/virtio.c +16 -29

123 lines not on this page · raw message

hw/xtensa/sim.c +1 -3
index 5e94004..9c8408e 100644
@@ -68,9 +68,7 @@ static void xtensa_sim_init(MachineState *machine)
     for (n = 0; n < smp_cpus; n++) {
         cpu = cpu_xtensa_init(cpu_model);
         if (cpu == NULL) {
-            error_report("unable to find CPU definition '%s'",
-                         cpu_model);
-            exit(EXIT_FAILURE);
+            error_report_exit("unable to find CPU definition '%s'", cpu_model);
         }
         env = &cpu->env;
 
hw/xtensa/xtfpga.c +6 -10
index ac75949..1ec19e8 100644
@@ -234,9 +234,7 @@ static void lx_init(const LxBoardDesc *board, MachineState *machine)
     for (n = 0; n < smp_cpus; n++) {
         cpu = cpu_xtensa_init(cpu_model);
         if (cpu == NULL) {
-            error_report("unable to find CPU definition '%s'",
-                         cpu_model);
-            exit(EXIT_FAILURE);
+            error_report_exit("unable to find CPU definition '%s'", cpu_model);
         }
         env = &cpu->env;
 
@@ -323,8 +321,7 @@ static void lx_init(const LxBoardDesc *board, MachineState *machine)
             uint32_t dtb_addr = tswap32(cur_lowmem);
 
             if (!fdt) {
-                error_report("could not load DTB '%s'", dtb_filename);
-                exit(EXIT_FAILURE);
+                error_report_exit("could not load DTB '%s'", dtb_filename);
             }
 
             cpu_physical_memory_write(cur_lowmem, fdt, fdt_size);
@@ -343,8 +340,8 @@ static void lx_init(const LxBoardDesc *board, MachineState *machine)
                                                   lowmem_end - cur_lowmem);
             }
             if (initrd_size < 0) {
-                error_report("could not load initrd '%s'", initrd_filename);
-                exit(EXIT_FAILURE);
+                error_report_exit("could not load initrd '%s'",
+                                  initrd_filename);
             }
             initrd_location.start = tswap32(cur_lowmem);
             initrd_location.end = tswap32(cur_lowmem + initrd_size);
@@ -369,9 +366,8 @@ static void lx_init(const LxBoardDesc *board, MachineState *machine)
             if (success > 0 && is_linux) {
                 entry_point = ep;
             } else {
-                error_report("could not load kernel '%s'",
-                             kernel_filename);
-                exit(EXIT_FAILURE);
+                error_report_exit("could not load kernel '%s'",
+                                  kernel_filename);
             }
         }
         if (entry_point != env->pc) {
numa.c +9 -13
index 6289f46..8dc3565 100644
@@ -274,9 +274,8 @@ static void validate_numa_cpus(void)
                               MAX_CPUMASK_BITS)) {
             bitmap_and(seen_cpus, seen_cpus,
                        numa_info[i].node_cpu, MAX_CPUMASK_BITS);
-            error_report("CPU(s) present in multiple NUMA nodes: %s",
-                         enumerate_cpus(seen_cpus, max_cpus));
-            exit(EXIT_FAILURE);
+            error_report_exit("CPU(s) present in multiple NUMA nodes: %s",
+                              enumerate_cpus(seen_cpus, max_cpus));
         }
         bitmap_or(seen_cpus, seen_cpus,
                   numa_info[i].node_cpu, MAX_CPUMASK_BITS);
@@ -307,8 +306,7 @@ void parse_numa_opts(MachineClass *mc)
     for (i = max_numa_nodeid - 1; i >= 0; i--) {
         /* 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);
+            error_report_exit("numa: Node ID missing: %d", i);
         }
     }
 
@@ -349,10 +347,9 @@ void parse_numa_opts(MachineClass *mc)
             numa_total += numa_info[i].node_mem;
         }
         if (numa_total != ram_size) {
-            error_report("total memory for NUMA nodes (0x%" PRIx64 ")"
-                         " should equal RAM size (0x" RAM_ADDR_FMT ")",
-                         numa_total, ram_size);
-            exit(1);
+            error_report_exit("total memory for NUMA nodes (0x%" PRIx64 ")"
+                              " should equal RAM size (0x" RAM_ADDR_FMT ")",
+                              numa_total, ram_size);
         }
 
         for (i = 0; i < nb_numa_nodes; i++) {
@@ -458,10 +455,9 @@ void memory_region_allocate_system_memory(MemoryRegion *mr, Object *owner,
 
         if (memory_region_is_mapped(seg)) {
             char *path = object_get_canonical_path_component(OBJECT(backend));
-            error_report("memory backend %s is used multiple times. Each "
-                         "-numa option must use a different memdev value.",
-                         path);
-            exit(1);
+            error_report_exit("memory backend %s is used multiple times. Each "
+                              "-numa option must use a different memdev value.",
+                              path);
         }
 
         host_memory_backend_set_mapped(backend, true);
qemu-img.c +6 -10
index d2865a5..4bd6b79 100644
@@ -2415,8 +2415,8 @@ static void dump_map_entry(OutputFormat output_format, MapEntry *e,
     switch (output_format) {
     case OFORMAT_HUMAN:
         if (e->data && !e->has_offset) {
-            error_report("File contains external, encrypted or compressed clusters.");
-            exit(1);
+            error_report_exit("File contains external, encrypted "
+                              "or compressed clusters.");
         }
         if (e->data && !e->zero) {
             printf("%#-16"PRIx64"%#-16"PRIx64"%#-16"PRIx64"%s\n",
@@ -3490,8 +3490,7 @@ typedef struct BenchData {
 static void bench_undrained_flush_cb(void *opaque, int ret)
 {
     if (ret < 0) {
-        error_report("Failed flush request: %s", strerror(-ret));
-        exit(EXIT_FAILURE);
+        error_report_exit("Failed flush request: %s", strerror(-ret));
     }
 }
 
@@ -3501,8 +3500,7 @@ static void bench_cb(void *opaque, int ret)
     BlockAIOCB *acb;
 
     if (ret < 0) {
-        error_report("Failed request: %s", strerror(-ret));
-        exit(EXIT_FAILURE);
+        error_report_exit("Failed request: %s", strerror(-ret));
     }
 
     if (b->in_flush) {
@@ -3529,8 +3527,7 @@ static void bench_cb(void *opaque, int ret)
 
                 acb = blk_aio_flush(b->blk, cb, b);
                 if (!acb) {
-                    error_report("Failed to issue flush request");
-                    exit(EXIT_FAILURE);
+                    error_report_exit("Failed to issue flush request");
                 }
             }
             if (b->drain_on_flush) {
@@ -3548,8 +3545,7 @@ static void bench_cb(void *opaque, int ret)
                                  bench_cb, b);
         }
         if (!acb) {
-            error_report("Failed to issue request");
-            exit(EXIT_FAILURE);
+            error_report_exit("Failed to issue request");
         }
         b->in_flight++;
         b->offset += b->step;
qemu-io.c +3 -6
index db129ea..d7b4c5a 100644
@@ -488,8 +488,7 @@ int main(int argc, char **argv)
             break;
         case 'd':
             if (bdrv_parse_discard_flags(optarg, &flags) < 0) {
-                error_report("Invalid discard option: %s", optarg);
-                exit(1);
+                error_report_exit("Invalid discard option: %s", optarg);
             }
             break;
         case 'f':
@@ -509,8 +508,7 @@ int main(int argc, char **argv)
             break;
         case 't':
             if (bdrv_parse_cache_mode(optarg, &flags, &writethrough) < 0) {
-                error_report("Invalid cache option: %s", optarg);
-                exit(1);
+                error_report_exit("Invalid cache option: %s", optarg);
             }
             break;
         case 'T':
@@ -546,8 +544,7 @@ int main(int argc, char **argv)
     }
 
     if (format && imageOpts) {
-        error_report("--image-opts and -f are mutually exclusive");
-        exit(1);
+        error_report_exit("--image-opts and -f are mutually exclusive");
     }
 
     if (qemu_init_main_loop(&local_error)) {
qemu-nbd.c +44 -71

273 lines not on this page · raw message

replay/replay-char.c +2 -4
index edf46ab..209c9c0 100755
@@ -115,8 +115,7 @@ void replay_char_write_event_load(int *res, int *offset)
         replay_mutex_unlock();
     } else {
         replay_mutex_unlock();
-        error_report("Missing character write event in the replay log");
-        exit(1);
+        error_report_exit("Missing character write event in the replay log");
     }
 }
 
@@ -139,8 +138,7 @@ int replay_char_read_all_load(uint8_t *buf)
         return res;
     } else {
         replay_mutex_unlock();
-        error_report("Missing character read all event in the replay log");
-        exit(1);
+        error_report_exit("Missing character read all event in the replay log");
     }
 }
 
replay/replay-events.c +5 -7
index 3807245..cffaa08 100644
@@ -55,9 +55,8 @@ static void replay_run_event(Event *event)
         aio_bh_call(event->opaque);
         break;
     default:
-        error_report("Replay: invalid async event ID (%d) in the queue",
-                    event->event_kind);
-        exit(1);
+        error_report_exit("Replay: invalid async event ID (%d) in the queue",
+                          event->event_kind);
         break;
     }
 }
@@ -190,8 +189,8 @@ static void replay_save_event(Event *event, int checkpoint)
             replay_put_qword(event->id);
             break;
         default:
-            error_report("Unknown ID %" PRId64 " of replay event", event->id);
-            exit(1);
+            error_report_exit("Unknown ID %" PRId64 " of replay event",
+                              event->id);
         }
     }
 }
@@ -253,8 +252,7 @@ static Event *replay_read_event(int checkpoint)
         }
         break;
     default:
-        error_report("Unknown ID %d of replay event", read_event_kind);
-        exit(1);
+        error_report_exit("Unknown ID %d of replay event", read_event_kind);
         break;
     }
 
replay/replay-internal.c +2 -2
index 5835e8d..9bb4a1c 100644
@@ -158,8 +158,8 @@ void replay_fetch_data_kind(void)
             replay_check_error();
             replay_has_unread_data = 1;
             if (replay_data_kind >= EVENT_COUNT) {
-                error_report("Replay: unknown event kind %d", replay_data_kind);
-                exit(1);
+                error_report_exit("Replay: unknown event kind %d",
+                                  replay_data_kind);
             }
         }
     }
replay/replay-time.c +1 -2
index fffe072..c074e25 100644
@@ -60,6 +60,5 @@ int64_t replay_read_clock(ReplayClockKind kind)
         return ret;
     }
 
-    error_report("REPLAY INTERNAL ERROR %d", __LINE__);
-    exit(1);
+    error_report_exit("REPLAY INTERNAL ERROR %d", __LINE__);
 }
replay/replay.c +3 -6
index 167fd29..f4d96aa 100644
@@ -281,14 +281,12 @@ void replay_configure(QemuOpts *opts)
     } else if (!strcmp(rr, "replay")) {
         mode = REPLAY_MODE_PLAY;
     } else {
-        error_report("Invalid icount rr option: %s", rr);
-        exit(1);
+        error_report_exit("Invalid icount rr option: %s", rr);
     }
 
     fname = qemu_opt_get(opts, "rrfile");
     if (!fname) {
-        error_report("File name not specified for replay");
-        exit(1);
+        error_report_exit("File name not specified for replay");
     }
 
     replay_enable(fname, mode);
@@ -308,8 +306,7 @@ void replay_start(void)
         exit(1);
     }
     if (!use_icount) {
-        error_report("Please enable icount to use record/replay");
-        exit(1);
+        error_report_exit("Please enable icount to use record/replay");
     }
 
     /* Timer for snapshotting will be set up here. */
target-arm/machine.c +2 -3
index 7a6ca31..39fd251 100644
@@ -338,9 +338,8 @@ const char *gicv3_class_name(void)
 #ifdef TARGET_AARCH64
         return "kvm-arm-gicv3";
 #else
-        error_report("KVM GICv3 acceleration is not supported on this "
-                     "platform");
-        exit(1);
+        error_report_exit("KVM GICv3 acceleration is not supported on this "
+                          "platform");
 #endif
     } else {
         return "arm-gicv3";
target-i386/kvm.c +3 -5
index 0b2016a..04f542b 100644
@@ -3237,8 +3237,7 @@ void kvm_arch_init_irq_routing(KVMState *s)
            MSI routes for signaling interrupts to the local apics. */
         for (i = 0; i < IOAPIC_NUM_PINS; i++) {
             if (kvm_irqchip_add_msi_route(s, 0, NULL) < 0) {
-                error_report("Could not enable split IRQ mode.");
-                exit(1);
+                error_report_exit("Could not enable split IRQ mode.");
             }
         }
     }
@@ -3250,9 +3249,8 @@ int kvm_arch_irqchip_create(MachineState *ms, KVMState *s)
     if (machine_kernel_irqchip_split(ms)) {
         ret = kvm_vm_enable_cap(s, KVM_CAP_SPLIT_IRQCHIP, 0, 24);
         if (ret) {
-            error_report("Could not enable split irqchip mode: %s",
-                         strerror(-ret));
-            exit(1);
+            error_report_exit("Could not enable split irqchip mode: %s",
+                              strerror(-ret));
         } else {
             DPRINTF("Enabled KVM_CAP_SPLIT_IRQCHIP\n");
             kvm_split_irqchip = true;
target-ppc/kvm.c +3 -4
index dcb68b9..3e1d6dd 100644
@@ -2062,8 +2062,8 @@ void kvmppc_set_papr(PowerPCCPU *cpu)
 
     ret = kvm_vcpu_enable_cap(cs, KVM_CAP_PPC_PAPR, 0);
     if (ret) {
-        error_report("This vCPU type or KVM version does not support PAPR");
-        exit(1);
+        error_report_exit("This vCPU type or KVM version does "
+                          "not support PAPR");
     }
 
     /* Update the capability flag so we sync the right information
@@ -2083,8 +2083,7 @@ void kvmppc_set_mpic_proxy(PowerPCCPU *cpu, int mpic_proxy)
 
     ret = kvm_vcpu_enable_cap(cs, KVM_CAP_PPC_EPR, 0, mpic_proxy);
     if (ret && mpic_proxy) {
-        error_report("This KVM version does not support EPR");
-        exit(1);
+        error_report_exit("This KVM version does not support EPR");
     }
 }
 
target-s390x/cpu.c +2 -3
index e43e2d6..247c08e 100644
@@ -400,9 +400,8 @@ unsigned int s390_cpu_set_state(uint8_t cpu_state, S390CPU *cpu)
         s390_cpu_unhalt(cpu);
         break;
     default:
-        error_report("Requested CPU state is not a valid S390 CPU state: %u",
-                     cpu_state);
-        exit(1);
+        error_report_exit("Requested CPU state is not a valid "
+                          "S390 CPU state: %u", cpu_state);
     }
     if (kvm_enabled() && cpu->env.cpu_state != cpu_state) {
         kvm_s390_set_cpu_state(cpu, cpu_state);
target-s390x/kvm.c +3 -5
index 80ac621..0b4501a 100644
@@ -909,8 +909,7 @@ void kvm_s390_vcpu_interrupt(S390CPU *cpu, struct kvm_s390_irq *irq)
         if (!r) {
             return;
         }
-        error_report("KVM failed to inject interrupt %llx", irq->type);
-        exit(1);
+        error_report_exit("KVM failed to inject interrupt %llx", irq->type);
     }
 
     inject_vcpu_irq_legacy(cs, irq);
@@ -2181,9 +2180,8 @@ int kvm_s390_set_cpu_state(S390CPU *cpu, uint8_t cpu_state)
         mp_state.mp_state = KVM_MP_STATE_LOAD;
         break;
     default:
-        error_report("Requested CPU state is not a valid S390 CPU state: %u",
-                     cpu_state);
-        exit(1);
+        error_report_exit("Requested CPU state is not a valid "
+                          "S390 CPU state: %u", cpu_state);
     }
 
     ret = kvm_vcpu_ioctl(CPU(cpu), KVM_SET_MP_STATE, &mp_state);
target-s390x/mmu_helper.c +1 -2
index b11a027..a410bfa 100644
@@ -413,8 +413,7 @@ static bool lowprot_enabled(const CPUS390XState *env)
         return !(env->cregs[13] & _ASCE_PRIVATE_SPACE);
     default:
         /* We don't support access register mode */
-        error_report("unsupported addressing mode");
-        exit(1);
+        error_report_exit("unsupported addressing mode");
     }
 }
 
trace/control.c +2 -4
index d173c09..16b0705 100644
@@ -192,8 +192,7 @@ static void trace_init_events(const char *fname)
     loc_set_file(fname, 0);
     fp = fopen(fname, "r");
     if (!fp) {
-        error_report("%s", strerror(errno));
-        exit(1);
+        error_report_exit("%s", strerror(errno));
     }
     while (fgets(line_buf, sizeof(line_buf), fp)) {
         loc_set_file(fname, ++line_idx);
@@ -208,8 +207,7 @@ static void trace_init_events(const char *fname)
     }
     if (fclose(fp) != 0) {
         loc_set_file(fname, 0);
-        error_report("%s", strerror(errno));
-        exit(1);
+        error_report_exit("%s", strerror(errno));
     }
     loc_pop(&loc);
 }
ui/spice-core.c +16 -25

99 lines not on this page · raw message

vl.c +101 -169

641 lines not on this page · raw message

xen-hvm.c +1 -2
index 3b0343a..24e9a1d 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.7.4

Part of the diff is not shown here. View the raw message.

#17 lore raw

Re: [Qemu-devel] [PATCH v2] error-report: leveraging error_report_exit()

Your series failed automatic build test. Please find the testing commands and their output below. If you have docker installed, you can probably reproduce it locally.

Hi,

Your series failed automatic build test. Please find the testing commands and their output below. If you have docker installed, you can probably reproduce it locally.

Subject: [Qemu-devel] [PATCH v2] error-report: leveraging error_report_exit()
Message-id: [email protected]
Type: series

=== TEST SCRIPT BEGIN ===
#!/bin/bash
set -e
git submodule update --init dtc
make J=8 docker-test-quick@centos6

# we need CURL DPRINTF patch
# http://patchew.org/QEMU/1470027888-24381-1-git-send-email-famz%40redhat.com/
#make J=8 docker-test-mingw@fedora
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384 Switched to a new branch 'test'
b3e901f error-report: leveraging error_report_exit()

=== OUTPUT BEGIN ===
Submodule 'dtc' (git://git.qemu-project.org/dtc.git) registered for path 'dtc' Cloning into 'dtc'...
Submodule path 'dtc': checked out '65cc4d2748a2c2e6f27f1cf39e07a5dbabd80ebf'
BUILD centos6
ARCHIVE qemu.tgz
ARCHIVE dtc.tgz
COPY RUNNER
RUN test-quick in centos6
No C++ compiler available; disabling C++ specific optional code

Install prefix    /tmp/qemu-test/src/tests/docker/install
BIOS directory    /tmp/qemu-test/src/tests/docker/install/share/qemu
binary directory  /tmp/qemu-test/src/tests/docker/install/bin

library directory /tmp/qemu-test/src/tests/docker/install/lib module directory /tmp/qemu-test/src/tests/docker/install/lib/qemu libexec directory /tmp/qemu-test/src/tests/docker/install/libexec include directory /tmp/qemu-test/src/tests/docker/install/include config directory /tmp/qemu-test/src/tests/docker/install/etc
local state directory /tmp/qemu-test/src/tests/docker/install/var
Manual directory /tmp/qemu-test/src/tests/docker/install/share/man ELF interp prefix /usr/gnemul/qemu-%M

Source path       /tmp/qemu-test/src
C compiler        cc
Host C compiler   cc
C++ compiler      
Objective-C compiler cc
ARFLAGS           rv
CFLAGS            -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include   -g 
QEMU_CFLAGS       -I/usr/include/pixman-1    -fPIE -DPIE -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common  -Wendif-labels -Wmissing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-declaration -Wold-style-definition -Wtype-limits -fstack-protector-all
LDFLAGS           -Wl,--warn-common -Wl,-z,relro -Wl,-z,now -pie -m64 -g 
make              make
install           install
python            python -B
smbd              /usr/sbin/smbd
module support    no
host CPU          x86_64
host big endian   no
target list       x86_64-softmmu aarch64-softmmu
tcg debug enabled no
gprof enabled     no
sparse enabled    no
strip binaries    yes
profiler          no
static build      no
pixman            system
SDL support       yes (1.2.14)
GTK support       no 
GTK GL support    no
VTE support       no 
TLS priority      NORMAL
GNUTLS support    no
GNUTLS rnd        no
libgcrypt         no
libgcrypt kdf     no
nettle            no 
nettle kdf        no
libtasn1          no
curses support    no
virgl support     no
curl support      no
mingw32 support   no
Audio drivers     oss
Block whitelist (rw) 
Block whitelist (ro) 
VirtFS support    no
VNC support       yes
VNC SASL support  no
VNC JPEG support  no
VNC PNG support   no
xen support       no
brlapi support    no
bluez  support    no
Documentation     no
PIE               yes
vde support       no
netmap support    no
Linux AIO support no
ATTR/XATTR support yes
Install blobs     yes
KVM support       yes
RDMA support      no
TCG interpreter   no
fdt support       yes
preadv support    yes
fdatasync         yes
madvise           yes
posix_madvise     yes
uuid support      no
libcap-ng support no
vhost-net support yes
vhost-scsi support yes
Trace backends    log
spice support     no 
rbd support       no
xfsctl support    no
smartcard support no
libusb            no
usb net redir     no
OpenGL support    no
OpenGL dmabufs    no
libiscsi support  no
libnfs support    no

build guest agent yes
QGA VSS support no
QGA w32 disk info no
QGA MSI support no
seccomp support no
coroutine backend ucontext
coroutine pool yes
GlusterFS support no
Archipelago support no

gcov              gcov
gcov enabled      no
TPM support       yes
libssh2 support   no
TPM passthrough   yes
QOM debugging     yes
vhdx              no
lzo support       no
snappy support    no
bzip2 support     no

NUMA host support no
tcmalloc support no
jemalloc support no
avx2 optimization no

  GEN   x86_64-softmmu/config-devices.mak.tmp
  GEN   aarch64-softmmu/config-devices.mak.tmp
  GEN   config-host.h
  GEN   qemu-options.def
  GEN   qmp-commands.h
  GEN   qapi-types.h
  GEN   qapi-visit.h
  GEN   qapi-event.h
  GEN   x86_64-softmmu/config-devices.mak
  GEN   aarch64-softmmu/config-devices.mak
  GEN   qmp-introspect.h
  GEN   tests/test-qapi-types.h
  GEN   tests/test-qapi-visit.h
  GEN   tests/test-qmp-commands.h
  GEN   tests/test-qapi-event.h
  GEN   tests/test-qmp-introspect.h
  GEN   config-all-devices.mak
  GEN   trace/generated-events.h
  GEN   trace/generated-tracers.h
  GEN   trace/generated-tcg-tracers.h
  GEN   trace/generated-helpers-wrappers.h
  GEN   trace/generated-helpers.h
  CC    tests/qemu-iotests/socket_scm_helper.o
  GEN   qga/qapi-generated/qga-qapi-types.h
  GEN   qga/qapi-generated/qga-qapi-visit.h
  GEN   qga/qapi-generated/qga-qmp-commands.h
  GEN   qga/qapi-generated/qga-qapi-types.c
  GEN   qga/qapi-generated/qga-qapi-visit.c
  GEN   qga/qapi-generated/qga-qmp-marshal.c
  GEN   qmp-introspect.c
  GEN   qapi-types.c
  GEN   qapi-visit.c
  GEN   qapi-event.c
  CC    qapi/qapi-visit-core.o
  CC    qapi/qapi-dealloc-visitor.o
  CC    qapi/qmp-input-visitor.o
  CC    qapi/qmp-output-visitor.o
  CC    qapi/qmp-registry.o
  CC    qapi/qmp-dispatch.o
  CC    qapi/string-input-visitor.o
  CC    qapi/string-output-visitor.o
  CC    qapi/opts-visitor.o
  CC    qapi/qapi-clone-visitor.o
  CC    qapi/qmp-event.o
  CC    qapi/qapi-util.o
  CC    qobject/qnull.o
  CC    qobject/qint.o
  CC    qobject/qstring.o
  CC    qobject/qdict.o
  CC    qobject/qlist.o
  CC    qobject/qfloat.o
  CC    qobject/qbool.o
  CC    qobject/qjson.o
  CC    qobject/qobject.o
  CC    qobject/json-lexer.o
  CC    qobject/json-streamer.o
  CC    qobject/json-parser.o
  GEN   trace/generated-events.c
  CC    trace/control.o
  CC    trace/qmp.o
  CC    util/osdep.o
  CC    util/cutils.o
  CC    util/unicode.o
  CC    util/qemu-timer-common.o
  CC    util/compatfd.o
  CC    util/event_notifier-posix.o
  CC    util/mmap-alloc.o
  CC    util/oslib-posix.o
  CC    util/qemu-openpty.o
  CC    util/qemu-thread-posix.o
  CC    util/memfd.o
  CC    util/envlist.o
  CC    util/path.o
  CC    util/module.o
  CC    util/bitmap.o
  CC    util/bitops.o
  CC    util/hbitmap.o
  CC    util/fifo8.o
  CC    util/acl.o
  CC    util/error.o
  CC    util/qemu-error.o
  CC    util/id.o
  CC    util/iov.o
  CC    util/qemu-config.o
  CC    util/qemu-sockets.o
  CC    util/uri.o
  CC    util/notify.o
  CC    util/qemu-option.o
  CC    util/qemu-progress.o
  CC    util/hexdump.o
  CC    util/crc32c.o
  CC    util/throttle.o
  CC    util/getauxval.o
  CC    util/readline.o
  CC    util/rfifolock.o
  CC    util/rcu.o
  CC    util/qemu-coroutine.o
  CC    util/qemu-coroutine-lock.o
  CC    util/qemu-coroutine-io.o
  CC    util/qemu-coroutine-sleep.o
  CC    util/coroutine-ucontext.o
  CC    util/buffer.o
  CC    util/timed-average.o
  CC    util/base64.o
  CC    util/log.o
  CC    util/qdist.o
  CC    util/qht.o
  CC    util/range.o
  CC    crypto/pbkdf-stub.o
  CC    stubs/arch-query-cpu-def.o
  CC    stubs/bdrv-next-monitor-owned.o
  CC    stubs/blk-commit-all.o
/tmp/qemu-test/src/util/qht.c: In function ‘qht_reset_size’:
/tmp/qemu-test/src/util/qht.c:413: warning: ‘new’ may be used uninitialized in this function
  CC    stubs/blockdev-close-all-bdrv-states.o
  CC    stubs/clock-warp.o
  CC    stubs/cpu-get-clock.o
  CC    stubs/cpu-get-icount.o
  CC    stubs/dump.o
  CC    stubs/fdset-add-fd.o
  CC    stubs/fdset-find-fd.o
  CC    stubs/fdset-get-fd.o
  CC    stubs/fdset-remove-fd.o
  CC    stubs/gdbstub.o
  CC    stubs/get-fd.o
  CC    stubs/get-next-serial.o
  CC    stubs/get-vm-name.o
  CC    stubs/iothread-lock.o
  CC    stubs/is-daemonized.o
  CC    stubs/machine-init-done.o
  CC    stubs/migr-blocker.o
  CC    stubs/mon-is-qmp.o
  CC    stubs/mon-printf.o
  CC    stubs/monitor-init.o
  CC    stubs/notify-event.o
  CC    stubs/qtest.o
  CC    stubs/replay.o
  CC    stubs/replay-user.o
  CC    stubs/reset.o
  CC    stubs/runstate-check.o
  CC    stubs/set-fd-handler.o
  CC    stubs/slirp.o
  CC    stubs/sysbus.o
  CC    stubs/trace-control.o
  CC    stubs/uuid.o
  CC    stubs/vm-stop.o
  CC    stubs/vmstate.o
  CC    stubs/cpus.o
  CC    stubs/kvm.o
  CC    stubs/qmp_pc_dimm_device_list.o
  CC    stubs/target-monitor-defs.o
  CC    stubs/target-get-monitor-def.o
  CC    stubs/vhost.o
  CC    stubs/iohandler.o
/tmp/qemu-test/src/trace/control.c: In function ‘trace_init_events’:
/tmp/qemu-test/src/trace/control.c:195: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/trace/control.c:195: warning: nested extern declaration of ‘error_report_exit’
  CC    stubs/smbios_type_38.o
  CC    stubs/ipmi.o
  CC    stubs/pc_madt_cpu_entry.o
  CC    contrib/ivshmem-client/ivshmem-client.o
  CC    contrib/ivshmem-client/main.o
  CC    contrib/ivshmem-server/ivshmem-server.o
  CC    contrib/ivshmem-server/main.o
  CC    qemu-nbd.o
  CC    async.o
  CC    thread-pool.o
  CC    block.o
  CC    blockjob.o
  CC    main-loop.o
  CC    iohandler.o
  CC    qemu-timer.o
  CC    aio-posix.o
  CC    qemu-io-cmds.o
  CC    block/raw_bsd.o
  CC    block/qcow.o
  CC    block/vdi.o
  CC    block/vmdk.o
  CC    block/cloop.o
  CC    block/bochs.o
  CC    block/vpc.o
  CC    block/vvfat.o
  CC    block/qcow2.o
  CC    block/qcow2-refcount.o
  CC    block/qcow2-cluster.o
  CC    block/qcow2-snapshot.o
  CC    block/qcow2-cache.o
  CC    block/qed.o
  CC    block/qed-gencb.o
  CC    block/qed-l2-cache.o
  CC    block/qed-table.o
  CC    block/qed-cluster.o
  CC    block/qed-check.o
  CC    block/quorum.o
  CC    block/parallels.o
  CC    block/blkdebug.o
  CC    block/blkverify.o
  CC    block/blkreplay.o
  CC    block/block-backend.o
  CC    block/snapshot.o
  CC    block/qapi.o
  CC    block/raw-posix.o
  CC    block/null.o
  CC    block/mirror.o
  CC    block/commit.o
  CC    block/io.o
  CC    block/throttle-groups.o
  CC    block/nbd.o
  CC    block/nbd-client.o
  CC    block/sheepdog.o
  CC    block/accounting.o
  CC    block/dirty-bitmap.o
  CC    block/write-threshold.o
  CC    block/crypto.o
  CC    nbd/server.o
  CC    nbd/client.o
  CC    nbd/common.o
  CC    block/dmg.o
  CC    crypto/init.o
  CC    crypto/hash.o
  CC    crypto/hash-glib.o
  CC    crypto/aes.o
  CC    crypto/desrfb.o
  CC    crypto/cipher.o
  CC    crypto/tlscreds.o
  CC    crypto/tlscredsanon.o
  CC    crypto/tlscredsx509.o
  CC    crypto/tlssession.o
  CC    crypto/secret.o
  CC    crypto/random-platform.o
  CC    crypto/pbkdf.o
  CC    crypto/ivgen.o
  CC    crypto/ivgen-essiv.o
  CC    crypto/ivgen-plain.o
  CC    crypto/ivgen-plain64.o
  CC    crypto/afsplit.o
  CC    crypto/xts.o
  CC    crypto/block.o
  CC    crypto/block-qcow.o
  CC    crypto/block-luks.o
  CC    io/channel.o
  CC    io/channel-buffer.o
  CC    io/channel-command.o
  CC    io/channel-file.o
  CC    io/channel-socket.o
  CC    io/channel-tls.o
  CC    io/channel-watch.o
  CC    io/channel-websock.o
  CC    io/channel-util.o
  CC    io/task.o
  CC    qom/object.o
  CC    qom/container.o
  CC    qom/qom-qobject.o
  CC    qom/object_interfaces.o
  GEN   qemu-img-cmds.h
  CC    qemu-io.o
  CC    qemu-bridge-helper.o
  CC    blockdev.o
  CC    blockdev-nbd.o
  CC    iothread.o
  CC    qdev-monitor.o
  CC    device-hotplug.o
  CC    os-posix.o
  CC    qemu-char.o
  CC    page_cache.o
  CC    accel.o
  CC    bt-host.o
  CC    bt-vhci.o
  CC    dma-helpers.o
  CC    vl.o
  CC    tpm.o
  CC    device_tree.o
  GEN   qmp-marshal.c
  CC    qmp.o
  CC    hmp.o
  CC    tcg-runtime.o
/tmp/qemu-test/src/qemu-nbd.c: In function ‘find_partition’:
/tmp/qemu-test/src/qemu-nbd.c:176: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/qemu-nbd.c:176: warning: nested extern declaration of ‘error_report_exit’
  CC    audio/audio.o
  CC    audio/noaudio.o
  CC    audio/wavaudio.o
  CC    audio/mixeng.o
  CC    audio/sdlaudio.o
  CC    audio/ossaudio.o
  CC    audio/wavcapture.o
  CC    backends/rng.o
  CC    backends/rng-egd.o
  CC    backends/rng-random.o
  CC    backends/msmouse.o
  CC    backends/testdev.o
  CC    backends/tpm.o
  CC    backends/hostmem.o
  CC    backends/hostmem-ram.o
  CC    backends/hostmem-file.o
  CC    block/stream.o
  CC    block/backup.o
  CC    disas/arm.o
  CC    disas/i386.o
  CC    fsdev/qemu-fsdev-dummy.o
  CC    fsdev/qemu-fsdev-opts.o
  CC    hw/acpi/core.o
  CC    hw/acpi/piix4.o
  CC    hw/acpi/pcihp.o
  CC    hw/acpi/ich9.o
  CC    hw/acpi/tco.o
  CC    hw/acpi/cpu_hotplug.o
  CC    hw/acpi/memory_hotplug.o
  CC    hw/acpi/memory_hotplug_acpi_table.o
  CC    hw/acpi/cpu.o
  CC    hw/acpi/acpi_interface.o
  CC    hw/acpi/bios-linker-loader.o
  CC    hw/acpi/aml-build.o
  CC    hw/acpi/ipmi.o
  CC    hw/audio/es1370.o
  CC    hw/audio/sb16.o
  CC    hw/audio/ac97.o
  CC    hw/audio/fmopl.o
  CC    hw/audio/adlib.o
  CC    hw/audio/gus.o
  CC    hw/audio/gusemu_hal.o
  CC    hw/audio/gusemu_mixer.o
  CC    hw/audio/cs4231a.o
  CC    hw/audio/intel-hda.o
  CC    hw/audio/hda-codec.o
  CC    hw/audio/pcspk.o
  CC    hw/audio/wm8750.o
  CC    hw/audio/pl041.o
  CC    hw/audio/marvell_88w8618.o
  CC    hw/audio/lm4549.o
  CC    hw/block/block.o
  CC    hw/block/cdrom.o
  CC    hw/block/hd-geometry.o
  CC    hw/block/fdc.o
  CC    hw/block/m25p80.o
  CC    hw/block/nand.o
  CC    hw/block/pflash_cfi01.o
  CC    hw/block/pflash_cfi02.o
  CC    hw/block/ecc.o
  CC    hw/block/onenand.o
  CC    hw/block/nvme.o
  CC    hw/bt/core.o
  CC    hw/bt/l2cap.o
  CC    hw/bt/sdp.o
  CC    hw/bt/hci.o
  CC    hw/bt/hid.o
  CC    hw/bt/hci-csr.o
  CC    hw/char/ipoctal232.o
/tmp/qemu-test/src/qemu-io.c: In function ‘main’:
/tmp/qemu-test/src/qemu-io.c:491: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/qemu-io.c:491: warning: nested extern declaration of ‘error_report_exit’
  CC    hw/char/parallel.o
  CC    hw/char/pl011.o
  CC    hw/char/serial.o
  CC    hw/char/serial-isa.o
  CC    hw/char/serial-pci.o
  CC    hw/char/virtio-console.o
  CC    hw/char/cadence_uart.o
  CC    hw/char/debugcon.o
  CC    hw/char/imx_serial.o
  CC    hw/core/qdev.o
  CC    hw/core/qdev-properties.o

/tmp/qemu-test/src/device_tree.c: In function ‘create_device_tree’:
/tmp/qemu-test/src/device_tree.c:63: warning: implicit declaration of function ‘error_report_exit’ /tmp/qemu-test/src/device_tree.c:63: warning: nested extern declaration of ‘error_report_exit’ /tmp/qemu-test/src/device_tree.c:70: warning: control reaches end of non-void function

  CC    hw/core/bus.o
  CC    hw/core/fw-path-provider.o
  CC    hw/core/irq.o
  CC    hw/core/hotplug.o
  CC    hw/core/ptimer.o
  CC    hw/core/sysbus.o
  CC    hw/core/machine.o
  CC    hw/core/null-machine.o
  CC    hw/core/loader.o
  CC    hw/core/qdev-properties-system.o
  CC    hw/core/register.o
  CC    hw/core/platform-bus.o
  CC    hw/display/ads7846.o
  CC    hw/display/cirrus_vga.o
  CC    hw/display/pl110.o
  CC    hw/display/ssd0303.o
  CC    hw/display/ssd0323.o
  CC    hw/display/vga-pci.o
  CC    hw/display/vga-isa.o
  CC    hw/display/vmware_vga.o
  CC    hw/display/blizzard.o
  CC    hw/display/exynos4210_fimd.o
  CC    hw/display/framebuffer.o
  CC    hw/display/tc6393xb.o
  CC    hw/dma/pl080.o
  CC    hw/dma/pl330.o
  CC    hw/dma/i8257.o
  CC    hw/dma/xlnx-zynq-devcfg.o
  CC    hw/gpio/max7310.o
  CC    hw/gpio/pl061.o
  CC    hw/gpio/zaurus.o
  CC    hw/gpio/gpio_key.o
  CC    hw/i2c/core.o
  CC    hw/i2c/smbus.o
  CC    hw/i2c/smbus_eeprom.o
  CC    hw/i2c/i2c-ddc.o
  CC    hw/i2c/versatile_i2c.o
  CC    hw/i2c/smbus_ich9.o
  CC    hw/i2c/pm_smbus.o
  CC    hw/i2c/bitbang_i2c.o
  CC    hw/i2c/exynos4210_i2c.o
  CC    hw/i2c/imx_i2c.o
  CC    hw/i2c/aspeed_i2c.o
  CC    hw/ide/core.o
  CC    hw/ide/atapi.o
  CC    hw/ide/qdev.o
  CC    hw/ide/pci.o
  CC    hw/ide/isa.o
  CC    hw/ide/piix.o
  CC    hw/ide/microdrive.o
  CC    hw/ide/ahci.o
  CC    hw/ide/ich.o
  CC    hw/input/hid.o
  CC    hw/input/lm832x.o
  CC    hw/input/pckbd.o
  CC    hw/input/pl050.o
  CC    hw/input/ps2.o
  CC    hw/input/stellaris_input.o
  CC    hw/input/tsc2005.o
  CC    hw/input/vmmouse.o
  CC    hw/input/virtio-input.o
  CC    hw/input/virtio-input-hid.o
  CC    hw/input/virtio-input-host.o
  CC    hw/intc/i8259_common.o
  CC    hw/intc/i8259.o
  CC    hw/intc/pl190.o
  CC    hw/intc/imx_avic.o
  CC    hw/intc/realview_gic.o
  CC    hw/intc/ioapic_common.o
  CC    hw/intc/arm_gic_common.o
  CC    hw/intc/arm_gic.o
/tmp/qemu-test/src/hw/core/platform-bus.c: In function ‘platform_bus_map_irq’:
/tmp/qemu-test/src/hw/core/platform-bus.c:124: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/hw/core/platform-bus.c:124: warning: nested extern declaration of ‘error_report_exit’
  CC    hw/intc/arm_gicv2m.o
  CC    hw/intc/arm_gicv3_common.o
  CC    hw/intc/arm_gicv3.o
  CC    hw/intc/arm_gicv3_dist.o
  CC    hw/intc/arm_gicv3_redist.o
  CC    hw/ipack/ipack.o
  CC    hw/ipack/tpci200.o
  CC    hw/ipmi/ipmi.o
  CC    hw/ipmi/ipmi_bmc_sim.o
  CC    hw/ipmi/ipmi_bmc_extern.o
  CC    hw/ipmi/isa_ipmi_kcs.o
  CC    hw/ipmi/isa_ipmi_bt.o
  CC    hw/isa/isa-bus.o
  CC    hw/isa/apm.o
  CC    hw/mem/pc-dimm.o

/tmp/qemu-test/src/hw/core/machine.c: In function ‘error_on_sysbus_device’:
/tmp/qemu-test/src/hw/core/machine.c:337: warning: implicit declaration of function ‘error_report_exit’ /tmp/qemu-test/src/hw/core/machine.c:337: warning: nested extern declaration of ‘error_report_exit’ /tmp/qemu-test/src/hw/core/machine.c:339: warning: no return statement in function returning non-void

  CC    hw/mem/nvdimm.o
  CC    hw/misc/applesmc.o
  CC    hw/misc/max111x.o
  CC    hw/misc/tmp105.o
  CC    hw/misc/debugexit.o
  CC    hw/misc/sga.o
  CC    hw/misc/pc-testdev.o
  CC    hw/misc/arm_l2x0.o
  CC    hw/misc/pci-testdev.o
  CC    hw/misc/arm_integrator_debug.o
  CC    hw/misc/a9scu.o
  CC    hw/misc/arm11scu.o
  CC    hw/net/ne2000.o
  CC    hw/net/eepro100.o
  CC    hw/net/pcnet-pci.o
  CC    hw/net/pcnet.o
  CC    hw/net/e1000.o
  CC    hw/net/e1000x_common.o
  CC    hw/net/net_tx_pkt.o
  CC    hw/net/net_rx_pkt.o
  CC    hw/net/e1000e.o
  CC    hw/net/e1000e_core.o
  CC    hw/net/rtl8139.o
  CC    hw/net/vmxnet3.o
  CC    hw/net/smc91c111.o
  CC    hw/net/lan9118.o
  CC    hw/net/ne2000-isa.o
  CC    hw/net/xgmac.o
  CC    hw/net/allwinner_emac.o
  CC    hw/net/imx_fec.o
  CC    hw/net/cadence_gem.o
  CC    hw/net/stellaris_enet.o
  CC    hw/net/rocker/rocker.o
  CC    hw/net/rocker/rocker_fp.o
  CC    hw/net/rocker/rocker_desc.o
  CC    hw/net/rocker/rocker_world.o
  CC    hw/net/rocker/rocker_of_dpa.o
  CC    hw/nvram/eeprom93xx.o
  CC    hw/nvram/fw_cfg.o
  CC    hw/pci-bridge/pci_bridge_dev.o
  CC    hw/pci-bridge/pci_expander_bridge.o
  CC    hw/pci-bridge/xio3130_upstream.o
  CC    hw/pci-bridge/xio3130_downstream.o
  CC    hw/pci-bridge/ioh3420.o
  CC    hw/pci-bridge/i82801b11.o
  CC    hw/pci-host/pam.o
  CC    hw/pci-host/versatile.o
  CC    hw/pci-host/piix.o
  CC    hw/pci-host/q35.o
  CC    hw/pci-host/gpex.o
  CC    hw/pci/pci.o
  CC    hw/pci/pci_bridge.o
  CC    hw/pci/msix.o
  CC    hw/pci/msi.o

/tmp/qemu-test/src/vl.c: In function ‘configure_rtc’:
/tmp/qemu-test/src/vl.c:869: warning: implicit declaration of function ‘error_report_exit’ /tmp/qemu-test/src/vl.c:869: warning: nested extern declaration of ‘error_report_exit’ /tmp/qemu-test/src/vl.c: In function ‘mon_init_func’:
/tmp/qemu-test/src/vl.c:2330: warning: ‘flags’ may be used uninitialized in this function

  CC    hw/pci/shpc.o
  CC    hw/pci/slotid_cap.o
  CC    hw/pci/pci_host.o
  CC    hw/pci/pcie_host.o
  CC    hw/pci/pcie.o
  CC    hw/pci/pcie_aer.o
  CC    hw/pci/pcie_port.o
  CC    hw/pci/pci-stub.o
  CC    hw/pcmcia/pcmcia.o
  CC    hw/scsi/scsi-disk.o
  CC    hw/scsi/scsi-generic.o
  CC    hw/scsi/scsi-bus.o
  CC    hw/scsi/lsi53c895a.o
  CC    hw/scsi/mptsas.o
  CC    hw/scsi/mptconfig.o
  CC    hw/scsi/mptendian.o
  CC    hw/scsi/megasas.o
  CC    hw/scsi/vmw_pvscsi.o
  CC    hw/scsi/esp.o
  CC    hw/scsi/esp-pci.o
  CC    hw/sd/pl181.o
  CC    hw/sd/ssi-sd.o
  CC    hw/sd/sd.o
  CC    hw/sd/core.o
  CC    hw/sd/sdhci.o
  CC    hw/smbios/smbios.o
  CC    hw/smbios/smbios_type_38.o
  CC    hw/ssi/pl022.o
  CC    hw/ssi/ssi.o
  CC    hw/ssi/xilinx_spips.o
  CC    hw/ssi/aspeed_smc.o
  CC    hw/timer/arm_timer.o
  CC    hw/timer/arm_mptimer.o
  CC    hw/timer/a9gtimer.o
  CC    hw/timer/cadence_ttc.o
  CC    hw/timer/ds1338.o
  CC    hw/timer/hpet.o
  CC    hw/timer/i8254_common.o
  CC    hw/timer/i8254.o
  CC    hw/timer/pl031.o
  CC    hw/timer/twl92230.o
  CC    hw/timer/imx_epit.o
  CC    hw/timer/imx_gpt.o
  CC    hw/timer/stm32f2xx_timer.o
  CC    hw/timer/aspeed_timer.o
  CC    hw/tpm/tpm_tis.o
  CC    hw/tpm/tpm_passthrough.o
  CC    hw/tpm/tpm_util.o
  CC    hw/usb/core.o
  CC    hw/usb/combined-packet.o
  CC    hw/usb/bus.o
  CC    hw/usb/libhw.o
  CC    hw/usb/desc.o
  CC    hw/usb/desc-msos.o
  CC    hw/usb/hcd-uhci.o
  CC    hw/usb/hcd-ohci.o
/tmp/qemu-test/src/hw/ide/core.c: In function ‘ide_drive_get’:
/tmp/qemu-test/src/hw/ide/core.c:2854: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/hw/ide/core.c:2854: warning: nested extern declaration of ‘error_report_exit’
  CC    hw/usb/hcd-ehci.o
  CC    hw/usb/hcd-ehci-pci.o
  CC    hw/usb/hcd-ehci-sysbus.o
  CC    hw/usb/hcd-xhci.o
  CC    hw/usb/hcd-musb.o
  CC    hw/usb/dev-hub.o
  CC    hw/usb/dev-hid.o
  CC    hw/usb/dev-wacom.o
  CC    hw/usb/dev-storage.o
  CC    hw/usb/dev-uas.o
  CC    hw/usb/dev-audio.o
  CC    hw/usb/dev-serial.o
  CC    hw/usb/dev-network.o
  CC    hw/usb/dev-bluetooth.o
  CC    hw/usb/dev-smartcard-reader.o
  CC    hw/usb/dev-mtp.o
  CC    hw/usb/host-stub.o
  CC    hw/virtio/virtio-rng.o
  CC    hw/virtio/virtio-pci.o
  CC    hw/virtio/virtio-bus.o
  CC    hw/virtio/virtio-mmio.o
  CC    hw/watchdog/watchdog.o
  CC    hw/watchdog/wdt_i6300esb.o
  CC    hw/watchdog/wdt_ib700.o
  CC    migration/migration.o
  CC    migration/socket.o
  CC    migration/fd.o
  CC    migration/exec.o
  CC    migration/tls.o
  CC    migration/vmstate.o
  CC    migration/qemu-file.o
  CC    migration/qemu-file-channel.o
  CC    migration/xbzrle.o
  CC    migration/postcopy-ram.o
  CC    migration/qjson.o
  CC    migration/block.o
  CC    net/net.o
  CC    net/queue.o
  CC    net/checksum.o
  CC    net/util.o
  CC    net/hub.o
  CC    net/socket.o
  CC    net/dump.o
  CC    net/eth.o
  CC    net/l2tpv3.o
  CC    net/tap.o
  CC    net/vhost-user.o
  CC    net/tap-linux.o
  CC    net/slirp.o
/tmp/qemu-test/src/hw/smbios/smbios.c: In function ‘smbios_validate_table’:
/tmp/qemu-test/src/hw/smbios/smbios.c:333: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/hw/smbios/smbios.c:333: warning: nested extern declaration of ‘error_report_exit’
  CC    net/filter.o
  CC    net/filter-buffer.o
  CC    net/filter-mirror.o
  CC    qom/cpu.o
  CC    replay/replay.o
  CC    replay/replay-internal.o
  CC    replay/replay-events.o
  CC    replay/replay-time.o
  CC    replay/replay-input.o
  CC    replay/replay-char.o
  CC    slirp/cksum.o
  CC    slirp/if.o

/tmp/qemu-test/src/hw/nvram/fw_cfg.c: In function ‘fw_cfg_add_file_callback’:
/tmp/qemu-test/src/hw/nvram/fw_cfg.c:808: warning: implicit declaration of function ‘error_report_exit’ /tmp/qemu-test/src/hw/nvram/fw_cfg.c:808: warning: nested extern declaration of ‘error_report_exit’ /tmp/qemu-test/src/hw/nvram/fw_cfg.c: In function ‘fw_cfg_dma_transfer’:
/tmp/qemu-test/src/hw/nvram/fw_cfg.c:330: warning: ‘read’ may be used uninitialized in this function

  CC    slirp/ip_icmp.o
  CC    slirp/ip6_icmp.o
  CC    slirp/ip6_input.o
  CC    slirp/ip6_output.o
  CC    slirp/ip_input.o
  CC    slirp/ip_output.o
  CC    slirp/dnssearch.o
  CC    slirp/dhcpv6.o
  CC    slirp/slirp.o
  CC    slirp/mbuf.o
  CC    slirp/misc.o
  CC    slirp/sbuf.o
  CC    slirp/socket.o
  CC    slirp/tcp_input.o
  CC    slirp/tcp_output.o

/tmp/qemu-test/src/slirp/tcp_input.c: In function ‘tcp_input’:
/tmp/qemu-test/src/slirp/tcp_input.c:219: warning: ‘save_ip.ip_p’ may be used uninitialized in this function /tmp/qemu-test/src/slirp/tcp_input.c:219: warning: ‘save_ip.ip_len’ may be used uninitialized in this function /tmp/qemu-test/src/slirp/tcp_input.c:219: warning: ‘save_ip.ip_tos’ may be used uninitialized in this function /tmp/qemu-test/src/slirp/tcp_input.c:219: warning: ‘save_ip.ip_id’ may be used uninitialized in this function /tmp/qemu-test/src/slirp/tcp_input.c:219: warning: ‘save_ip.ip_off’ may be used uninitialized in this function /tmp/qemu-test/src/slirp/tcp_input.c:219: warning: ‘save_ip.ip_ttl’ may be used uninitialized in this function /tmp/qemu-test/src/slirp/tcp_input.c:219: warning: ‘save_ip.ip_sum’ may be used uninitialized in this function /tmp/qemu-test/src/slirp/tcp_input.c:219: warning: ‘save_ip.ip_src.s_addr’ may be used uninitialized in this function /tmp/qemu-test/src/slirp/tcp_input.c:219: warning: ‘save_ip.ip_dst.s_addr’ may be used uninitialized in this function /tmp/qemu-test/src/slirp/tcp_input.c:220: warning: ‘save_ip6.ip_nh’ may be used uninitialized in this function
CC slirp/tcp_subr.o
CC slirp/tcp_timer.o
/tmp/qemu-test/src/replay/replay-time.c: In function ‘replay_read_clock’:
/tmp/qemu-test/src/replay/replay-time.c:63: warning: implicit declaration of function ‘error_report_exit’ /tmp/qemu-test/src/replay/replay-time.c:63: warning: nested extern declaration of ‘error_report_exit’ /tmp/qemu-test/src/replay/replay-time.c:64: warning: control reaches end of non-void function

  CC    slirp/udp.o
  CC    slirp/udp6.o
  CC    slirp/bootp.o

/tmp/qemu-test/src/hw/pci/pci.c: In function ‘pci_nic_init_nofail’:
/tmp/qemu-test/src/hw/pci/pci.c:1800: warning: implicit declaration of function ‘error_report_exit’ /tmp/qemu-test/src/hw/pci/pci.c:1800: warning: nested extern declaration of ‘error_report_exit’ /tmp/qemu-test/src/hw/pci/pci.c:1786: warning: ‘devfn’ may be used uninitialized in this function /tmp/qemu-test/src/replay/replay.c: In function ‘replay_configure’:
/tmp/qemu-test/src/replay/replay.c:284: warning: implicit declaration of function ‘error_report_exit’ /tmp/qemu-test/src/replay/replay.c:284: warning: nested extern declaration of ‘error_report_exit’

  CC    slirp/tftp.o
  CC    slirp/arp_table.o
  CC    slirp/ndp_table.o
  CC    ui/keymaps.o
  CC    ui/console.o

/tmp/qemu-test/src/replay/replay-internal.c: In function ‘replay_put_array’:
/tmp/qemu-test/src/replay/replay-internal.c:68: warning: ignoring return value of ‘fwrite’, declared with attribute warn_unused_result /tmp/qemu-test/src/replay/replay-internal.c: In function ‘replay_fetch_data_kind’:
/tmp/qemu-test/src/replay/replay-internal.c:161: warning: implicit declaration of function ‘error_report_exit’ /tmp/qemu-test/src/replay/replay-internal.c:161: warning: nested extern declaration of ‘error_report_exit’

  CC    ui/cursor.o
  CC    ui/qemu-pixman.o
  CC    ui/input-keymap.o
  CC    ui/input.o
  CC    ui/input-legacy.o
  CC    ui/input-linux.o
  CC    ui/sdl.o
  CC    ui/sdl_zoom.o
  CC    ui/x_keymap.o
  CC    ui/vnc.o
  CC    ui/vnc-enc-zlib.o
  CC    ui/vnc-enc-hextile.o
  CC    ui/vnc-enc-tight.o
  CC    ui/vnc-palette.o
  CC    ui/vnc-auth-vencrypt.o
  CC    ui/vnc-enc-zrle.o

/tmp/qemu-test/src/replay/replay-char.c: In function ‘replay_char_write_event_load’:
/tmp/qemu-test/src/replay/replay-char.c:118: warning: implicit declaration of function ‘error_report_exit’ /tmp/qemu-test/src/replay/replay-char.c:118: warning: nested extern declaration of ‘error_report_exit’ /tmp/qemu-test/src/replay/replay-char.c: In function ‘replay_char_read_all_load’:
/tmp/qemu-test/src/replay/replay-char.c:143: warning: control reaches end of non-void function

  CC    ui/vnc-ws.o
  CC    ui/vnc-jobs.o
  LINK  tests/qemu-iotests/socket_scm_helper
/tmp/qemu-test/src/replay/replay-events.c: In function ‘replay_run_event’:
/tmp/qemu-test/src/replay/replay-events.c:58: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/replay/replay-events.c:58: warning: nested extern declaration of ‘error_report_exit’
  CC    qga/commands.o
  CC    qga/guest-agent-command-state.o
  CC    qga/main.o
  CC    qga/commands-posix.o
  CC    qga/channel-posix.o
  CC    qga/qapi-generated/qga-qapi-types.o
  CC    qga/qapi-generated/qga-qapi-visit.o
  CC    qga/qapi-generated/qga-qmp-marshal.o
  CC    qmp-introspect.o
  CC    qapi-visit.o
  CC    qapi-types.o
  CC    qapi-event.o
  AR    libqemustub.a
  CC    qemu-img.o
  CC    qmp-marshal.o
  AS    optionrom/multiboot.o
  AS    optionrom/linuxboot.o
  CC    optionrom/linuxboot_dma.o
  CC    trace/generated-events.o

cc: unrecognized option '-no-integrated-as'
cc: unrecognized option '-no-integrated-as'
AS optionrom/kvmvapic.o
Building optionrom/linuxboot.img
Building optionrom/linuxboot_dma.img
Building optionrom/linuxboot.raw
Building optionrom/linuxboot_dma.raw
Signing optionrom/linuxboot.bin
Signing optionrom/linuxboot_dma.bin
Building optionrom/multiboot.img
Building optionrom/multiboot.raw
Signing optionrom/multiboot.bin
AR libqemuutil.a
Building optionrom/kvmvapic.img
Building optionrom/kvmvapic.raw
Signing optionrom/kvmvapic.bin

  LINK  qemu-ga
  LINK  ivshmem-client
  LINK  ivshmem-server
  LINK  qemu-nbd
  LINK  qemu-io
  LINK  qemu-bridge-helper

libqemuutil.a(control.o): In function `trace_init_events':
/tmp/qemu-test/src/trace/control.c:210: undefined reference to error_report_exit' /tmp/qemu-test/src/trace/control.c:195: undefined reference to error_report_exit'
collect2: ld returned 1 exit status
make: *** [ivshmem-server] Error 1
make: *** Waiting for unfinished jobs....
libqemuutil.a(control.o): In function `trace_init_events':
/tmp/qemu-test/src/trace/control.c:210: undefined reference to error_report_exit' /tmp/qemu-test/src/trace/control.c:195: undefined reference to error_report_exit'
collect2: ld returned 1 exit status
make: *** [qemu-ga] Error 1
qemu-io.o: In function `main':
/tmp/qemu-test/src/qemu-io.c:491: undefined reference to error_report_exit' /tmp/qemu-test/src/qemu-io.c:511: undefined reference to error_report_exit' /tmp/qemu-test/src/qemu-io.c:547: undefined reference to error_report_exit' libqemuutil.a(control.o): In function trace_init_events':
/tmp/qemu-test/src/trace/control.c:210: undefined reference to error_report_exit' /tmp/qemu-test/src/trace/control.c:195: undefined reference to error_report_exit'
collect2: ld returned 1 exit status
make: *** [qemu-io] Error 1
qemu-nbd.o: In function `main':
/tmp/qemu-test/src/qemu-nbd.c:682: undefined reference to error_report_exit' /tmp/qemu-test/src/qemu-nbd.c:594: undefined reference to error_report_exit' /tmp/qemu-test/src/qemu-nbd.c:577: undefined reference to error_report_exit' /tmp/qemu-test/src/qemu-nbd.c:568: undefined reference to error_report_exit' /tmp/qemu-test/src/qemu-nbd.c:611: undefined reference to error_report_exit' qemu-nbd.o:/tmp/qemu-test/src/qemu-nbd.c:555: more undefined references to error_report_exit' follow
collect2: ld returned 1 exit status
make: *** [qemu-nbd] Error 1
/tmp/qemu-test/src/qemu-img.c: In function ‘dump_map_entry’:
/tmp/qemu-test/src/qemu-img.c:2418: warning: implicit declaration of function ‘error_report_exit’ /tmp/qemu-test/src/qemu-img.c:2418: warning: nested extern declaration of ‘error_report_exit’

  GEN   x86_64-softmmu/hmp-commands.h
  GEN   x86_64-softmmu/hmp-commands-info.h
  GEN   x86_64-softmmu/qmp-commands-old.h
  GEN   x86_64-softmmu/config-target.h
  GEN   aarch64-softmmu/hmp-commands.h
  GEN   aarch64-softmmu/hmp-commands-info.h
  GEN   aarch64-softmmu/qmp-commands-old.h
  GEN   aarch64-softmmu/config-target.h
  CC    x86_64-softmmu/exec.o
  CC    x86_64-softmmu/translate-all.o
  CC    x86_64-softmmu/cpu-exec.o
  CC    x86_64-softmmu/translate-common.o
  CC    x86_64-softmmu/cpu-exec-common.o
  CC    x86_64-softmmu/tcg/tcg.o
  CC    x86_64-softmmu/tcg/tcg-op.o
  CC    x86_64-softmmu/tcg/optimize.o
  CC    x86_64-softmmu/tcg/tcg-common.o
  CC    x86_64-softmmu/fpu/softfloat.o
  CC    x86_64-softmmu/disas.o
  CC    x86_64-softmmu/arch_init.o
  CC    x86_64-softmmu/cpus.o
  CC    x86_64-softmmu/monitor.o
  CC    x86_64-softmmu/gdbstub.o
  CC    x86_64-softmmu/balloon.o
  CC    x86_64-softmmu/ioport.o
  CC    x86_64-softmmu/numa.o
  CC    x86_64-softmmu/qtest.o
  CC    x86_64-softmmu/bootdevice.o
  CC    x86_64-softmmu/kvm-all.o
  CC    x86_64-softmmu/memory.o
  CC    x86_64-softmmu/cputlb.o
  CC    aarch64-softmmu/exec.o
  CC    x86_64-softmmu/memory_mapping.o
  CC    x86_64-softmmu/dump.o
  CC    x86_64-softmmu/migration/ram.o
  CC    x86_64-softmmu/migration/savevm.o
  CC    aarch64-softmmu/translate-all.o
  CC    aarch64-softmmu/cpu-exec.o
  CC    x86_64-softmmu/xen-common-stub.o
  CC    aarch64-softmmu/translate-common.o
  CC    x86_64-softmmu/xen-hvm-stub.o
  CC    aarch64-softmmu/cpu-exec-common.o
  CC    x86_64-softmmu/hw/acpi/nvdimm.o
  CC    aarch64-softmmu/tcg/tcg.o
  CC    x86_64-softmmu/hw/block/virtio-blk.o
  CC    aarch64-softmmu/tcg/tcg-op.o
  CC    x86_64-softmmu/hw/block/dataplane/virtio-blk.o
  CC    aarch64-softmmu/tcg/optimize.o
  CC    aarch64-softmmu/tcg/tcg-common.o
  CC    aarch64-softmmu/fpu/softfloat.o
  CC    x86_64-softmmu/hw/char/virtio-serial-bus.o
  CC    x86_64-softmmu/hw/core/nmi.o
  CC    aarch64-softmmu/disas.o
  CC    x86_64-softmmu/hw/cpu/core.o
  GEN   aarch64-softmmu/gdbstub-xml.c
  CC    aarch64-softmmu/kvm-stub.o
  CC    aarch64-softmmu/arch_init.o
  CC    x86_64-softmmu/hw/display/vga.o
  CC    aarch64-softmmu/cpus.o

/tmp/qemu-test/src/bootdevice.c: In function ‘add_boot_device_path’:
/tmp/qemu-test/src/bootdevice.c:175: warning: implicit declaration of function ‘error_report_exit’ /tmp/qemu-test/src/bootdevice.c:175: warning: nested extern declaration of ‘error_report_exit’ /tmp/qemu-test/src/arch_init.c: In function ‘audio_init’:
/tmp/qemu-test/src/arch_init.c:223: warning: implicit declaration of function ‘error_report_exit’ /tmp/qemu-test/src/arch_init.c:223: warning: nested extern declaration of ‘error_report_exit’

  CC    x86_64-softmmu/hw/display/virtio-gpu.o
  CC    x86_64-softmmu/hw/display/virtio-gpu-3d.o
  CC    aarch64-softmmu/monitor.o
  CC    x86_64-softmmu/hw/display/virtio-gpu-pci.o
  CC    aarch64-softmmu/gdbstub.o
  CC    x86_64-softmmu/hw/display/virtio-vga.o
  CC    aarch64-softmmu/balloon.o
  CC    x86_64-softmmu/hw/intc/apic.o
  CC    x86_64-softmmu/hw/intc/apic_common.o
  CC    aarch64-softmmu/ioport.o
  CC    aarch64-softmmu/numa.o
  CC    x86_64-softmmu/hw/intc/ioapic.o
  CC    aarch64-softmmu/qtest.o
/tmp/qemu-test/src/numa.c: In function ‘validate_numa_cpus’:
/tmp/qemu-test/src/numa.c:277: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/numa.c:277: warning: nested extern declaration of ‘error_report_exit’
  CC    x86_64-softmmu/hw/isa/lpc_ich9.o
  CC    aarch64-softmmu/bootdevice.o
  CC    aarch64-softmmu/memory.o
  CC    aarch64-softmmu/cputlb.o
  CC    aarch64-softmmu/memory_mapping.o
/tmp/qemu-test/src/cpus.c: In function ‘qemu_kvm_destroy_vcpu’:
/tmp/qemu-test/src/cpus.c:978: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/cpus.c:978: warning: nested extern declaration of ‘error_report_exit’
  CC    x86_64-softmmu/hw/misc/vmport.o
  CC    aarch64-softmmu/dump.o
  CC    aarch64-softmmu/migration/ram.o
  CC    aarch64-softmmu/migration/savevm.o
  CC    aarch64-softmmu/xen-common-stub.o
  CC    x86_64-softmmu/hw/misc/ivshmem.o
  CC    x86_64-softmmu/hw/misc/pvpanic.o
  CC    x86_64-softmmu/hw/misc/edu.o
  CC    aarch64-softmmu/xen-hvm-stub.o
  CC    aarch64-softmmu/hw/block/virtio-blk.o
/tmp/qemu-test/src/arch_init.c: In function ‘audio_init’:
/tmp/qemu-test/src/arch_init.c:223: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/arch_init.c:223: warning: nested extern declaration of ‘error_report_exit’
  CC    aarch64-softmmu/hw/block/dataplane/virtio-blk.o
  CC    aarch64-softmmu/hw/char/exynos4210_uart.o
  CC    aarch64-softmmu/hw/char/omap_uart.o
  CC    aarch64-softmmu/hw/char/digic-uart.o
  CC    x86_64-softmmu/hw/misc/hyperv_testdev.o
  CC    x86_64-softmmu/hw/net/virtio-net.o
/tmp/qemu-test/src/numa.c: In function ‘validate_numa_cpus’:
/tmp/qemu-test/src/numa.c:277: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/numa.c:277: warning: nested extern declaration of ‘error_report_exit’
  CC    aarch64-softmmu/hw/char/stm32f2xx_usart.o
  CC    aarch64-softmmu/hw/char/bcm2835_aux.o
  CC    aarch64-softmmu/hw/char/virtio-serial-bus.o

/tmp/qemu-test/src/bootdevice.c: In function ‘add_boot_device_path’:
/tmp/qemu-test/src/bootdevice.c:175: warning: implicit declaration of function ‘error_report_exit’ /tmp/qemu-test/src/bootdevice.c:175: warning: nested extern declaration of ‘error_report_exit’
CC aarch64-softmmu/hw/core/nmi.o
/tmp/qemu-test/src/hw/intc/ioapic.c: In function ‘ioapic_realize’:
/tmp/qemu-test/src/hw/intc/ioapic.c:403: warning: implicit declaration of function ‘error_report_exit’ /tmp/qemu-test/src/hw/intc/ioapic.c:403: warning: nested extern declaration of ‘error_report_exit’

  CC    x86_64-softmmu/hw/net/vhost_net.o
  CC    aarch64-softmmu/hw/cpu/arm11mpcore.o
  CC    aarch64-softmmu/hw/cpu/realview_mpcore.o
  CC    aarch64-softmmu/hw/cpu/a9mpcore.o
  CC    aarch64-softmmu/hw/cpu/a15mpcore.o
  CC    aarch64-softmmu/hw/cpu/core.o
  CC    aarch64-softmmu/hw/display/omap_dss.o
/tmp/qemu-test/src/cpus.c: In function ‘qemu_kvm_destroy_vcpu’:
/tmp/qemu-test/src/cpus.c:978: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/cpus.c:978: warning: nested extern declaration of ‘error_report_exit’
  CC    aarch64-softmmu/hw/display/omap_lcdc.o
  CC    aarch64-softmmu/hw/display/pxa2xx_lcd.o
  CC    x86_64-softmmu/hw/scsi/virtio-scsi.o
  CC    x86_64-softmmu/hw/scsi/virtio-scsi-dataplane.o
/tmp/qemu-test/src/hw/block/virtio-blk.c: In function ‘virtio_blk_handle_request’:
/tmp/qemu-test/src/hw/block/virtio-blk.c:480: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/hw/block/virtio-blk.c:480: warning: nested extern declaration of ‘error_report_exit’
  CC    aarch64-softmmu/hw/display/bcm2835_fb.o
  CC    aarch64-softmmu/hw/display/vga.o
  CC    aarch64-softmmu/hw/display/virtio-gpu.o
  CC    x86_64-softmmu/hw/scsi/vhost-scsi.o
  CC    aarch64-softmmu/hw/display/virtio-gpu-3d.o
  CC    aarch64-softmmu/hw/display/virtio-gpu-pci.o
  CC    x86_64-softmmu/hw/timer/mc146818rtc.o
/tmp/qemu-test/src/hw/char/exynos4210_uart.c: In function ‘exynos4210_uart_create’:
/tmp/qemu-test/src/hw/char/exynos4210_uart.c:600: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/hw/char/exynos4210_uart.c:600: warning: nested extern declaration of ‘error_report_exit’
  CC    x86_64-softmmu/hw/vfio/common.o
  CC    x86_64-softmmu/hw/vfio/pci.o
  CC    x86_64-softmmu/hw/vfio/pci-quirks.o
  CC    x86_64-softmmu/hw/vfio/platform.o
  CC    x86_64-softmmu/hw/vfio/calxeda-xgmac.o
  CC    x86_64-softmmu/hw/vfio/amd-xgbe.o
  CC    x86_64-softmmu/hw/vfio/spapr.o
  CC    aarch64-softmmu/hw/display/dpcd.o
  CC    aarch64-softmmu/hw/display/xlnx_dp.o
  CC    aarch64-softmmu/hw/dma/xlnx_dpdma.o
  CC    x86_64-softmmu/hw/virtio/virtio.o
  CC    x86_64-softmmu/hw/virtio/virtio-balloon.o
  CC    x86_64-softmmu/hw/virtio/vhost.o
  CC    aarch64-softmmu/hw/dma/omap_dma.o
  CC    aarch64-softmmu/hw/dma/soc_dma.o
  CC    x86_64-softmmu/hw/virtio/vhost-backend.o
  CC    x86_64-softmmu/hw/virtio/vhost-user.o
  CC    x86_64-softmmu/hw/i386/multiboot.o
  CC    x86_64-softmmu/hw/i386/pc.o
  CC    x86_64-softmmu/hw/i386/pc_piix.o
  CC    x86_64-softmmu/hw/i386/pc_q35.o
  CC    x86_64-softmmu/hw/i386/pc_sysfw.o
  CC    x86_64-softmmu/hw/i386/x86-iommu.o
/tmp/qemu-test/src/hw/scsi/vhost-scsi.c: In function ‘vhost_scsi_set_config’:
/tmp/qemu-test/src/hw/scsi/vhost-scsi.c:174: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/hw/scsi/vhost-scsi.c:174: warning: nested extern declaration of ‘error_report_exit’
  CC    aarch64-softmmu/hw/dma/pxa2xx_dma.o
  CC    aarch64-softmmu/hw/dma/bcm2835_dma.o
  CC    aarch64-softmmu/hw/gpio/omap_gpio.o
  CC    aarch64-softmmu/hw/gpio/imx_gpio.o
/tmp/qemu-test/src/hw/net/virtio-net.c: In function ‘virtio_net_handle_ctrl’:
/tmp/qemu-test/src/hw/net/virtio-net.c:895: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/hw/net/virtio-net.c:895: warning: nested extern declaration of ‘error_report_exit’
  CC    aarch64-softmmu/hw/i2c/omap_i2c.o
  CC    aarch64-softmmu/hw/input/pxa2xx_keypad.o
  CC    aarch64-softmmu/hw/input/tsc210x.o
/tmp/qemu-test/src/hw/scsi/virtio-scsi.c: In function ‘virtio_scsi_bad_req’:
/tmp/qemu-test/src/hw/scsi/virtio-scsi.c:86: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/hw/scsi/virtio-scsi.c:86: warning: nested extern declaration of ‘error_report_exit’
  CC    x86_64-softmmu/hw/i386/intel_iommu.o
  CC    aarch64-softmmu/hw/intc/armv7m_nvic.o
  CC    x86_64-softmmu/hw/i386/kvmvapic.o
  CC    aarch64-softmmu/hw/intc/exynos4210_gic.o
  CC    aarch64-softmmu/hw/intc/exynos4210_combiner.o
  CC    aarch64-softmmu/hw/intc/omap_intc.o
  CC    aarch64-softmmu/hw/intc/bcm2835_ic.o
  CC    aarch64-softmmu/hw/intc/bcm2836_control.o
  CC    aarch64-softmmu/hw/intc/allwinner-a10-pic.o
  CC    aarch64-softmmu/hw/intc/aspeed_vic.o
  CC    aarch64-softmmu/hw/intc/arm_gicv3_cpuif.o
/tmp/qemu-test/src/hw/block/virtio-blk.c: In function ‘virtio_blk_handle_request’:
/tmp/qemu-test/src/hw/block/virtio-blk.c:480: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/hw/block/virtio-blk.c:480: warning: nested extern declaration of ‘error_report_exit’
  CC    aarch64-softmmu/hw/misc/ivshmem.o
  CC    x86_64-softmmu/hw/i386/acpi-build.o
  CC    aarch64-softmmu/hw/misc/arm_sysctl.o
  CC    x86_64-softmmu/hw/i386/pci-assign-load-rom.o
/tmp/qemu-test/src/hw/i386/acpi-build.c: In function ‘build_append_pci_bus_devices’:
/tmp/qemu-test/src/hw/i386/acpi-build.c:471: warning: ‘notify_method’ may be used uninitialized in this function
  CC    aarch64-softmmu/hw/misc/cbus.o
  CC    aarch64-softmmu/hw/misc/exynos4210_pmu.o
  CC    x86_64-softmmu/hw/i386/kvm/clock.o
  CC    aarch64-softmmu/hw/misc/imx_ccm.o
  CC    x86_64-softmmu/hw/i386/kvm/apic.o
  CC    aarch64-softmmu/hw/misc/imx31_ccm.o
  CC    aarch64-softmmu/hw/misc/imx25_ccm.o
  CC    x86_64-softmmu/hw/i386/kvm/i8259.o
  CC    x86_64-softmmu/hw/i386/kvm/ioapic.o
  CC    aarch64-softmmu/hw/misc/imx6_ccm.o
  CC    x86_64-softmmu/hw/i386/kvm/i8254.o
  CC    x86_64-softmmu/hw/i386/kvm/pci-assign.o
  CC    aarch64-softmmu/hw/misc/imx6_src.o
  CC    x86_64-softmmu/target-i386/translate.o
  CC    x86_64-softmmu/target-i386/helper.o
/tmp/qemu-test/src/hw/i386/x86-iommu.c: In function ‘x86_iommu_set_default’:
/tmp/qemu-test/src/hw/i386/x86-iommu.c:61: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/hw/i386/x86-iommu.c:61: warning: nested extern declaration of ‘error_report_exit’
  CC    x86_64-softmmu/target-i386/cpu.o
  CC    aarch64-softmmu/hw/misc/mst_fpga.o
  CC    x86_64-softmmu/target-i386/bpt_helper.o
  CC    aarch64-softmmu/hw/misc/omap_clk.o
  CC    aarch64-softmmu/hw/misc/omap_gpmc.o
  CC    aarch64-softmmu/hw/misc/omap_l4.o
  CC    x86_64-softmmu/target-i386/excp_helper.o
  CC    x86_64-softmmu/target-i386/fpu_helper.o
  CC    aarch64-softmmu/hw/misc/omap_sdrc.o
  CC    aarch64-softmmu/hw/misc/omap_tap.o
  CC    aarch64-softmmu/hw/misc/bcm2835_mbox.o
  CC    x86_64-softmmu/target-i386/cc_helper.o
  CC    x86_64-softmmu/target-i386/int_helper.o
  CC    aarch64-softmmu/hw/misc/bcm2835_property.o
/tmp/qemu-test/src/hw/i386/pc.c: In function ‘pc_cpus_init’:
/tmp/qemu-test/src/hw/i386/pc.c:1171: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/hw/i386/pc.c:1171: warning: nested extern declaration of ‘error_report_exit’
  CC    aarch64-softmmu/hw/misc/zynq_slcr.o
  CC    x86_64-softmmu/target-i386/svm_helper.o
  CC    x86_64-softmmu/target-i386/smm_helper.o
  CC    aarch64-softmmu/hw/misc/zynq-xadc.o
  CC    x86_64-softmmu/target-i386/misc_helper.o
  CC    x86_64-softmmu/target-i386/mem_helper.o
  CC    aarch64-softmmu/hw/misc/stm32f2xx_syscfg.o
  CC    x86_64-softmmu/target-i386/seg_helper.o
/tmp/qemu-test/src/hw/i386/pc_piix.c: In function ‘igd_passthrough_isa_bridge_create’:
/tmp/qemu-test/src/hw/i386/pc_piix.c:1036: warning: ‘pch_rev_id’ may be used uninitialized in this function
  CC    aarch64-softmmu/hw/misc/edu.o
  CC    aarch64-softmmu/hw/misc/auxbus.o
  CC    x86_64-softmmu/target-i386/mpx_helper.o
  CC    x86_64-softmmu/target-i386/gdbstub.o
  CC    x86_64-softmmu/target-i386/machine.o
  CC    aarch64-softmmu/hw/misc/aspeed_scu.o
  CC    aarch64-softmmu/hw/net/virtio-net.o
  CC    aarch64-softmmu/hw/net/vhost_net.o
  CC    aarch64-softmmu/hw/pcmcia/pxa2xx.o
  CC    x86_64-softmmu/target-i386/arch_memory_mapping.o
  CC    x86_64-softmmu/target-i386/arch_dump.o
  CC    x86_64-softmmu/target-i386/monitor.o
  CC    aarch64-softmmu/hw/scsi/virtio-scsi.o
  CC    x86_64-softmmu/target-i386/kvm.o
  CC    aarch64-softmmu/hw/scsi/virtio-scsi-dataplane.o
  CC    aarch64-softmmu/hw/scsi/vhost-scsi.o
/tmp/qemu-test/src/hw/i386/intel_iommu.c: In function ‘vtd_realize’:
/tmp/qemu-test/src/hw/i386/intel_iommu.c:2474: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/hw/i386/intel_iommu.c:2474: warning: nested extern declaration of ‘error_report_exit’
  CC    aarch64-softmmu/hw/sd/omap_mmc.o
  CC    aarch64-softmmu/hw/sd/pxa2xx_mmci.o
  CC    aarch64-softmmu/hw/ssi/omap_spi.o
/tmp/qemu-test/src/hw/virtio/virtio.c: In function ‘virtqueue_num_heads’:
/tmp/qemu-test/src/hw/virtio/virtio.c:317: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/hw/virtio/virtio.c:317: warning: nested extern declaration of ‘error_report_exit’
  CC    aarch64-softmmu/hw/ssi/imx_spi.o
  CC    aarch64-softmmu/hw/timer/exynos4210_mct.o
  CC    aarch64-softmmu/hw/timer/exynos4210_pwm.o
  CC    aarch64-softmmu/hw/timer/exynos4210_rtc.o
  CC    aarch64-softmmu/hw/timer/omap_gptimer.o
  CC    aarch64-softmmu/hw/timer/omap_synctimer.o
  CC    x86_64-softmmu/target-i386/hyperv.o
  CC    aarch64-softmmu/hw/timer/pxa2xx_timer.o
  CC    aarch64-softmmu/hw/timer/digic-timer.o
  CC    aarch64-softmmu/hw/timer/allwinner-a10-pit.o
  CC    aarch64-softmmu/hw/usb/tusb6010.o
  GEN   trace/generated-helpers.c
  CC    aarch64-softmmu/hw/vfio/common.o
  CC    x86_64-softmmu/trace/control-target.o
  CC    aarch64-softmmu/hw/vfio/pci.o
  CC    aarch64-softmmu/hw/vfio/pci-quirks.o
  CC    aarch64-softmmu/hw/vfio/platform.o
  CC    aarch64-softmmu/hw/vfio/calxeda-xgmac.o
  CC    aarch64-softmmu/hw/vfio/amd-xgbe.o
  CC    aarch64-softmmu/hw/vfio/spapr.o
  CC    aarch64-softmmu/hw/virtio/virtio.o
  CC    aarch64-softmmu/hw/virtio/virtio-balloon.o
  CC    aarch64-softmmu/hw/virtio/vhost.o
  CC    aarch64-softmmu/hw/virtio/vhost-backend.o
  CC    aarch64-softmmu/hw/virtio/vhost-user.o
  CC    aarch64-softmmu/hw/arm/boot.o
  CC    aarch64-softmmu/hw/arm/collie.o
/tmp/qemu-test/src/hw/scsi/vhost-scsi.c: In function ‘vhost_scsi_set_config’:
/tmp/qemu-test/src/hw/scsi/vhost-scsi.c:174: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/hw/scsi/vhost-scsi.c:174: warning: nested extern declaration of ‘error_report_exit’
  CC    aarch64-softmmu/hw/arm/exynos4_boards.o
  CC    aarch64-softmmu/hw/arm/gumstix.o
  CC    x86_64-softmmu/trace/generated-helpers.o
  CC    aarch64-softmmu/hw/arm/highbank.o
  CC    aarch64-softmmu/hw/arm/digic_boards.o
  CC    aarch64-softmmu/hw/arm/integratorcp.o
  CC    aarch64-softmmu/hw/arm/mainstone.o
  CC    aarch64-softmmu/hw/arm/musicpal.o
  CC    aarch64-softmmu/hw/arm/nseries.o
  CC    aarch64-softmmu/hw/arm/omap_sx1.o
  CC    aarch64-softmmu/hw/arm/palm.o
/tmp/qemu-test/src/hw/scsi/virtio-scsi.c: In function ‘virtio_scsi_bad_req’:
/tmp/qemu-test/src/hw/scsi/virtio-scsi.c:86: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/hw/scsi/virtio-scsi.c:86: warning: nested extern declaration of ‘error_report_exit’
  CC    aarch64-softmmu/hw/arm/realview.o
  CC    aarch64-softmmu/hw/arm/spitz.o
  CC    aarch64-softmmu/hw/arm/stellaris.o
  CC    aarch64-softmmu/hw/arm/tosa.o
  CC    aarch64-softmmu/hw/arm/versatilepb.o
  CC    aarch64-softmmu/hw/arm/vexpress.o
  CC    aarch64-softmmu/hw/arm/virt.o
  CC    aarch64-softmmu/hw/arm/xilinx_zynq.o
  CC    aarch64-softmmu/hw/arm/z2.o
  CC    aarch64-softmmu/hw/arm/virt-acpi-build.o
  CC    aarch64-softmmu/hw/arm/netduino2.o

/tmp/qemu-test/src/hw/net/virtio-net.c: In function ‘virtio_net_handle_ctrl’:
/tmp/qemu-test/src/hw/net/virtio-net.c:895: warning: implicit declaration of function ‘error_report_exit’ /tmp/qemu-test/src/hw/net/virtio-net.c:895: warning: nested extern declaration of ‘error_report_exit’
CC aarch64-softmmu/hw/arm/sysbus-fdt.o
CC aarch64-softmmu/hw/arm/armv7m.o
/tmp/qemu-test/src/hw/arm/digic_boards.c: In function ‘digic_load_rom’:
/tmp/qemu-test/src/hw/arm/digic_boards.c:109: warning: implicit declaration of function ‘error_report_exit’ /tmp/qemu-test/src/hw/arm/digic_boards.c:109: warning: nested extern declaration of ‘error_report_exit’

  CC    aarch64-softmmu/hw/arm/exynos4210.o
  CC    aarch64-softmmu/hw/arm/pxa2xx.o
  CC    aarch64-softmmu/hw/arm/pxa2xx_gpio.o
  CC    aarch64-softmmu/hw/arm/pxa2xx_pic.o
/tmp/qemu-test/src/hw/arm/highbank.c: In function ‘calxeda_init’:
/tmp/qemu-test/src/hw/arm/highbank.c:286: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/hw/arm/highbank.c:286: warning: nested extern declaration of ‘error_report_exit’
  CC    aarch64-softmmu/hw/arm/digic.o
  CC    aarch64-softmmu/hw/arm/omap1.o
  CC    aarch64-softmmu/hw/arm/omap2.o
  CC    aarch64-softmmu/hw/arm/strongarm.o
  CC    aarch64-softmmu/hw/arm/allwinner-a10.o
  CC    aarch64-softmmu/hw/arm/cubieboard.o
/tmp/qemu-test/src/hw/arm/vexpress.c: In function ‘vexpress_common_init’:
/tmp/qemu-test/src/hw/arm/vexpress.c:571: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/hw/arm/vexpress.c:571: warning: nested extern declaration of ‘error_report_exit’
  CC    aarch64-softmmu/hw/arm/bcm2835_peripherals.o
  CC    aarch64-softmmu/hw/arm/bcm2836.o
  CC    aarch64-softmmu/hw/arm/raspi.o
  CC    aarch64-softmmu/hw/arm/stm32f205_soc.o
/tmp/qemu-test/src/hw/arm/armv7m.c: In function ‘armv7m_init’:
/tmp/qemu-test/src/hw/arm/armv7m.c:223: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/hw/arm/armv7m.c:223: warning: nested extern declaration of ‘error_report_exit’
  CC    aarch64-softmmu/hw/arm/xlnx-zynqmp.o
  CC    aarch64-softmmu/hw/arm/xlnx-ep108.o
  CC    aarch64-softmmu/hw/arm/fsl-imx25.o
  CC    aarch64-softmmu/hw/arm/imx25_pdk.o
/tmp/qemu-test/src/hw/virtio/virtio.c: In function ‘virtqueue_num_heads’:
/tmp/qemu-test/src/hw/virtio/virtio.c:317: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/hw/virtio/virtio.c:317: warning: nested extern declaration of ‘error_report_exit’
  CC    aarch64-softmmu/hw/arm/fsl-imx31.o
  CC    aarch64-softmmu/hw/arm/kzm.o
  CC    aarch64-softmmu/hw/arm/fsl-imx6.o

/tmp/qemu-test/src/hw/arm/sysbus-fdt.c: In function ‘add_fdt_node’:
/tmp/qemu-test/src/hw/arm/sysbus-fdt.c:451: warning: implicit declaration of function ‘error_report_exit’ /tmp/qemu-test/src/hw/arm/sysbus-fdt.c:451: warning: nested extern declaration of ‘error_report_exit’ /tmp/qemu-test/src/hw/arm/sysbus-fdt.c:453: warning: control reaches end of non-void function

  CC    aarch64-softmmu/hw/arm/sabrelite.o
  CC    aarch64-softmmu/hw/arm/ast2400.o
  CC    aarch64-softmmu/hw/arm/palmetto-bmc.o
  CC    aarch64-softmmu/target-arm/arm-semi.o
  CC    aarch64-softmmu/target-arm/machine.o

/tmp/qemu-test/src/hw/arm/virt.c: In function ‘create_fdt’:
/tmp/qemu-test/src/hw/arm/virt.c:243: warning: implicit declaration of function ‘error_report_exit’ /tmp/qemu-test/src/hw/arm/virt.c:243: warning: nested extern declaration of ‘error_report_exit’ /tmp/qemu-test/src/target-i386/kvm.c: In function ‘kvm_arch_init_irq_routing’:
/tmp/qemu-test/src/target-i386/kvm.c:3240: warning: implicit declaration of function ‘error_report_exit’ /tmp/qemu-test/src/target-i386/kvm.c:3240: warning: nested extern declaration of ‘error_report_exit’ /tmp/qemu-test/src/target-i386/kvm.c: In function ‘kvm_arch_irqchip_create’:
/tmp/qemu-test/src/target-i386/kvm.c:3262: warning: control reaches end of non-void function

  CC    aarch64-softmmu/target-arm/psci.o
  LINK  x86_64-softmmu/qemu-system-x86_64
  CC    aarch64-softmmu/target-arm/arch_dump.o
  CC    aarch64-softmmu/target-arm/monitor.o
  CC    aarch64-softmmu/target-arm/kvm-stub.o
  CC    aarch64-softmmu/target-arm/translate.o
  CC    aarch64-softmmu/target-arm/op_helper.o
  CC    aarch64-softmmu/target-arm/helper.o

/tmp/qemu-test/src/hw/arm/raspi.c: In function ‘setup_boot’:
/tmp/qemu-test/src/hw/arm/raspi.c:101: warning: implicit declaration of function ‘error_report_exit’ /tmp/qemu-test/src/hw/arm/raspi.c:101: warning: nested extern declaration of ‘error_report_exit’
CC aarch64-softmmu/target-arm/cpu.o
/tmp/qemu-test/src/hw/arm/xlnx-ep108.c: In function ‘xlnx_ep108_init’:
/tmp/qemu-test/src/hw/arm/xlnx-ep108.c:43: warning: implicit declaration of function ‘error_report_exit’ /tmp/qemu-test/src/hw/arm/xlnx-ep108.c:43: warning: nested extern declaration of ‘error_report_exit’

  CC    aarch64-softmmu/target-arm/neon_helper.o
  CC    aarch64-softmmu/target-arm/iwmmxt_helper.o
  CC    aarch64-softmmu/target-arm/gdbstub.o
/tmp/qemu-test/src/hw/arm/sabrelite.c: In function ‘sabrelite_init’:
/tmp/qemu-test/src/hw/arm/sabrelite.c:53: warning: implicit declaration of function ‘error_report_exit’
/tmp/qemu-test/src/hw/arm/sabrelite.c:53: warning: nested extern declaration of ‘error_report_exit’
  CC    aarch64-softmmu/target-arm/cpu64.o
  CC    aarch64-softmmu/target-arm/translate-a64.o
  CC    aarch64-softmmu/target-arm/helper-a64.o
  CC    aarch64-softmmu/target-arm/gdbstub64.o
  CC    aarch64-softmmu/target-arm/crypto_helper.o
  CC    aarch64-softmmu/target-arm/arm-powerctl.o

/tmp/qemu-test/src/hw/arm/strongarm.c: In function ‘sa1110_init’:
/tmp/qemu-test/src/hw/arm/strongarm.c:1592: warning: implicit declaration of function ‘error_report_exit’ /tmp/qemu-test/src/hw/arm/strongarm.c:1592: warning: nested extern declaration of ‘error_report_exit’ /tmp/qemu-test/src/hw/arm/fsl-imx6.c: In function ‘fsl_imx6_init’:
/tmp/qemu-test/src/hw/arm/fsl-imx6.c:39: warning: implicit declaration of function ‘error_report_exit’ /tmp/qemu-test/src/hw/arm/fsl-imx6.c:39: warning: nested extern declaration of ‘error_report_exit’ /tmp/qemu-test/src/target-arm/translate-a64.c: In function ‘handle_shri_with_rndacc’:
/tmp/qemu-test/src/target-arm/translate-a64.c:6308: warning: ‘tcg_src_hi’ may be used uninitialized in this function /tmp/qemu-test/src/target-arm/translate-a64.c: In function ‘disas_simd_scalar_two_reg_misc’:
/tmp/qemu-test/src/target-arm/translate-a64.c:8035: warning: ‘rmode’ may be used uninitialized in this function

  GEN   trace/generated-helpers.c
  CC    aarch64-softmmu/trace/control-target.o
  CC    aarch64-softmmu/gdbstub-xml.o
  CC    aarch64-softmmu/trace/generated-helpers.o
  LINK  aarch64-softmmu/qemu-system-aarch64

arch_init.o: In function `audio_init':
/tmp/qemu-test/src/arch_init.c:223: undefined reference to error_report_exit' /tmp/qemu-test/src/arch_init.c:228: undefined reference to error_report_exit' cpus.o: In function `qemu_kvm_destroy_vcpu':
/tmp/qemu-test/src/cpus.c:978: undefined reference to error_report_exit' numa.o: In function memory_region_allocate_system_memory':
/tmp/qemu-test/src/numa.c:458: undefined reference to error_report_exit' numa.o: In function parse_numa_opts':
/tmp/qemu-test/src/numa.c:309: undefined reference to error_report_exit' numa.o:/tmp/qemu-test/src/numa.c:350: more undefined references to error_report_exit' follow
collect2: ld returned 1 exit status
make[1]: *** [qemu-system-x86_64] Error 1
make: *** [subdir-x86_64-softmmu] Error 2
arch_init.o: In function `audio_init':
/tmp/qemu-test/src/arch_init.c:223: undefined reference to error_report_exit' /tmp/qemu-test/src/arch_init.c:228: undefined reference to error_report_exit' numa.o: In function `memory_region_allocate_system_memory':
/tmp/qemu-test/src/numa.c:458: undefined reference to error_report_exit' numa.o: In function parse_numa_opts':
/tmp/qemu-test/src/numa.c:309: undefined reference to error_report_exit' /tmp/qemu-test/src/numa.c:350: undefined reference to error_report_exit' numa.o:/tmp/qemu-test/src/numa.c:277: more undefined references to `error_report_exit' follow
collect2: ld returned 1 exit status
make[1]: *** [qemu-system-aarch64] Error 1
make: *** [subdir-aarch64-softmmu] Error 2
tests/docker/Makefile.include:104: recipe for target 'docker-run-test-quick@centos6' failed
make: *** [docker-run-test-quick@centos6] Error 1
=== OUTPUT END ===

Test command exited with code: 2

---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to [email protected]

author
#18 lore raw

Re: [Qemu-devel] [PATCH v2] error-report: leveraging error_report_exit()

Quoted 5 lines · On Thu, Aug 11, 2016 at 01:01:58AM -0700…

Hi,

Your series failed automatic build test. Please find the testing commands and their output below. If you have docker installed, you can probably reproduce it locally.

This fault should be caused by not applying the first patch.

-- peterx

#19 lore raw

Re: [Qemu-devel] [PATCH v2] error-report: leveraging error_report_exit()

Quoted 9 lines · Peter Xu
Quoted 5 lines · On Thu, Aug 11, 2016 at 01:01:58AM -0700…

Hi,

Your series failed automatic build test. Please find the testing commands and their output below. If you have docker installed, you can probably reproduce it locally.

This fault should be caused by not applying the first patch.

It is preferrable to send full incremental revisions as top level thread instead of replying individual patches to an old one.

Fam

author
#20 lore raw

Re: [Qemu-devel] [PATCH v2] error-report: leveraging error_report_exit()

Quoted 8 lines · Fam Zheng
Quoted 7 lines · Peter Xu
Quoted 5 lines · On Thu, Aug 11, 2016 at 01:01:58AM -0700…

Hi,

Your series failed automatic build test. Please find the testing commands and their output below. If you have docker installed, you can probably reproduce it locally.

Quoted 5 lines
Quoted 2 lines

This fault should be caused by not applying the first patch.

It is preferrable to send full incremental revisions as top level thread instead of replying individual patches to an old one.

Okay. Next time will do.

#2 lore raw

Re: [Qemu-devel] [PATCH 1/2] error-report: provide error_report_exit()

In reply to Peter Xu
Quoted 27 lines · Peter Xu

There are many places in current QEMU codes that needs to print some error and then quit QEMU. Provide a macro for it.

Also, one coccinelle script is added to convert existing cases to leverage this new macro.

---
 include/qemu/error-report.h                |  8 ++++++++
 scripts/coccinelle/error_report_exit.cocci | 13 +++++++++++++
 2 files changed, 21 insertions(+)
 create mode 100644 scripts/coccinelle/error_report_exit.cocci
include/qemu/error-report.h +2 -0
index 499ec8b..c2d5059 100644
@@ -13,6 +13,8 @@
 #ifndef QEMU_ERROR_REPORT_H
 #define QEMU_ERROR_REPORT_H
 
+#include <unistd.h>
+
 typedef struct Location {
     /* all members are private to qemu-error.c */
     enum { LOC_NONE, LOC_CMDLINE, LOC_FILE } kind;

include/qemu/error-report.h void error_printf_unless_qmp(const char *fmt, ...) GCC_FMT_ATTR(1, 2); · line 46

Quoted 9 lines
include/qemu/error-report.h +6 -0
@@ -36,6 +38,12 @@ void error_printf_unless_qmp(const char *fmt, ...) GCC_FMT_ATTR(1, 2);
 void error_set_progname(const char *argv0);
 void error_vreport(const char *fmt, va_list ap) GCC_FMT_ATTR(1, 0);
 void error_report(const char *fmt, ...) GCC_FMT_ATTR(1, 2);
+
+#define error_report_exit(...) do {             \
+        error_report(__VA_ARGS__);              \
+        exit(1);                                \
+    } while (0)
+

Let's call it error_report_fatal(), for consistency with error_fatal.

Also, please make it a function, not a macro:

    void error_report_fatal(const char *fmt, ...)
    {
        va_list ap;

        va_start(ap, fmt);
        error_vreport(fmt, ap);
        va_end(ap);
        exit(1);
    }
Quoted 22 lines
include/qemu/error-report.h +0 -0
 const char *error_get_progname(void);
 extern bool enable_timestamp_msg;
 
scripts/coccinelle/error_report_exit.cocci new file +13 -0
new file mode 100644
index 0000000..49f6c17
@@ -0,0 +1,13 @@
+@@
+expression list X;
+@@
+
+-error_report(X);
++error_report_exit(X);
+-exit(
+(
+-1
+|
+-EXIT_FAILURE
+)
+-);
#3 lore raw

Re: [Qemu-devel] [PATCH 1/2] error-report: provide error_report_exit()

Quoted 32 lines · Markus Armbruster
Quoted 30 lines · Peter Xu

There are many places in current QEMU codes that needs to print some error and then quit QEMU. Provide a macro for it.

Also, one coccinelle script is added to convert existing cases to leverage this new macro.

---
 include/qemu/error-report.h                |  8 ++++++++
 scripts/coccinelle/error_report_exit.cocci | 13 +++++++++++++
 2 files changed, 21 insertions(+)
 create mode 100644 scripts/coccinelle/error_report_exit.cocci
include/qemu/error-report.h +2 -0
index 499ec8b..c2d5059 100644
@@ -13,6 +13,8 @@
 #ifndef QEMU_ERROR_REPORT_H
 #define QEMU_ERROR_REPORT_H
 
+#include <unistd.h>
+
 typedef struct Location {
     /* all members are private to qemu-error.c */
     enum { LOC_NONE, LOC_CMDLINE, LOC_FILE } kind;
@@ -36,6 +38,12 @@ void error_printf_unless_qmp(const char *fmt, ...) GCC_FMT_ATTR(1, 2);
 void error_set_progname(const char *argv0);
 void error_vreport(const char *fmt, va_list ap) GCC_FMT_ATTR(1, 0);
 void error_report(const char *fmt, ...) GCC_FMT_ATTR(1, 2);
Quoted 8 lines

include/qemu/error-report.h void error_printf_unless_qmp(const char *fmt, ...) GCC_FMT_ATTR(1, 2); · line 46

Quoted 6 lines
include/qemu/error-report.h +6 -0
+
+#define error_report_exit(...) do {             \
+        error_report(__VA_ARGS__);              \
+        exit(1);                                \
+    } while (0)
+

Let's call it error_report_fatal(), for consistency with error_fatal.

Do we really need error_report_exit when we already have error_fatal?

Fam

Quoted 36 lines

Also, please make it a function, not a macro:

    void error_report_fatal(const char *fmt, ...)
    {
        va_list ap;

        va_start(ap, fmt);
        error_vreport(fmt, ap);
        va_end(ap);
        exit(1);
    }
Quoted 22 lines
include/qemu/error-report.h +0 -0
 const char *error_get_progname(void);
 extern bool enable_timestamp_msg;
 
scripts/coccinelle/error_report_exit.cocci new file +13 -0
new file mode 100644
index 0000000..49f6c17
@@ -0,0 +1,13 @@
+@@
+expression list X;
+@@
+
+-error_report(X);
++error_report_exit(X);
+-exit(
+(
+-1
+|
+-EXIT_FAILURE
+)
+-);
author
#4 lore raw

Re: [Qemu-devel] [PATCH 1/2] error-report: provide error_report_exit()

Quoted 33 lines · Fam Zheng
Quoted 32 lines · Markus Armbruster
Quoted 30 lines · Peter Xu

There are many places in current QEMU codes that needs to print some error and then quit QEMU. Provide a macro for it.

Also, one coccinelle script is added to convert existing cases to leverage this new macro.

---
 include/qemu/error-report.h                |  8 ++++++++
 scripts/coccinelle/error_report_exit.cocci | 13 +++++++++++++
 2 files changed, 21 insertions(+)
 create mode 100644 scripts/coccinelle/error_report_exit.cocci
include/qemu/error-report.h +2 -0
index 499ec8b..c2d5059 100644
@@ -13,6 +13,8 @@
 #ifndef QEMU_ERROR_REPORT_H
 #define QEMU_ERROR_REPORT_H
 
+#include <unistd.h>
+
 typedef struct Location {
     /* all members are private to qemu-error.c */
     enum { LOC_NONE, LOC_CMDLINE, LOC_FILE } kind;
@@ -36,6 +38,12 @@ void error_printf_unless_qmp(const char *fmt, ...) GCC_FMT_ATTR(1, 2);
 void error_set_progname(const char *argv0);
 void error_vreport(const char *fmt, va_list ap) GCC_FMT_ATTR(1, 0);
 void error_report(const char *fmt, ...) GCC_FMT_ATTR(1, 2);
Quoted 8 lines
Quoted 8 lines

include/qemu/error-report.h void error_printf_unless_qmp(const char *fmt, ...) GCC_FMT_ATTR(1, 2); · line 46

Quoted 6 lines
include/qemu/error-report.h +6 -0
+
+#define error_report_exit(...) do {             \
+        error_report(__VA_ARGS__);              \
+        exit(1);                                \
+    } while (0)
+

Let's call it error_report_fatal(), for consistency with error_fatal.

Sure. Actually I don't know whether we will like this serie. Anyway, let me prepare a v2.

Quoted 2 lines

Do we really need error_report_exit when we already have error_fatal?

error_fatal is the name of a global var, not the function.

Quoted 7 lines
Quoted 7 lines

Also, please make it a function, not a macro:

    void error_report_fatal(const char *fmt, ...)
    {
        va_list ap;
Quoted 5 lines
Quoted 5 lines
        va_start(ap, fmt);
        error_vreport(fmt, ap);
        va_end(ap);
        exit(1);
    }

Ok. Thanks!

-- peterx

#5 lore raw

Re: [Qemu-devel] [PATCH 1/2] error-report: provide error_report_exit()

Quoted 3 lines · Peter Xu
Quoted 1 line

Do we really need error_report_exit when we already have error_fatal?

error_fatal is the name of a global var, not the function.

I mean most error_report_exit(...) calls can be converted to error_setg(&error_fatal, ...).

Fam

author
#6 lore raw

Re: [Qemu-devel] [PATCH 1/2] error-report: provide error_report_exit()

Quoted 7 lines · Fam Zheng
Quoted 3 lines · Peter Xu
Quoted 1 line

Do we really need error_report_exit when we already have error_fatal?

error_fatal is the name of a global var, not the function.

I mean most error_report_exit(...) calls can be converted to error_setg(&error_fatal, ...).

Right. But it's just another way to implement error_report_fatal(). We may still need error_report_fatal() since it's cleaner and shorter than error_setg(&error_fatal, ...).

-- peterx

#7 lore raw

Re: [Qemu-devel] [PATCH 1/2] error-report: provide error_report_exit()

Quoted 4 lines · Peter Xu
Quoted 3 lines · Fam Zheng
Quoted 2 lines · Peter Xu
Quoted 1 line

Do we really need error_report_exit when we already have error_fatal?

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

error_fatal is the name of a global var, not the function.

I mean most error_report_exit(...) calls can be converted to error_setg(&error_fatal, ...).

Right. But it's just another way to implement error_report_fatal(). We may still need error_report_fatal() since it's cleaner and shorter than error_setg(&error_fatal, ...).

Then we should add both error_report_fatal and error_report_abort, or neither of them.

Fam

#8 lore raw

Re: [Qemu-devel] [PATCH 1/2] error-report: provide error_report_exit()

In reply to Peter Xu
Quoted 4 lines · Peter Xu
Quoted 3 lines · Fam Zheng
Quoted 2 lines · Peter Xu
Quoted 1 line

Do we really need error_report_exit when we already have error_fatal?

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

error_fatal is the name of a global var, not the function.

I mean most error_report_exit(...) calls can be converted to error_setg(&error_fatal, ...).

Right. But it's just another way to implement error_report_fatal(). We may still need error_report_fatal() since it's cleaner and shorter than error_setg(&error_fatal, ...).

Fam's point that

    error_report_fatal(...);

is just another way to write

    error_setg(&error_fatal, ...)

is valid. Your point that the former is shorter and simpler is also valid. In fact, error.h advises:

* Please don't error_setg(&error_fatal, ...), use error_report() and
* exit(), because that's more obvious.
* Likewise, don't error_setg(&error_abort, ...), use assert().

Could you convert the existing error_setg(&error_fatal, ...) to error_report_fatal(...)?

Regarding error_report_abort(): in my opinion, printing pretty messages right before abort() is largely a waste of time. But if people insist on doing it, then the error subsystem may have to support it. Would you be willing to track down such usage, so we can make an informed decision?

author
#9 lore raw

Re: [Qemu-devel] [PATCH 1/2] error-report: provide error_report_exit()

Quoted 30 lines · Markus Armbruster
Quoted 4 lines · Peter Xu
Quoted 3 lines · Fam Zheng
Quoted 2 lines · Peter Xu
Quoted 1 line

Do we really need error_report_exit when we already have error_fatal?

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

error_fatal is the name of a global var, not the function.

I mean most error_report_exit(...) calls can be converted to error_setg(&error_fatal, ...).

Right. But it's just another way to implement error_report_fatal(). We may still need error_report_fatal() since it's cleaner and shorter than error_setg(&error_fatal, ...).

Fam's point that

    error_report_fatal(...);

is just another way to write

    error_setg(&error_fatal, ...)

is valid. Your point that the former is shorter and simpler is also valid. In fact, error.h advises:

* Please don't error_setg(&error_fatal, ...), use error_report() and
* exit(), because that's more obvious.
* Likewise, don't error_setg(&error_abort, ...), use assert().

Quoted 8 lines

Could you convert the existing error_setg(&error_fatal, ...) to error_report_fatal(...)?

Regarding error_report_abort(): in my opinion, printing pretty messages right before abort() is largely a waste of time. But if people insist on doing it, then the error subsystem may have to support it. Would you be willing to track down such usage, so we can make an informed decision?

Sure. :)

Yes I see usages for error_setg(&error_abort, ...), it makes sense to provide error_report_abort() along with error_report_fatal(). Will take your (and Fam's) advice.

Thanks for your comments!

-- peterx

#10 lore raw

Re: [Qemu-devel] [PATCH 1/2] error-report: provide error_report_exit()

Quoted 40 lines · Peter Xu
Quoted 30 lines · Markus Armbruster
Quoted 4 lines · Peter Xu
Quoted 3 lines · Fam Zheng
Quoted 2 lines · Peter Xu
Quoted 1 line

Do we really need error_report_exit when we already have error_fatal?

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

error_fatal is the name of a global var, not the function.

I mean most error_report_exit(...) calls can be converted to error_setg(&error_fatal, ...).

Right. But it's just another way to implement error_report_fatal(). We may still need error_report_fatal() since it's cleaner and shorter than error_setg(&error_fatal, ...).

Fam's point that

    error_report_fatal(...);

is just another way to write

    error_setg(&error_fatal, ...)

is valid. Your point that the former is shorter and simpler is also valid. In fact, error.h advises:

* Please don't error_setg(&error_fatal, ...), use error_report() and
* exit(), because that's more obvious.
* Likewise, don't error_setg(&error_abort, ...), use assert().

Quoted 8 lines

Could you convert the existing error_setg(&error_fatal, ...) to error_report_fatal(...)?

Regarding error_report_abort(): in my opinion, printing pretty messages right before abort() is largely a waste of time. But if people insist on doing it, then the error subsystem may have to support it. Would you be willing to track down such usage, so we can make an informed decision?

Quoted 5 lines

Sure. :)

Yes I see usages for error_setg(&error_abort, ...), it makes sense to provide error_report_abort() along with error_report_fatal(). Will take your (and Fam's) advice.

Recommend to make it a separate patch.

Quoted 1 line

Thanks for your comments!

You're welcome!

author
#11 lore raw

Re: [Qemu-devel] [PATCH 1/2] error-report: provide error_report_exit()

Quoted 5 lines · Markus Armbruster
Quoted 3 lines

Yes I see usages for error_setg(&error_abort, ...), it makes sense to provide error_report_abort() along with error_report_fatal(). Will take your (and Fam's) advice.

Recommend to make it a separate patch.

Will do.

-- peterx

author
#12 lore raw

Re: [Qemu-devel] [PATCH 1/2] error-report: provide error_report_exit()

In reply to Peter Xu
Quoted 7 lines · Peter Xu
Quoted 7 lines
Quoted 7 lines

Also, please make it a function, not a macro:

    void error_report_fatal(const char *fmt, ...)
    {
        va_list ap;
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
        va_start(ap, fmt);
        error_vreport(fmt, ap);
        va_end(ap);
        exit(1);
    }

Marcel (and reviewers),

Now if we are having both error_report_fatal() and error_report_abort(), we'll write error_report() three times if we all take them as functions.

How about we still use macro this time but leverage error_setg() macro as mentioned by Fam, like:

+#define error_report_fatal(...) error_setg(&error_fatal, __VA_ARGS__) +#define error_report_abort(...) error_setg(&error_abort, __VA_ARGS__)

In this case, we avoided calling exit() directly in the macro, and is much cleaner than writting error_report() content for three times.

-- peterx

#13 lore raw

Re: [Qemu-devel] [PATCH 1/2] error-report: provide error_report_exit()

Quoted 14 lines · Peter Xu
Quoted 7 lines · Peter Xu
Quoted 7 lines
Quoted 7 lines

Also, please make it a function, not a macro:

    void error_report_fatal(const char *fmt, ...)
    {
        va_list ap;
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
        va_start(ap, fmt);
        error_vreport(fmt, ap);
        va_end(ap);
        exit(1);
    }
Quoted 5 lines

Marcel (and reviewers),

Now if we are having both error_report_fatal() and error_report_abort(), we'll write error_report() three times if we all take them as functions.

Yes, but all we duplicate is the usual var-arg boilerplate.

Quoted 8 lines

How about we still use macro this time but leverage error_setg() macro as mentioned by Fam, like:

(quoted diff) +2 -0
+#define error_report_fatal(...) error_setg(&error_fatal, __VA_ARGS__)
+#define error_report_abort(...) error_setg(&error_abort, __VA_ARGS__)

In this case, we avoided calling exit() directly in the macro, and is much cleaner than writting error_report() content for three times.

I'm afraid that destroys the layering.

Currently, Error objects (util/error.c) use error reporting (util/qemu-error.c), but not vice versa. Their headers (include/qapi/error.h and include/qemu/error-report.h) are idependent. I like it that way.

author
#14 lore raw

Re: [Qemu-devel] [PATCH 1/2] error-report: provide error_report_exit()

Quoted 35 lines · Markus Armbruster
Quoted 14 lines · Peter Xu
Quoted 7 lines · Peter Xu
Quoted 7 lines
Quoted 7 lines

Also, please make it a function, not a macro:

    void error_report_fatal(const char *fmt, ...)
    {
        va_list ap;
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
        va_start(ap, fmt);
        error_vreport(fmt, ap);
        va_end(ap);
        exit(1);
    }
Quoted 5 lines

Marcel (and reviewers),

Now if we are having both error_report_fatal() and error_report_abort(), we'll write error_report() three times if we all take them as functions.

Yes, but all we duplicate is the usual var-arg boilerplate.

Quoted 8 lines

How about we still use macro this time but leverage error_setg() macro as mentioned by Fam, like:

(quoted diff) +2 -0
+#define error_report_fatal(...) error_setg(&error_fatal, __VA_ARGS__)
+#define error_report_abort(...) error_setg(&error_abort, __VA_ARGS__)

In this case, we avoided calling exit() directly in the macro, and is much cleaner than writting error_report() content for three times.

I'm afraid that destroys the layering.

Quoted 4 lines

Currently, Error objects (util/error.c) use error reporting (util/qemu-error.c), but not vice versa. Their headers (include/qapi/error.h and include/qemu/error-report.h) are idependent. I like it that way.

I see. Then let me keep them functions.

Thanks,

-- peterx