Skip to contentSkip to conversation

Miscellaneous patches for 2026-03-05

GIT PULL Markus Armbruster 2 participants 9 messages Mar 5 – Mar 6 Checkpatch

lore
Share & tools
lore
#0 lore raw

The following changes since commit 3fb456e9a0e9eef6a71d9b49bfff596a0f0046e9:

Merge tag 'pull-request-2026-03-02' of https://gitlab.com/thuth/qemu into staging (2026-03-02 14:01:46 +0000)

are available in the Git repository at:

https://repo.or.cz/qemu/armbru.git tags/pull-misc-2026-03-05

for you to fetch changes up to a1aca41ed08fba3120878fceb7f74af97c6fad93:

qdev-monitor: Fix qdev ID validation regression (2026-03-05 14:34:11 +0100)

----------------------------------------------------------------
Miscellaneous patches for 2026-03-05

----------------------------------------------------------------
Markus Armbruster (6):
hw/core: Deprecate query-kvm
scripts/checkpatch: Fix MAINTAINERS update warning with --terse
error: Fix "to current monitor if we have one" comments
error: Restore error_printf()'s function comment
qemu-print: Document qemu_fprintf(), qemu_vfprintf() failure
qdev-monitor: Fix qdev ID validation regression

 docs/about/deprecated.rst |  5 +++++
 qapi/accelerator.json     |  8 +++++++-
 include/qapi/error.h      |  3 ++-
 monitor/monitor.c         |  2 +-
 system/qdev-monitor.c     | 12 ++++++++++--
 util/error-report.c       | 29 +++++++++++++++++++----------
 util/qemu-print.c         | 14 ++++++++++----
 scripts/checkpatch.pl     |  6 +++---
 8 files changed, 57 insertions(+), 22 deletions(-)
Signature · 1 line
2.53.0
#1 lore raw

[PULL 1/6] hw/core: Deprecate query-kvm

query-accelerators covers all accelerators, and should be used instead.

Message-ID: <[email protected]>

[Rebased, missing section title markup fixed]
---
 docs/about/deprecated.rst | 5 +++++
 qapi/accelerator.json     | 8 +++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)
docs/about/deprecated.rst +5 -0
index d0ce914d85..ee29c4fb89 100644
@@ -142,6 +142,11 @@ Use ``job-dismiss`` instead.
 
 Use ``job-finalize`` instead.
 
+``query-kvm`` (since 11.0)
+''''''''''''''''''''''''''
+
+Use ``query-accelerators`` instead.
+
 Human Machine Protocol (HMP) commands
 -------------------------------------
 
qapi/accelerator.json +7 -1
index 0cf5e0f9d9..b59df37866 100644
@@ -29,6 +29,11 @@
 #
 # Return information about KVM acceleration
 #
+# Features:
+#
+# @deprecated: This command is deprecated.  Use `query-accelerators`
+#     instead.
+#
 # Since: 0.14
 #
 # .. qmp-example::
@@ -36,7 +41,8 @@
 #     -> { "execute": "query-kvm" }
 #     <- { "return": { "enabled": true, "present": true } }
 ##
-{ 'command': 'query-kvm', 'returns': 'KvmInfo' }
+{ 'command': 'query-kvm', 'returns': 'KvmInfo',
+  'features': [ 'deprecated' ] }
 
 ##
 # @x-accel-stats:
Signature · 1 line
2.53.0
#2 lore raw

[PULL 2/6] scripts/checkpatch: Fix MAINTAINERS update warning with --terse

In reply to Markus Armbruster

We recently improved the MAINTAINERS update warning to show the files that trigger it. Example:

WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #105:
deleted file mode 100644

improved to

WARNING: added, moved or deleted file(s):

migration/threadinfo.h
migration/threadinfo.c

Does MAINTAINERS need updating?

Unfortunately, this made things worse with --terse, as only the first line of each warning is shown then.

WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?

became

WARNING: added, moved or deleted file(s):

Adjust the warning text to

WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
migration/threadinfo.h
migration/threadinfo.c

so we get the exact same warning as we used to with --terse.

Fixes 1d745e6d9635 (scripts/checkpatch: use new hook for MAINTAINERS update check)

Message-ID: <[email protected]>

---
 scripts/checkpatch.pl | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
scripts/checkpatch.pl +3 -3
index 3a9557417f..6f270becdc 100755
@@ -1473,9 +1473,9 @@ sub process_file_list {
 
 	# If we don't see a MAINTAINERS update, prod the user to check
 	if (int(@maybemaintainers) > 0 && !$sawmaintainers) {
-		WARN("added, moved or deleted file(s):\n\n  " .
-		     join("\n  ", @maybemaintainers) .
-		     "\n\nDoes MAINTAINERS need updating?\n");
+                WARN("added, moved or deleted file(s),"
+		     " does MAINTAINERS need updating?\n  "
+		     . join("\n  ", @maybemaintainers));
 	}
 }
 
Signature · 1 line
2.53.0
#3 lore raw

[PULL 3/6] error: Fix "to current monitor if we have one" comments

In reply to Markus Armbruster

A number of print functions are documented to print to "current monitor if we have one, else stderr". Wrong, they print to the current monitor only when it's HMP. This is the case since commit 4ad417baa43 (error: Print error_report() to stderr if using qmp).

Fix the comments to say "current HMP monitor if we have one".

Message-ID: <[email protected]>

---
 include/qapi/error.h |  3 ++-
 monitor/monitor.c    |  2 +-
 util/error-report.c  | 26 ++++++++++++++++----------
 util/qemu-print.c    |  4 ++--
 4 files changed, 21 insertions(+), 14 deletions(-)
include/qapi/error.h +2 -1
index 2356b84bb3..d1d37fc656 100644
@@ -64,7 +64,8 @@
  *
  * = Reporting and destroying errors =
  *
- * Report an error to the current monitor if we have one, else stderr:
+ * Report an error to the current HMP monitor if we have one, else
+ * stderr:
  *     error_report_err(err);
  * This frees the error object.
  *
monitor/monitor.c +1 -1
index 1273eb7260..c42d9fad58 100644
@@ -269,7 +269,7 @@ void monitor_printc(Monitor *mon, int c)
 }
 
 /*
- * Print to current monitor if we have one, else to stderr.
+ * Print to current HMP monitor if we have one, else to stderr.
  */
 int error_vprintf(const char *fmt, va_list ap)
 {
util/error-report.c +16 -10
index d6b7448183..ee8c5f3db7 100644
@@ -136,7 +136,8 @@ void loc_set_file(const char *fname, int lno)
 }
 
 /*
- * Print current location to current monitor if we have one, else to stderr.
+ * Print current location to current HMP monitor if we have one, else
+ * to stderr.
  */
 static void print_loc(void)
 {
@@ -176,7 +177,8 @@ char *real_time_iso8601(void)
 }
 
 /*
- * Print a message to current monitor if we have one, else to stderr.
+ * Print a message to current HMP monitor if we have one, else to
+ * stderr.
  * @report_type is the type of message: error, warning or informational.
  * Format arguments like vsprintf().  The resulting message should be
  * a single phrase, with no newline or trailing punctuation.
@@ -216,7 +218,8 @@ static void vreport(report_type type, const char *fmt, va_list ap)
 }
 
 /*
- * Print an error message to current monitor if we have one, else to stderr.
+ * Print an error message to current HMP monitor if we have one, else
+ * to stderr.
  * Format arguments like vsprintf().  The resulting message should be
  * a single phrase, with no newline or trailing punctuation.
  * Prepend the current location and append a newline.
@@ -228,7 +231,8 @@ void error_vreport(const char *fmt, va_list ap)
 }
 
 /*
- * Print a warning message to current monitor if we have one, else to stderr.
+ * Print a warning message to current HMP monitor if we have one, else
+ * to stderr.
  * Format arguments like vsprintf().  The resulting message should be
  * a single phrase, with no newline or trailing punctuation.
  * Prepend the current location and append a newline.
@@ -239,8 +243,8 @@ void warn_vreport(const char *fmt, va_list ap)
 }
 
 /*
- * Print an information message to current monitor if we have one, else to
- * stderr.
+ * Print an information message to current HMP monitor if we have one,
+ * else to stderr.
  * Format arguments like vsprintf().  The resulting message should be
  * a single phrase, with no newline or trailing punctuation.
  * Prepend the current location and append a newline.
@@ -251,7 +255,8 @@ void info_vreport(const char *fmt, va_list ap)
 }
 
 /*
- * Print an error message to current monitor if we have one, else to stderr.
+ * Print an error message to current HMP monitor if we have one, else
+ * to stderr.
  * Format arguments like sprintf().  The resulting message should be
  * a single phrase, with no newline or trailing punctuation.
  * Prepend the current location and append a newline.
@@ -267,7 +272,8 @@ void error_report(const char *fmt, ...)
 }
 
 /*
- * Print a warning message to current monitor if we have one, else to stderr.
+ * Print a warning message to current HMP monitor if we have one, else
+ * to stderr.
  * Format arguments like sprintf(). The resulting message should be a
  * single phrase, with no newline or trailing punctuation.
  * Prepend the current location and append a newline.
@@ -282,8 +288,8 @@ void warn_report(const char *fmt, ...)
 }
 
 /*
- * Print an information message to current monitor if we have one, else to
- * stderr.
+ * Print an information message to current HMP monitor if we have one,
+ * else to stderr.
  * Format arguments like sprintf(). The resulting message should be a
  * single phrase, with no newline or trailing punctuation.
  * Prepend the current location and append a newline.
util/qemu-print.c +2 -2
index 69ba612f56..4a30cd1a8e 100644
@@ -16,7 +16,7 @@
 
 /*
  * Print like vprintf().
- * Print to current monitor if we have one, else to stdout.
+ * Print to current HMP monitor if we have one, else to stdout.
  */
 int qemu_vprintf(const char *fmt, va_list ap)
 {
@@ -29,7 +29,7 @@ int qemu_vprintf(const char *fmt, va_list ap)
 
 /*
  * Print like printf().
- * Print to current monitor if we have one, else to stdout.
+ * Print to current HMP monitor if we have one, else to stdout.
  */
 int qemu_printf(const char *fmt, ...)
 {
Signature · 1 line
2.53.0
#4 lore raw

[PULL 5/6] qemu-print: Document qemu_fprintf(), qemu_vfprintf() failure

In reply to Markus Armbruster

These functions fail when @stream is null and the current monitor isn't HMP.

Message-ID: <[email protected]> [Comments rewritten in review]

---
 util/qemu-print.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
util/qemu-print.c +8 -2
index 4a30cd1a8e..7b9591035e 100644
@@ -44,7 +44,10 @@ int qemu_printf(const char *fmt, ...)
 
 /*
  * Print like vfprintf()
- * Print to @stream if non-null, else to current monitor.
+ * Print to @stream if non-null, else to current HMP monitor if we
+ * have one, else fail without printing anything.
+ * Return number of characters printed on success, negative value on
+ * error.
  */
 int qemu_vfprintf(FILE *stream, const char *fmt, va_list ap)
 {
@@ -56,7 +59,10 @@ int qemu_vfprintf(FILE *stream, const char *fmt, va_list ap)
 
 /*
  * Print like fprintf().
- * Print to @stream if non-null, else to current monitor.
+ * Print to @stream if non-null, else to current HMP monitor if we
+ * have one, else fail without printing anything.
+ * Return number of characters printed on success, negative value on
+ * error.
  */
 int qemu_fprintf(FILE *stream, const char *fmt, ...)
 {
Signature · 1 line
2.53.0
#5 lore raw

[PULL 4/6] error: Restore error_printf()'s function comment

In reply to Markus Armbruster

Lost in commit 397d30e9401 (qemu-error: remove dependency of stubs on monitor) many moons ago.

Message-ID: <[email protected]>

---
 util/error-report.c | 3 +++
 1 file changed, 3 insertions(+)
util/error-report.c +3 -0
index ee8c5f3db7..3d4e8854b4 100644
@@ -29,6 +29,9 @@ bool message_with_timestamp;
 bool error_with_guestname;
 const char *error_guest_name;
 
+/*
+ * Print to current HMP monitor if we have one, else to stderr.
+ */
 int error_printf(const char *fmt, ...)
 {
     va_list ap;
Signature · 1 line
2.53.0
#6 lore raw

[PULL 6/6] qdev-monitor: Fix qdev ID validation regression

In reply to Markus Armbruster

User-created qdevs with ID show up at /machine/peripheral/ID.

When we restricted QemOpts IDs to letters, digits, '-', '.', '_', starting with a letter in commit b560a9ab9be: (qemu-option: Reject anti-social IDs) a long time ago, this also covered qdev IDs. Looks like this:

(qemu) device_add usb-mouse,id=/
qemu-system-x86_64: Parameter 'id' expects an identifier Identifiers consist of letters, digits, '-', '.', '_', starting with a letter. Try "help device_add" for more information

QMP, however:

    {"execute": "device_add", "arguments": {"driver": "usb-mouse", "id": "/"}}
    {"return": {}}

This creates a device with canonical path "/machine/peripheral//". That way is madness.

We accidentally bypassed qdev ID validation for QMP when we cut the detour through QemuOpts in commit b30d8054642.

Fix by validating IDs one layer down, in qdev_set_id().

Arguably, QOM should protect itself from QOM path components containing '/', but let's just fix the regression for now.

Fixes be93fd53723c (qdev-monitor: avoid QemuOpts in QMP device_add)

Message-ID: <[email protected]>

---
 system/qdev-monitor.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
system/qdev-monitor.c +10 -2
index 1ac6d9a857..5c00bbf483 100644
@@ -34,6 +34,7 @@
 #include "qemu/config-file.h"
 #include "qemu/error-report.h"
 #include "qemu/help_option.h"
+#include "qemu/id.h"
 #include "qemu/option.h"
 #include "qemu/qemu-print.h"
 #include "qemu/option_int.h"
@@ -601,14 +602,17 @@ const char *qdev_set_id(DeviceState *dev, char *id, Error **errp)
      * has no parent
      */
     if (id) {
+        if (!id_wellformed(id)) {
+            error_setg(errp, "Invalid qdev ID '%s'", id);
+            goto err;
+        }
         prop = object_property_try_add_child(qdev_get_peripheral(), id,
                                              OBJECT(dev), NULL);
         if (prop) {
             dev->id = id;
         } else {
             error_setg(errp, "Duplicate device ID '%s'", id);
-            g_free(id);
-            return NULL;
+            goto err;
         }
     } else {
         static int anon_count;
@@ -619,6 +623,10 @@ const char *qdev_set_id(DeviceState *dev, char *id, Error **errp)
     }
 
     return prop->name;
+
+err:
+    g_free(id);
+    return NULL;
 }
 
 BusState *qdev_find_default_bus(DeviceClass *dc, Error **errp)
Signature · 1 line
2.53.0
#7 lore raw
In reply to Markus Armbruster
Quoted 8 lines · Markus Armbruster

The following changes since commit 3fb456e9a0e9eef6a71d9b49bfff596a0f0046e9:

Merge tag 'pull-request-2026-03-02' of https://gitlab.com/thuth/qemu into staging (2026-03-02 14:01:46 +0000)

are available in the Git repository at:

https://repo.or.cz/qemu/armbru.git tags/pull-misc-2026-03-05

fetching from remote https://repo.or.cz/qemu/armbru.git
tags/pull-misc-2026-03-05
fatal: https://repo.or.cz/qemu/armbru.git/info/refs not valid: is this a git repository?

Looking at it in a web browser:

Quoted 1 line

The repo.or.cz site is no longer available in the UK.

If you want your pullreqs applied you'll need to find a different place to host them, I'm afraid.

thanks
-- PMM

#8 lore raw
Quoted 8 lines · Peter Maydell
Quoted 7 lines · Markus Armbruster

The following changes since commit 3fb456e9a0e9eef6a71d9b49bfff596a0f0046e9:

Merge tag 'pull-request-2026-03-02' of https://gitlab.com/thuth/qemu into staging (2026-03-02 14:01:46 +0000)

are available in the Git repository at:

Quoted 10 lines
Quoted 1 line

https://repo.or.cz/qemu/armbru.git tags/pull-misc-2026-03-05

fetching from remote https://repo.or.cz/qemu/armbru.git
tags/pull-misc-2026-03-05
fatal: https://repo.or.cz/qemu/armbru.git/info/refs not valid: is this a git repository?

Looking at it in a web browser:

Quoted 1 line

The repo.or.cz site is no longer available in the UK.

https://repo.or.cz/uk-blocked.html

repo.or.cz / site guide / UK geoblocking

The repo.or.cz site is no longer available in the UK.

We hate it as much as you do, but starting 25 July 2025, UK's Online Safety Act 2023 would require us to do a prohibitively complicated risk assessment for our service. We're talking reading through thousands of pages of legal guidelines.

We're a volunteer operation and would likely be held responsible as individuals. There is talk of fines up to 18 million GBP which would ruin any single one of us, should they get creative about how to actually enforce this.

Our impression is that this law is deliberately vague, deliberately drastic in its enforcement provisions, and specifically aimed against websites of all sizes, including hobby projects. In other words, this seems to us to be largely indistinguishable from an attempt to basically break the internet for all UK citizens.

If we could afford to just hope for the best, we'd love to. After this, I know I will think twice about visiting the UK, but it's not like I can be completely certain that I will never have to...

Our most sincere apologies to our UK-based users.

For more details, see:

https://howto.geoblockthe.uk/
OnlineSafetyAct.co.uk (unofficial page)

To vary the famous motto of the Society for German–Soviet Friendship:
"Von der Volksrepublik China lernen heißt siegen lernen."

Quoted 2 lines

If you want your pullreqs applied you'll need to find a different place to host them, I'm afraid.

Looks like it.