08.10.2024 01:27, Tudor Gheorghiu wrote:
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.r...@gmail.com>
Suggested-by: Thomas Huth <th...@redhat.com>
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2587

Reviewed-by: Michael Tokarev <m...@tls.msk.ru>


@@ -49,9 +50,9 @@ 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",
+        error_report("%s: failed to read BlockBackend data",
                     __func__);
-        return;
+        exit(1);
      }

I queued this patch to qemu-trivial, with additional change, - folding this 
__func__ to
the previous line, since there's no need to split the line anymore.  Like this:

     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);
     }

Here and in 2 other allwinner-* files.

Thanks,

/mjt

Reply via email to