Skip to contentSkip to conversation

Trivial patches for 2024-10-22

GIT PULL Applied Michael Tokarev 2 participants 7 messages Oct 22, 2024 – Oct 24, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

The following changes since commit cc5adbbd50d81555b8eb73602ec16fde40b55be4:

Merge tag 'pull-tpm-2024-10-18-1' of https://github.com/stefanberger/qemu-tpm into staging (2024-10-18 15:45:02 +0100)

are available in the Git repository at:

https://gitlab.com/mjt0k/qemu.git tags/pull-trivial-patches

for you to fetch changes up to 5ae3ec63631a907ba474094df99594cd545590df:

replace error_setg(&error_fatal, ...) with error_report() (2024-10-21 22:40:47 +0300)

----------------------------------------------------------------
trivial patches for 2024-10-22

----------------------------------------------------------------
Brad Smith (1):
meson.build: Remove ncurses workaround for OpenBSD

Gustavo Romero (1):
linux-user: Clean up unused header

Kevin Wolf (1):
configure: Replace literally printed '\n' with newline

Thomas Huth (1):
ui/console-vc: Silence warning about sprintf() on OpenBSD

Tudor Gheorghiu (1):
replace error_setg(&error_fatal, ...) with error_report()

 configure                 | 3 ++-
 hw/arm/allwinner-a10.c    | 6 +++---
 hw/arm/allwinner-h3.c     | 5 ++---
 hw/arm/allwinner-r40.c    | 5 ++---
 hw/arm/xlnx-versal-virt.c | 4 ++--
 hw/audio/soundhw.c        | 3 ++-
 linux-user/syscall.c      | 1 -
 meson.build               | 2 +-
 system/vl.c               | 3 ++-
 ui/console-vc.c           | 4 ++--
 ui/curses.c               | 2 +-
 11 files changed, 19 insertions(+), 19 deletions(-)
#1 lore raw

[PULL 1/5] linux-user: Clean up unused header

From: Gustavo Romero <[email protected]>

Clean up unused (already commented-out) header from syscall.c.

---
 linux-user/syscall.c | 1 -
 1 file changed, 1 deletion(-)
linux-user/syscall.c +0 -1
index 1354e75694..d1b0f7c5bb 100644
@@ -54,7 +54,6 @@
 #include <utime.h>
 #include <sys/sysinfo.h>
 #include <sys/signalfd.h>
-//#include <sys/user.h>
 #include <netinet/in.h>
 #include <netinet/ip.h>
 #include <netinet/tcp.h>
Signature · 1 line
2.39.5
#2 lore raw

[PULL 2/5] ui/console-vc: Silence warning about sprintf() on OpenBSD

In reply to Michael Tokarev

From: Thomas Huth <[email protected]>

The linker on OpenBSD complains:

ld: warning: console-vc.c:824 (../src/ui/console-vc.c:824)([...]):
warning: sprintf() is often misused, please use snprintf()

Using g_strdup_printf() is certainly better here, so let's switch to that function instead.

---
 ui/console-vc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
ui/console-vc.c +2 -2
index 8393d532e7..53fcee88f4 100644
@@ -648,7 +648,7 @@ static void vc_putchar(VCChardev *vc, int ch)
     QemuTextConsole *s = vc->console;
     int i;
     int x, y;
-    char response[40];
+    g_autofree char *response = NULL;
 
     switch(vc->state) {
     case TTY_STATE_NORM:
@@ -821,7 +821,7 @@ static void vc_putchar(VCChardev *vc, int ch)
                     break;
                 case 6:
                     /* report cursor position */
-                    sprintf(response, "\033[%d;%dR",
+                    response = g_strdup_printf("\033[%d;%dR",
                            (s->y_base + s->y) % s->total_height + 1,
                             s->x + 1);
                     vc_respond_str(vc, response);
Signature · 1 line
2.39.5
#3 lore raw

[PULL 3/5] configure: Replace literally printed '\n' with newline

In reply to Michael Tokarev

From: Kevin Wolf <[email protected]>

The idea here was to leave an empty line before the message, but by default, echo prints '\n' literally instead of interpreting it. Use a separate echo without parameter instead like in other places in the script.

Fixes 6fdc5bc173188f5e4942616b16d589500b874a15
---
 configure | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
configure +2 -1
index 72d1a94225..0918147156 100755
@@ -2062,7 +2062,8 @@ chmod +x config.status
 rm -r "$TMPDIR1"
 
 if test "$rust" != disabled; then
-  echo '\nINFO: Rust bindings generation with `bindgen` might fail in some cases where'
+  echo
+  echo 'INFO: Rust bindings generation with `bindgen` might fail in some cases where'
   echo 'the detected `libclang` does not match the expected `clang` version/target. In'
   echo 'this case you must pass the path to `clang` and `libclang` to your build'
   echo 'command invocation using the environment variables CLANG_PATH and LIBCLANG_PATH'
Signature · 1 line
2.39.5
#4 lore raw

[PULL 4/5] meson.build: Remove ncurses workaround for OpenBSD

In reply to Michael Tokarev

From: Brad Smith <[email protected]>

meson.build: Remove ncurses workaround for OpenBSD

OpenBSD 7.5 has upgraded to ncurses 6.4.

---
 meson.build | 2 +-
 ui/curses.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
meson.build +1 -1
index d26690ce20..c26c417de1 100644
@@ -1399,7 +1399,7 @@ iconv = not_found
 curses = not_found
 if have_system and get_option('curses').allowed()
   curses_test = '''
-    #if defined(__APPLE__) || defined(__OpenBSD__)
+    #ifdef __APPLE__
     #define _XOPEN_SOURCE_EXTENDED 1
     #endif
     #include <locale.h>
ui/curses.c +1 -1
index ec61615f7c..4d0be9b37d 100644
@@ -38,7 +38,7 @@
 #include "ui/input.h"
 #include "sysemu/sysemu.h"
 
-#if defined(__APPLE__) || defined(__OpenBSD__)
+#ifdef __APPLE__
 #define _XOPEN_SOURCE_EXTENDED 1
 #endif
 
Signature · 1 line
2.39.5
#5 lore raw

[PULL 5/5] replace error_setg(&error_fatal, ...) with error_report()

In reply to Michael Tokarev

From: Tudor Gheorghiu <[email protected]>

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.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2587

(Mjt: also fold __func__ to previous line)

---
 hw/arm/allwinner-a10.c    | 6 +++---
 hw/arm/allwinner-h3.c     | 5 ++---
 hw/arm/allwinner-r40.c    | 5 ++---
 hw/arm/xlnx-versal-virt.c | 4 ++--
 hw/audio/soundhw.c        | 3 ++-
 system/vl.c               | 3 ++-
 6 files changed, 13 insertions(+), 13 deletions(-)
hw/arm/allwinner-a10.c +3 -3
index 9eb1aa7366..52327d9210 100644
@@ -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,
hw/arm/allwinner-h3.c +2 -3
index 9bc57cd266..fd7638dbe8 100644
@@ -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,
hw/arm/allwinner-r40.c +2 -3
index ced73009d6..c6f7cab1da 100644
@@ -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. */
hw/arm/xlnx-versal-virt.c +2 -2
index 962f98fee2..8b12d3e7cb 100644
@@ -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);
             }
         }
 
hw/audio/soundhw.c +2 -1
index b387b0ef7d..d18fd9fa05 100644
@@ -88,7 +88,8 @@ void select_soundhw(const char *name, const char *audiodev)
     struct soundhw *c;
 
     if (selected) {
-        error_setg(&error_fatal, "only one -soundhw option is allowed");
+        error_report("only one -soundhw option is allowed");
+        exit(1);
     }
 
     for (c = soundhw; c->name; ++c) {
system/vl.c +2 -1
index e83b3b2608..d217b3d64d 100644
@@ -1841,7 +1841,8 @@ static void object_option_parse(const char *str)
 
         type = qemu_opt_get(opts, "qom-type");
         if (!type) {
-            error_setg(&error_fatal, QERR_MISSING_PARAMETER, "qom-type");
+            error_report(QERR_MISSING_PARAMETER, "qom-type");
+            exit(1);
         }
         if (user_creatable_print_help(type, opts)) {
             exit(0);
Signature · 1 line
2.39.5
#6 lore raw
In reply to Michael Tokarev
Quoted 7 lines · Michael Tokarev

The following changes since commit cc5adbbd50d81555b8eb73602ec16fde40b55be4:

Merge tag 'pull-tpm-2024-10-18-1' of https://github.com/stefanberger/qemu-tpm into staging (2024-10-18 15:45:02 +0100)

are available in the Git repository at:

Quoted 9 lines

https://gitlab.com/mjt0k/qemu.git tags/pull-trivial-patches

for you to fetch changes up to 5ae3ec63631a907ba474094df99594cd545590df:

replace error_setg(&error_fatal, ...) with error_report() (2024-10-21 22:40:47 +0300)

----------------------------------------------------------------
trivial patches for 2024-10-22

Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/9.2
for any user-visible changes.

-- PMM