diff options
author | Tudor Gheorghiu <tudor.reda@gmail.com> | 2024-10-08 01:27:56 +0300 |
---|---|---|
committer | Michael Tokarev <mjt@tls.msk.ru> | 2024-10-21 22:40:47 +0300 |
commit | 5ae3ec63631a907ba474094df99594cd545590df (patch) | |
tree | f8c278bfd0205d204114768d0b160060fd9266a7 /hw/arm | |
parent | f8d3116fddcea844a086f879e6e934107f471b10 (diff) | |
download | qemu-5ae3ec63631a907ba474094df99594cd545590df.zip qemu-5ae3ec63631a907ba474094df99594cd545590df.tar.gz qemu-5ae3ec63631a907ba474094df99594cd545590df.tar.bz2 |
replace error_setg(&error_fatal, ...) with error_report()
According to include/qapi/error.h:
* Please don't error_setg(&error_fatal, ...), use error_report() and
* exit(), because that's more obvious.
Patch updates all instances of error_setg(&error_fatal, ...) with
error_report(...), adds the explicit exit(1) and removes redundant
return statements.
Signed-off-by: Tudor Gheorghiu <tudor.reda@gmail.com>
Suggested-by: Thomas Huth <thuth@redhat.com>
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2587
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
(Mjt: also fold __func__ to previous line)
Diffstat (limited to 'hw/arm')
-rw-r--r-- | hw/arm/allwinner-a10.c | 6 | ||||
-rw-r--r-- | hw/arm/allwinner-h3.c | 5 | ||||
-rw-r--r-- | hw/arm/allwinner-r40.c | 5 | ||||
-rw-r--r-- | hw/arm/xlnx-versal-virt.c | 4 |
4 files changed, 9 insertions, 11 deletions
diff --git a/hw/arm/allwinner-a10.c b/hw/arm/allwinner-a10.c index 9eb1aa7..52327d9 100644 --- a/hw/arm/allwinner-a10.c +++ b/hw/arm/allwinner-a10.c @@ -17,6 +17,7 @@ #include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu/error-report.h" #include "qemu/module.h" #include "hw/char/serial-mm.h" #include "hw/sysbus.h" @@ -50,9 +51,8 @@ void allwinner_a10_bootrom_setup(AwA10State *s, BlockBackend *blk) g_autofree uint8_t *buffer = g_new0(uint8_t, rom_size); if (blk_pread(blk, 8 * KiB, rom_size, buffer, 0) < 0) { - error_setg(&error_fatal, "%s: failed to read BlockBackend data", - __func__); - return; + error_report("%s: failed to read BlockBackend data", __func__); + exit(1); } rom_add_blob("allwinner-a10.bootrom", buffer, rom_size, diff --git a/hw/arm/allwinner-h3.c b/hw/arm/allwinner-h3.c index 9bc57cd..fd7638d 100644 --- a/hw/arm/allwinner-h3.c +++ b/hw/arm/allwinner-h3.c @@ -182,9 +182,8 @@ void allwinner_h3_bootrom_setup(AwH3State *s, BlockBackend *blk) g_autofree uint8_t *buffer = g_new0(uint8_t, rom_size); if (blk_pread(blk, 8 * KiB, rom_size, buffer, 0) < 0) { - error_setg(&error_fatal, "%s: failed to read BlockBackend data", - __func__); - return; + error_report("%s: failed to read BlockBackend data", __func__); + exit(1); } rom_add_blob("allwinner-h3.bootrom", buffer, rom_size, diff --git a/hw/arm/allwinner-r40.c b/hw/arm/allwinner-r40.c index ced7300..c6f7cab 100644 --- a/hw/arm/allwinner-r40.c +++ b/hw/arm/allwinner-r40.c @@ -231,9 +231,8 @@ bool allwinner_r40_bootrom_setup(AwR40State *s, BlockBackend *blk, int unit) struct boot_file_head *head = (struct boot_file_head *)buffer; if (blk_pread(blk, 8 * KiB, rom_size, buffer, 0) < 0) { - error_setg(&error_fatal, "%s: failed to read BlockBackend data", - __func__); - return false; + error_report("%s: failed to read BlockBackend data", __func__); + exit(1); } /* we only check the magic string here. */ diff --git a/hw/arm/xlnx-versal-virt.c b/hw/arm/xlnx-versal-virt.c index 962f98f..8b12d3e 100644 --- a/hw/arm/xlnx-versal-virt.c +++ b/hw/arm/xlnx-versal-virt.c @@ -761,9 +761,9 @@ static void versal_virt_init(MachineState *machine) if (!flash_klass || object_class_is_abstract(flash_klass) || !object_class_dynamic_cast(flash_klass, TYPE_M25P80)) { - error_setg(&error_fatal, "'%s' is either abstract or" + error_report("'%s' is either abstract or" " not a subtype of m25p80", s->ospi_model); - return; + exit(1); } } |