On Wed, Oct 7, 2026 at 3:42 PM Philippe Mathieu-Daudé
<[email protected]> wrote:
>
> On 6/10/26 15:56, Daniel P. Berrangé wrote:
>
> > Current git master is exhibiting a regression compared to previous
> > releases.
> >
> > For example on 10.1.0:
> >
> > $ for i in /usr/bin/qemu-system-* ; do echo -n "$i: " ; echo -e 
> > '{"execute":"qmp_capabilities"}\r\n{"execute":"query-target"}\r\n{"execute":"quit"}\r\n'
> >  | $i -qmp stdio -display none -M none | jq .return.arch | grep -v null ; 
> > done
>
> > /usr/bin/qemu-system-xtensa: "xtensa"
> > /usr/bin/qemu-system-xtensaeb: "xtensaeb"
> >
> >
> > but on git master:
> >
> > $ for i in $(find ./build -type f -name 'qemu-system-*') ; do echo -n "$i: 
> > " ; echo -e 
> > '{"execute":"qmp_capabilities"}\r\n{"execute":"query-target"}\r\n{"execute":"quit"}\r\n'
> >  | $i -qmp stdio -display none -M none | jq .return.arch | grep -v null ; 
> > done
>
>
> > ./build/qemu-system-xtensa: "xtensa"
> > ./build/qemu-system-xtensaeb: "xtensa"
>
> > so we need to fix that behaviour change for query-target.
> On a side note it would be helpful to have such test in CI :)

I have already done that in
https://patchew.org/QEMU/[email protected]/[email protected]/

Check that query-target reports the target identity selected by the qtest
binary, including softmmu variants.

Signed-off-by: Yonggang Luo <[email protected]>
---
 tests/qtest/qmp-test.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/tests/qtest/qmp-test.c b/tests/qtest/qmp-test.c
index 927ab053f8..c70f6a681c 100644
--- a/tests/qtest/qmp-test.c
+++ b/tests/qtest/qmp-test.c
@@ -164,6 +164,18 @@ static void test_qmp_protocol(void)
     qtest_quit(qts);
 }

+static void test_query_target(void)
+{
+    QTestState *qts = qtest_init(common_args);
+    QDict *target;
+
+    target = qtest_qmp_assert_success_ref(qts,
+                                          "{ 'execute': 'query-target' }");
+    g_assert_cmpstr(qdict_get_try_str(target, "arch"), ==, qtest_get_arch());
+    qobject_unref(target);
+    qtest_quit(qts);
+}
+
 #ifndef _WIN32

 /* Out-of-band tests */
@@ -517,6 +529,7 @@ int main(int argc, char *argv[])
     g_test_init(&argc, &argv, NULL);

     qtest_add_func("qmp/protocol", test_qmp_protocol);
+    qtest_add_func("qmp/query-target", test_query_target);
 #ifndef _WIN32
     /* This case calls mkfifo() which does not exist on win32 */
     qtest_add_func("qmp/oob", test_qmp_oob);
-- 
2.55.0.windows.3

-- 
         此致
礼
罗勇刚
Yours
    sincerely,
Yonggang Luo

Reply via email to