Skip to contentSkip to conversation

Trivial patches for 2026-01-20

GIT PULL Michael Tokarev 1 participant 10 messages Jan 20

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

The following changes since commit 38879a667fbb4ef54c70de71494882615f600a64:

Merge tag 'pull-tcg-20260119' of https://gitlab.com/rth7680/qemu into staging (2026-01-19 09:04:31 +1100)

are available in the Git repository at:

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

for you to fetch changes up to 83017c4aaa9e3ef80161443019764196dffdb654:

linux-user/aarch64/target_fcntl.h: add missing TARGET_O_LARGEFILE definition (2026-01-20 15:21:08 +0300)

----------------------------------------------------------------
trivial patches for 2026-01-20

----------------------------------------------------------------
Florian Hofhammer (1):
configure: add ppc target back to container tests

Julian Ganz (1):
tests: fix comment declaring runtime in rv64 interruptedmemory test

Michael Tokarev (3):
Revert "gdbstub: Try unlinking the unix socket before binding"
gdbstub: unlink the unix socket before bind() qemu-options.hx: use KiB, MiB, GiB for power-of-2 units

Pierrick Bouvier (1):
linux-user/aarch64/target_fcntl.h: add missing TARGET_O_LARGEFILE definition

Thomas Huth (3):
configure: Set $PYTHON in the configuration of the optionroms tests/qemu-iotests: Use "gsed" for expressions that require GNU sed
MAINTAINERS: Add docs/system/i386/ to the general x86 architecture section

 MAINTAINERS                           |  1 +
 configure                             |  3 ++-
 gdbstub/user.c                        | 30 +++++++++++++++++++++++++++---
 linux-user/aarch64/target_fcntl.h     |  1 +
 qemu-options.hx                       | 20 ++++++++++----------
 stubs/meson.build                     |  2 --
 tests/qemu-iotests/286                |  2 +-
 tests/qemu-iotests/common.rc          |  2 +-
 tests/tcg/riscv64/interruptedmemory.S |  2 +-
 util/meson.build                      |  2 --
 10 files changed, 44 insertions(+), 21 deletions(-)
#1 lore raw

[PULL 3/9] qemu-options.hx: use KiB, MiB, GiB for power-of-2 units

Use MiB &Co instead of MB &Co when the talk is about power-of-two-based sizes, in qemu-options.hx.

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

---
 qemu-options.hx | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
qemu-options.hx +10 -10
index ec92723f10..455b8be890 100644
@@ -305,9 +305,9 @@ SRST
         with break-before-make sequences are considerable and also if guest
         workloads are read intensive. The size here specifies how many pages
         to break at a time and needs to be a valid block size which is
-        1GB/2MB/4KB, 32MB/16KB and 512MB/64KB for 4KB/16KB/64KB PAGE_SIZE
-        respectively. Be wary of specifying a higher size as it will have an
-        impact on the memory. By default, this feature is disabled
+        1GiB/2MiB/4KiB, 32MiB/16KiB and 512MiB/64KiB for 4KiB/16KiB/64KiB
+        PAGE_SIZE respectively. Be wary of specifying a higher size as it will
+        have an impact on the memory. By default, this feature is disabled
         (eager-split-size=0).
 
     ``notify-vmexit=run|internal-error|disable,notify-window=n``
@@ -564,7 +564,7 @@ SRST
 
     lat is latency value in nanoseconds. bw is bandwidth value, the
     possible value and units are NUM[M\|G\|T], mean that the bandwidth
-    value are NUM byte per second (or MB/s, GB/s or TB/s depending on
+    value are NUM byte per second (or MiB/s, GiB/s or TiB/s depending on
     used suffix). Note that if latency or bandwidth value is 0, means
     the corresponding latency or bandwidth information is not provided.
 
@@ -579,10 +579,10 @@ SRST
     For example, the following options describe 2 NUMA nodes. Node 0 has
     2 cpus and a ram, node 1 has only a ram. The processors in node 0
     access memory in node 0 with access-latency 5 nanoseconds,
-    access-bandwidth is 200 MB/s; The processors in NUMA node 0 access
+    access-bandwidth is 200 MiB/s; The processors in NUMA node 0 access
     memory in NUMA node 1 with access-latency 10 nanoseconds,
-    access-bandwidth is 100 MB/s. And for memory side cache information,
-    NUMA node 0 and 1 both have 1 level memory cache, size is 10KB,
+    access-bandwidth is 100 MiB/s. And for memory side cache information,
+    NUMA node 0 and 1 both have 1 level memory cache, size is 10KiB,
     policy is write-back, the cache Line size is 8 bytes:
 
     ::
@@ -739,8 +739,8 @@ SRST
     amount of memory. Note that maxmem must be aligned to the page size.
 
     For example, the following command-line sets the guest startup RAM
-    size to 1GB, creates 3 slots to hotplug additional memory and sets
-    the maximum memory the guest can reach to 4GB:
+    size to 1GiB, creates 3 slots to hotplug additional memory and sets
+    the maximum memory the guest can reach to 4GiB:
 
     .. parsed-literal::
 
@@ -1696,7 +1696,7 @@ SRST
         Specify bandwidth throttling limits in bytes per second, either
         for all request types or for reads or writes only. Small values
         can lead to timeouts or hangs inside the guest. A safe minimum
-        for disks is 2 MB/s.
+        for disks is 2 MiB/s.
 
     ``bps_max=bm,bps_rd_max=rm,bps_wr_max=wm``
         Specify bursts in bytes per second, either for all request types
Signature · 1 line
2.47.3
#2 lore raw

[PULL 9/9] linux-user/aarch64/target_fcntl.h: add missing TARGET_O_LARGEFILE definition

In reply to Michael Tokarev

From: Pierrick Bouvier <[email protected]>

This caused a failure with program using openat2, where O_LARGEFILE was replaced by O_NOFOLLOW.
This issue is only visible when QEMU is compiled with musl libc, where O_LARGEFILE is different from 0 (vs glibc).

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

---
 linux-user/aarch64/target_fcntl.h | 1 +
 1 file changed, 1 insertion(+)
linux-user/aarch64/target_fcntl.h +1 -0
index efdf6e5f05..55ab788a7c 100644
@@ -11,6 +11,7 @@
 #define TARGET_O_DIRECTORY      040000 /* must be a directory */
 #define TARGET_O_NOFOLLOW      0100000 /* don't follow links */
 #define TARGET_O_DIRECT        0200000 /* direct disk access hint */
+#define TARGET_O_LARGEFILE     0400000
 
 #include "../generic/fcntl.h"
 #endif
Signature · 1 line
2.47.3
#3 lore raw

[PULL 8/9] configure: add ppc target back to container tests

In reply to Michael Tokarev

From: Florian Hofhammer <[email protected]>

Commit 2ff8c9a298 removed support for 32-bit PPC hosts from the build system. Unfortunately, the patch also removed the 32-bit PPC target for containerized tests, which leads to an error when trying to run tests, e.g., with "make check-tcg":
"make[1]: *** No rule to make target 'docker-image-debian-ppc-cross', needed by 'build-tcg-tests-ppc-linux-user'. Stop."

This patch adds the PPC target back for containerized tests.

Fixes 2ff8c9a2984b ("buildsys: Remove support for 32-bit PPC hosts")

[Mjt: specify commit subject in Fixes tag)

---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
configure +1 -1
index 0d73eefc15..213880df89 100755
@@ -1451,7 +1451,7 @@ probe_target_compiler() {
         container_image=debian-all-test-cross
         container_cross_prefix=mips64-linux-gnuabi64-
         ;;
-      ppc64|ppc64le)
+      ppc|ppc64|ppc64le)
         container_image=debian-all-test-cross
         container_cross_prefix=powerpc${target_arch#ppc}-linux-gnu-
         ;;
Signature · 1 line
2.47.3
#4 lore raw

[PULL 6/9] tests/qemu-iotests: Use "gsed" for expressions that require GNU sed

In reply to Michael Tokarev

From: Thomas Huth <[email protected]>

A bunch of tests are currently failing e.g. on FreeBSD like this:

082 fail [13:38:58] [13:38:59] 0.5s output
mismatch (see .../build/tests/qemu-iotests/scratch/qcow2-file-082/082.out.bad)
--- .../src/tests/qemu-iotests/082.out
+++ .../build/tests/qemu-iotests/scratch/qcow2-file-082/082.out.bad @@ -17,7 +17,7 @@
cluster_size: 4096
Format specific information:

      compat: 1.1

- compression type: COMPRESSION_TYPE
+ compression type: zlib
lazy refcounts: true
refcount bits: 16
corrupt: false

This happens because the sed statements require GNU sed. Let's use gsed in these spots to get it fixed.

---
 tests/qemu-iotests/286       | 2 +-
 tests/qemu-iotests/common.rc | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
tests/qemu-iotests/286 +1 -1
index 38216c2a0e..cc6aacf022 100755
@@ -62,7 +62,7 @@ wait=yes _cleanup_qemu
 
 echo 'Output structure:'
 $QEMU_IMG snapshot -l "$TEST_IMG" | tail -n 1 | tr -s ' ' \
-    | sed -e 's/\S\+/./g' \
+    | gsed -e 's/\S\+/./g' \
     | sed -e 's/\./(snapshot ID)/' \
           -e 's/\./(snapshot name)/' \
           -e 's/\./(VM state size value)/' \
tests/qemu-iotests/common.rc +1 -1
index c0f8f0f8df..731e4b2b99 100644
@@ -719,7 +719,7 @@ _img_info()
     regex_json_spec_start='^ *"format-specific": \{'
     regex_json_child_start='^ *"children": \['
     $QEMU_IMG info $QEMU_IMG_EXTRA_ARGS "$@" "$TEST_IMG" 2>&1 | \
-        sed -e "s#$REMOTE_TEST_DIR#TEST_DIR#g" \
+        gsed -e "s#$REMOTE_TEST_DIR#TEST_DIR#g" \
             -e "s#$IMGPROTO:$TEST_DIR#TEST_DIR#g" \
             -e "s#$TEST_DIR#TEST_DIR#g" \
             -e "s#$SOCK_DIR/fuse-#TEST_DIR/#g" \
Signature · 1 line
2.47.3
#5 lore raw

[PULL 1/9] Revert "gdbstub: Try unlinking the unix socket before binding"

In reply to Michael Tokarev

This reverts commit fccb744f41c69fec6fd92225fe907c6e69de5d44.

This commit introduced dependency of linux-user on qemu-sockets.c. The latter includes handling of various socket types, while gdbstub only needs unix sockets. Including different kinds of sockets makes it more problematic to build linux-user statically.

The original issue - the need to unlink unix socket before binding - will be addressed in the next change.

---
 gdbstub/user.c    | 29 ++++++++++++++++++++++++++---
 stubs/meson.build |  2 --
 util/meson.build  |  2 --
 3 files changed, 26 insertions(+), 7 deletions(-)
gdbstub/user.c +26 -3
index e233c59816..5e920a9b51 100644
@@ -314,10 +314,12 @@ static bool gdb_accept_socket(int gdb_fd)
     return true;
 }
 
-static int gdbserver_open_socket(const char *path, Error **errp)
+static int gdbserver_open_socket(const char *path)
 {
     g_autoptr(GString) buf = g_string_new("");
+    struct sockaddr_un sockaddr = {};
     const char *pid_placeholder;
+    int fd, ret;
 
     pid_placeholder = strstr(path, "%d");
     if (pid_placeholder != NULL) {
@@ -327,7 +329,28 @@ static int gdbserver_open_socket(const char *path, Error **errp)
         path = buf->str;
     }
 
-    return unix_listen(path, errp);
+    fd = socket(AF_UNIX, SOCK_STREAM, 0);
+    if (fd < 0) {
+        perror("create socket");
+        return -1;
+    }
+
+    sockaddr.sun_family = AF_UNIX;
+    pstrcpy(sockaddr.sun_path, sizeof(sockaddr.sun_path) - 1, path);
+    ret = bind(fd, (struct sockaddr *)&sockaddr, sizeof(sockaddr));
+    if (ret < 0) {
+        perror("bind socket");
+        close(fd);
+        return -1;
+    }
+    ret = listen(fd, 1);
+    if (ret < 0) {
+        perror("listen socket");
+        close(fd);
+        return -1;
+    }
+
+    return fd;
 }
 
 static bool gdb_accept_tcp(int gdb_fd)
@@ -483,7 +506,7 @@ bool gdbserver_start(const char *args, Error **errp)
     if (port > 0) {
         gdb_fd = gdbserver_open_port(port, errp);
     } else {
-        gdb_fd = gdbserver_open_socket(port_or_path, errp);
+        gdb_fd = gdbserver_open_socket(port_or_path);
     }
     if (gdb_fd < 0) {
         return false;
stubs/meson.build +0 -2
index d3b551f4de..2b5fd8a88a 100644
@@ -61,8 +61,6 @@ if have_user
   if not have_system
     stub_ss.add(files('qdev.c'))
   endif
-
-  stub_ss.add(files('monitor-internal.c'))
 endif
 
 if have_system
util/meson.build +0 -2
index 59e835a8d3..a0cfdc30ba 100644
@@ -83,8 +83,6 @@ if have_block or have_ga
   util_ss.add(files('qemu-coroutine.c', 'qemu-coroutine-lock.c', 'qemu-coroutine-io.c'))
   util_ss.add(files(f'coroutine-@[email protected]'))
   util_ss.add(files('thread-pool.c', 'qemu-timer.c'))
-endif
-if have_block or have_ga or have_user
   util_ss.add(files('qemu-sockets.c'))
 endif
 if have_block
Signature · 1 line
2.47.3
#6 lore raw

[PULL 2/9] gdbstub: unlink the unix socket before bind()

In reply to Michael Tokarev

This is another variant of doing what v9.2.0-1561-gfccb744f41c6 "gdbstub: Try unlinking the unix socket before binding" did, but that commit introduced dependency on qemu-sockets.c which is more problematic for statically-linked qemu-user binaries.

---
 gdbstub/user.c | 1 +
 1 file changed, 1 insertion(+)
gdbstub/user.c +1 -0
index 5e920a9b51..a2327c6135 100644
@@ -337,6 +337,7 @@ static int gdbserver_open_socket(const char *path)
 
     sockaddr.sun_family = AF_UNIX;
     pstrcpy(sockaddr.sun_path, sizeof(sockaddr.sun_path) - 1, path);
+    unlink(sockaddr.sun_path);
     ret = bind(fd, (struct sockaddr *)&sockaddr, sizeof(sockaddr));
     if (ret < 0) {
         perror("bind socket");
Signature · 1 line
2.47.3
#7 lore raw

[PULL 7/9] MAINTAINERS: Add docs/system/i386/ to the general x86 architecture section

In reply to Michael Tokarev

From: Thomas Huth <[email protected]>

We've got a section for generic x86 architecture support in our MAINTAINERS file - this should cover the docs/system/i386/ folder, too.

---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)
MAINTAINERS +1 -0
index c1e586c58f..81c013fea2 100644
@@ -143,6 +143,7 @@ S: Maintained
 F: configs/devices/i386-softmmu/default.mak
 F: configs/targets/i386-softmmu.mak
 F: configs/targets/x86_64-softmmu.mak
+F: docs/system/i386/
 F: docs/system/target-i386*
 F: target/i386/*.[ch]
 F: target/i386/Kconfig
Signature · 1 line
2.47.3
#8 lore raw

[PULL 4/9] tests: fix comment declaring runtime in rv64 interruptedmemory test

In reply to Michael Tokarev

From: Julian Ganz <[email protected]>

The test attempts to trigger a regression for arount 30s. However, a comment just before the computation of the target wall clock time falsly declares the run time to be around 60s.

This was the case already when we introduced the test in

5241645c47a9987f4fcc65bab303a444966b7942
(tests: add test with interrupted memory accesses on rv64)

---
 tests/tcg/riscv64/interruptedmemory.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/tcg/riscv64/interruptedmemory.S +1 -1
index cd9073ee31..c154f93839 100644
@@ -25,7 +25,7 @@ _start:
 	li	a0, 0x03	# 8N1, DLAB=0
 	sb	a0, 3(t1)
 
-	# Run test for around 60s
+	# Run test for around 30s
 	call	rtc_get
 	li	t0, 30
 	slli	t0, t0, 30 # Approx. 10e9 ns
Signature · 1 line
2.47.3
#9 lore raw

[PULL 5/9] configure: Set $PYTHON in the configuration of the optionroms

In reply to Michael Tokarev

From: Thomas Huth <[email protected]>

pc-bios/optionrom/Makefile uses $(PYTHON) for running a Python script, but this variable is never initialized here. So the script gets run via its shebang line - which fails if the "python3" binary is not available on the system. To fix this, write the PYTHON configuration to the config.mak file of the optionroms.

---
 configure | 1 +
 1 file changed, 1 insertion(+)
configure +1 -0
index e69b3e474e..0d73eefc15 100755
@@ -1632,6 +1632,7 @@ probe_target_compiler() {
 }
 
 write_target_makefile() {
+  echo "PYTHON=$python"
   echo "EXTRA_CFLAGS=$target_cflags"
   if test -z "$target_cc" && test -z "$target_as"; then
     test -z "$container_image" && error_exit "Internal error: could not find cross compiler for $1?"
Signature · 1 line
2.47.3