All of lore.kernel.org
 help / color / mirror / Atom feed
* [PULL 0/5] Miscellaneous patches for 2026-05-05
@ 2026-05-05 11:50 Markus Armbruster
  2026-05-05 11:50 ` [PULL 1/5] hw/core: Deprecate query-kvm Markus Armbruster
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Markus Armbruster @ 2026-05-05 11:50 UTC (permalink / raw)
  To: qemu-devel; +Cc: stefanha

The following changes since commit ac0cc20ad2fe0b8df2e5d9458e90a095ac711ab1:

  Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging (2026-05-01 14:41:49 -0400)

are available in the Git repository at:

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

for you to fetch changes up to 8dc8f7b5bc755227c72eb74aa332e7a6bbb90066:

  qdev-monitor: Fix qdev ID validation regression (2026-05-05 12:52:26 +0200)

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

----------------------------------------------------------------
Markus Armbruster (5):
      hw/core: Deprecate query-kvm
      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 ++-
 system/qdev-monitor.c     | 12 ++++++++++--
 util/error-report.c       | 32 ++++++++++++++++++++++----------
 util/qemu-print.c         | 14 ++++++++++----
 6 files changed, 56 insertions(+), 18 deletions(-)

-- 
2.54.0



^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PULL 1/5] hw/core: Deprecate query-kvm
  2026-05-05 11:50 [PULL 0/5] Miscellaneous patches for 2026-05-05 Markus Armbruster
@ 2026-05-05 11:50 ` Markus Armbruster
  2026-05-05 11:50 ` [PULL 2/5] error: Fix "to current monitor if we have one" comments Markus Armbruster
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Markus Armbruster @ 2026-05-05 11:50 UTC (permalink / raw)
  To: qemu-devel; +Cc: stefanha, Daniel P. Berrangé, Philippe Mathieu-Daudé

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

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20260108131455.2240598-2-armbru@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
[Rebased, missing section title markup fixed]
---
 docs/about/deprecated.rst | 5 +++++
 qapi/accelerator.json     | 8 +++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst
index 10de10dc23..5551bd12ad 100644
--- a/docs/about/deprecated.rst
+++ b/docs/about/deprecated.rst
@@ -149,6 +149,11 @@ Use ``job-dismiss`` instead.
 
 Use ``job-finalize`` instead.
 
+``query-kvm`` (since 11.0)
+''''''''''''''''''''''''''
+
+Use ``query-accelerators`` instead.
+
 Human Machine Protocol (HMP) commands
 -------------------------------------
 
diff --git a/qapi/accelerator.json b/qapi/accelerator.json
index 0cf5e0f9d9..b59df37866 100644
--- a/qapi/accelerator.json
+++ b/qapi/accelerator.json
@@ -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:
-- 
2.54.0



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PULL 2/5] error: Fix "to current monitor if we have one" comments
  2026-05-05 11:50 [PULL 0/5] Miscellaneous patches for 2026-05-05 Markus Armbruster
  2026-05-05 11:50 ` [PULL 1/5] hw/core: Deprecate query-kvm Markus Armbruster
@ 2026-05-05 11:50 ` Markus Armbruster
  2026-05-05 11:50 ` [PULL 3/5] error: Restore error_printf()'s function comment Markus Armbruster
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Markus Armbruster @ 2026-05-05 11:50 UTC (permalink / raw)
  To: qemu-devel; +Cc: stefanha, Daniel P. Berrangé

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".

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20260114124713.3308719-2-armbru@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
[Commit a582a5784e5f (monitor: move error_vprintf back to
error-report.c) lost a comment this commit fixes, restore it]
---
 include/qapi/error.h |  3 ++-
 util/error-report.c  | 29 +++++++++++++++++++----------
 util/qemu-print.c    |  4 ++--
 3 files changed, 23 insertions(+), 13 deletions(-)

diff --git a/include/qapi/error.h b/include/qapi/error.h
index 2356b84bb3..d1d37fc656 100644
--- a/include/qapi/error.h
+++ b/include/qapi/error.h
@@ -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.
  *
diff --git a/util/error-report.c b/util/error-report.c
index bbea49a55d..92b04915ce 100644
--- a/util/error-report.c
+++ b/util/error-report.c
@@ -62,6 +62,9 @@ error_printf_mon(Monitor *cur_mon, const char *fmt, ...)
     return ret;
 }
 
+/*
+ * Print to the current HMP monitor if we have one, else to stderr.
+ */
 int error_vprintf(const char *fmt, va_list ap)
 {
     return error_vprintf_mon(monitor_cur(), fmt, ap);
@@ -174,7 +177,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(Monitor *cur)
 {
@@ -214,7 +218,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.
@@ -270,7 +275,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.
@@ -282,7 +288,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.
@@ -293,8 +300,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.
@@ -305,7 +312,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.
@@ -321,7 +329,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.
@@ -336,8 +345,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.
diff --git a/util/qemu-print.c b/util/qemu-print.c
index 69ba612f56..4a30cd1a8e 100644
--- a/util/qemu-print.c
+++ b/util/qemu-print.c
@@ -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, ...)
 {
-- 
2.54.0



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PULL 3/5] error: Restore error_printf()'s function comment
  2026-05-05 11:50 [PULL 0/5] Miscellaneous patches for 2026-05-05 Markus Armbruster
  2026-05-05 11:50 ` [PULL 1/5] hw/core: Deprecate query-kvm Markus Armbruster
  2026-05-05 11:50 ` [PULL 2/5] error: Fix "to current monitor if we have one" comments Markus Armbruster
@ 2026-05-05 11:50 ` Markus Armbruster
  2026-05-05 11:50 ` [PULL 4/5] qemu-print: Document qemu_fprintf(), qemu_vfprintf() failure Markus Armbruster
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Markus Armbruster @ 2026-05-05 11:50 UTC (permalink / raw)
  To: qemu-devel; +Cc: stefanha, Daniel P. Berrangé

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

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20260114124713.3308719-3-armbru@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
[Trivial conflict with commit a582a5784e5f (monitor: move
error_vprintf back to error-report.c) resolved]
---
 util/error-report.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/util/error-report.c b/util/error-report.c
index 92b04915ce..f832ad9b6b 100644
--- a/util/error-report.c
+++ b/util/error-report.c
@@ -70,6 +70,9 @@ int error_vprintf(const char *fmt, va_list ap)
     return error_vprintf_mon(monitor_cur(), fmt, ap);
 }
 
+/*
+ * Print to the current HMP monitor if we have one, else to stderr.
+ */
 int error_printf(const char *fmt, ...)
 {
     va_list ap;
-- 
2.54.0



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PULL 4/5] qemu-print: Document qemu_fprintf(), qemu_vfprintf() failure
  2026-05-05 11:50 [PULL 0/5] Miscellaneous patches for 2026-05-05 Markus Armbruster
                   ` (2 preceding siblings ...)
  2026-05-05 11:50 ` [PULL 3/5] error: Restore error_printf()'s function comment Markus Armbruster
@ 2026-05-05 11:50 ` Markus Armbruster
  2026-05-05 11:50 ` [PULL 5/5] qdev-monitor: Fix qdev ID validation regression Markus Armbruster
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Markus Armbruster @ 2026-05-05 11:50 UTC (permalink / raw)
  To: qemu-devel; +Cc: stefanha

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

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20260114124713.3308719-4-armbru@redhat.com>
[Comments rewritten in review]
---
 util/qemu-print.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/util/qemu-print.c b/util/qemu-print.c
index 4a30cd1a8e..7b9591035e 100644
--- a/util/qemu-print.c
+++ b/util/qemu-print.c
@@ -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, ...)
 {
-- 
2.54.0



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PULL 5/5] qdev-monitor: Fix qdev ID validation regression
  2026-05-05 11:50 [PULL 0/5] Miscellaneous patches for 2026-05-05 Markus Armbruster
                   ` (3 preceding siblings ...)
  2026-05-05 11:50 ` [PULL 4/5] qemu-print: Document qemu_fprintf(), qemu_vfprintf() failure Markus Armbruster
@ 2026-05-05 11:50 ` Markus Armbruster
  2026-05-05 12:00 ` [PULL 0/5] Miscellaneous patches for 2026-05-05 Philippe Mathieu-Daudé
  2026-05-05 18:26 ` Stefan Hajnoczi
  6 siblings, 0 replies; 8+ messages in thread
From: Markus Armbruster @ 2026-05-05 11:50 UTC (permalink / raw)
  To: qemu-devel; +Cc: stefanha

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)
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20260123085924.1392134-1-armbru@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 system/qdev-monitor.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/system/qdev-monitor.c b/system/qdev-monitor.c
index 1ac6d9a857..5c00bbf483 100644
--- a/system/qdev-monitor.c
+++ b/system/qdev-monitor.c
@@ -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)
-- 
2.54.0



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PULL 0/5] Miscellaneous patches for 2026-05-05
  2026-05-05 11:50 [PULL 0/5] Miscellaneous patches for 2026-05-05 Markus Armbruster
                   ` (4 preceding siblings ...)
  2026-05-05 11:50 ` [PULL 5/5] qdev-monitor: Fix qdev ID validation regression Markus Armbruster
@ 2026-05-05 12:00 ` Philippe Mathieu-Daudé
  2026-05-05 18:26 ` Stefan Hajnoczi
  6 siblings, 0 replies; 8+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-05-05 12:00 UTC (permalink / raw)
  To: Markus Armbruster, qemu-devel; +Cc: stefanha

Hi Markus,

On 5/5/26 13:50, Markus Armbruster wrote:
> The following changes since commit ac0cc20ad2fe0b8df2e5d9458e90a095ac711ab1:
> 
>    Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging (2026-05-01 14:41:49 -0400)
> 
> are available in the Git repository at:
> 
>    https://repo.or.cz/qemu/armbru.git tags/pull-misc-2026-05-05
> 
> for you to fetch changes up to 8dc8f7b5bc755227c72eb74aa332e7a6bbb90066:
> 
>    qdev-monitor: Fix qdev ID validation regression (2026-05-05 12:52:26 +0200)
> 
> ----------------------------------------------------------------
> Miscellaneous patches for 2026-05-05
> 
> ----------------------------------------------------------------
> Markus Armbruster (5):
>        hw/core: Deprecate query-kvm
>        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

My single-binary pull request is blocked since you said you wanted to
have a look at this series:
https://lore.kernel.org/qemu-devel/20260427080738.77138-1-philmd@linaro.org/



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PULL 0/5] Miscellaneous patches for 2026-05-05
  2026-05-05 11:50 [PULL 0/5] Miscellaneous patches for 2026-05-05 Markus Armbruster
                   ` (5 preceding siblings ...)
  2026-05-05 12:00 ` [PULL 0/5] Miscellaneous patches for 2026-05-05 Philippe Mathieu-Daudé
@ 2026-05-05 18:26 ` Stefan Hajnoczi
  6 siblings, 0 replies; 8+ messages in thread
From: Stefan Hajnoczi @ 2026-05-05 18:26 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: qemu-devel, stefanha

[-- Attachment #1: Type: text/plain, Size: 116 bytes --]

Applied, thanks.

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-05-05 18:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-05 11:50 [PULL 0/5] Miscellaneous patches for 2026-05-05 Markus Armbruster
2026-05-05 11:50 ` [PULL 1/5] hw/core: Deprecate query-kvm Markus Armbruster
2026-05-05 11:50 ` [PULL 2/5] error: Fix "to current monitor if we have one" comments Markus Armbruster
2026-05-05 11:50 ` [PULL 3/5] error: Restore error_printf()'s function comment Markus Armbruster
2026-05-05 11:50 ` [PULL 4/5] qemu-print: Document qemu_fprintf(), qemu_vfprintf() failure Markus Armbruster
2026-05-05 11:50 ` [PULL 5/5] qdev-monitor: Fix qdev ID validation regression Markus Armbruster
2026-05-05 12:00 ` [PULL 0/5] Miscellaneous patches for 2026-05-05 Philippe Mathieu-Daudé
2026-05-05 18:26 ` Stefan Hajnoczi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.