qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PULL 0/5] Testing patches for 2025-09-01
@ 2025-09-01 11:52 Markus Armbruster
  2025-09-01 11:52 ` [PULL 1/5] qtest/qom-test: Shallow testing of qom-list / qom-get Markus Armbruster
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Markus Armbruster @ 2025-09-01 11:52 UTC (permalink / raw)
  To: qemu-devel; +Cc: richard.henderson

The following changes since commit 91589bcd9fee0e66b241d04e5f37cd4f218187a2:

  Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging (2025-08-31 09:08:09 +1000)

are available in the Git repository at:

  https://repo.or.cz/qemu/armbru.git tags/pull-tests-2025-09-01

for you to fetch changes up to c9a1ea9c52e6462ad5c7814f3abd65baa69dc4ce:

  Revert "tests/qtest: use qos_printf instead of g_test_message" (2025-09-01 13:44:28 +0200)

----------------------------------------------------------------
Testing patches for 2025-09-01

----------------------------------------------------------------
Markus Armbruster (5):
      qtest/qom-test: Shallow testing of qom-list / qom-get
      qtest/qom-test: Traverse entire QOM tree
      qtest/qom-test: Don't bother to execute QMP command quit
      MAINTAINERS: Cover tests/qtest/qom-test.c
      Revert "tests/qtest: use qos_printf instead of g_test_message"

 MAINTAINERS                   |  1 +
 tests/qtest/qom-test.c        |  8 ++------
 tests/qtest/qos-test.c        |  5 -----
 tests/qtest/vhost-user-test.c | 27 +++++++++++++--------------
 4 files changed, 16 insertions(+), 25 deletions(-)

-- 
2.49.0




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

* [PULL 1/5] qtest/qom-test: Shallow testing of qom-list / qom-get
  2025-09-01 11:52 [PULL 0/5] Testing patches for 2025-09-01 Markus Armbruster
@ 2025-09-01 11:52 ` Markus Armbruster
  2025-09-01 11:52 ` [PULL 2/5] qtest/qom-test: Traverse entire QOM tree Markus Armbruster
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Markus Armbruster @ 2025-09-01 11:52 UTC (permalink / raw)
  To: qemu-devel; +Cc: richard.henderson, Steve Sistare

This test traverses the QOM sub-tree rooted at /machine with a
combination of qom-list and qom-get.  In my x86_64 testing, it runs
almost 12000 QMP commands in 34 seconds.  With -m slow, we test more
machines, and it takes almost 84000 commands in almost four minutes.

Since commit 3dd93992ffb (tests/qtest/qom-test: unit test for
qom-list-get), the test traverses this tree a second time, with
qom-list-get.  In my x86_64 testing, this takes some 200 QMP commands
and around two seconds, and some 1100 in just under 12s with -m slow.

Traversing the entire tree is useful, because it exercise the QOM
property getters.  Traversing it twice not so much.

Make the qom-list / qom-get test shallow unless -m slow is given:
don't recurse.  Cuts the number of commands to around 600, and run
time to under 5s for me.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20250725135034.2280477-3-armbru@redhat.com>
Reviewed-by: Steve Sistare <steven.sistare@oracle.com>
---
 tests/qtest/qom-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/qtest/qom-test.c b/tests/qtest/qom-test.c
index 4ade1c728c..7dea0d802d 100644
--- a/tests/qtest/qom-test.c
+++ b/tests/qtest/qom-test.c
@@ -180,7 +180,7 @@ static void test_properties(QTestState *qts, const char *path, bool recurse)
         links = g_slist_delete_link(links, links);
     }
     while (children) {
-        test_properties(qts, children->data, true);
+        test_properties(qts, children->data, g_test_slow());
         g_free(children->data);
         children = g_slist_delete_link(children, children);
     }
-- 
2.49.0




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

* [PULL 2/5] qtest/qom-test: Traverse entire QOM tree
  2025-09-01 11:52 [PULL 0/5] Testing patches for 2025-09-01 Markus Armbruster
  2025-09-01 11:52 ` [PULL 1/5] qtest/qom-test: Shallow testing of qom-list / qom-get Markus Armbruster
@ 2025-09-01 11:52 ` Markus Armbruster
  2025-09-01 11:52 ` [PULL 3/5] qtest/qom-test: Don't bother to execute QMP command quit Markus Armbruster
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Markus Armbruster @ 2025-09-01 11:52 UTC (permalink / raw)
  To: qemu-devel; +Cc: richard.henderson, Steve Sistare

This test traverses the QOM sub-tree rooted at /machine.  Traverse the
entire tree instead.

The x86_64 test runs some 40 additional QMP commands, and stays under
5s for me.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20250725135034.2280477-4-armbru@redhat.com>
Reviewed-by: Steve Sistare <steven.sistare@oracle.com>
---
 tests/qtest/qom-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/qtest/qom-test.c b/tests/qtest/qom-test.c
index 7dea0d802d..a2db56bf22 100644
--- a/tests/qtest/qom-test.c
+++ b/tests/qtest/qom-test.c
@@ -211,7 +211,7 @@ static void test_machine(gconstpointer data)
 
     test_properties(qts, "/machine", true);
 
-    qlist_append_str(paths, "/machine");
+    qlist_append_str(paths, "/");
     test_list_get(qts, paths);
     test_list_get_value(qts);
 
-- 
2.49.0




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

* [PULL 3/5] qtest/qom-test: Don't bother to execute QMP command quit
  2025-09-01 11:52 [PULL 0/5] Testing patches for 2025-09-01 Markus Armbruster
  2025-09-01 11:52 ` [PULL 1/5] qtest/qom-test: Shallow testing of qom-list / qom-get Markus Armbruster
  2025-09-01 11:52 ` [PULL 2/5] qtest/qom-test: Traverse entire QOM tree Markus Armbruster
@ 2025-09-01 11:52 ` Markus Armbruster
  2025-09-01 11:52 ` [PULL 4/5] MAINTAINERS: Cover tests/qtest/qom-test.c Markus Armbruster
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Markus Armbruster @ 2025-09-01 11:52 UTC (permalink / raw)
  To: qemu-devel; +Cc: richard.henderson, Steve Sistare

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20250725135034.2280477-5-armbru@redhat.com>
Reviewed-by: Steve Sistare <steven.sistare@oracle.com>
---
 tests/qtest/qom-test.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/tests/qtest/qom-test.c b/tests/qtest/qom-test.c
index a2db56bf22..2da9918e16 100644
--- a/tests/qtest/qom-test.c
+++ b/tests/qtest/qom-test.c
@@ -215,10 +215,6 @@ static void test_machine(gconstpointer data)
     test_list_get(qts, paths);
     test_list_get_value(qts);
 
-    response = qtest_qmp(qts, "{ 'execute': 'quit' }");
-    g_assert(qdict_haskey(response, "return"));
-    qobject_unref(response);
-
     qtest_quit(qts);
     g_free((void *)machine);
 }
-- 
2.49.0




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

* [PULL 4/5] MAINTAINERS: Cover tests/qtest/qom-test.c
  2025-09-01 11:52 [PULL 0/5] Testing patches for 2025-09-01 Markus Armbruster
                   ` (2 preceding siblings ...)
  2025-09-01 11:52 ` [PULL 3/5] qtest/qom-test: Don't bother to execute QMP command quit Markus Armbruster
@ 2025-09-01 11:52 ` Markus Armbruster
  2025-09-01 11:53 ` [PULL 5/5] Revert "tests/qtest: use qos_printf instead of g_test_message" Markus Armbruster
  2025-09-02 13:47 ` [PULL 0/5] Testing patches for 2025-09-01 Richard Henderson
  5 siblings, 0 replies; 7+ messages in thread
From: Markus Armbruster @ 2025-09-01 11:52 UTC (permalink / raw)
  To: qemu-devel; +Cc: richard.henderson

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20250725135034.2280477-6-armbru@redhat.com>
---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 8147fff352..0207946537 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3454,6 +3454,7 @@ F: qom/
 F: tests/unit/check-qom-interface.c
 F: tests/unit/check-qom-proplist.c
 F: tests/unit/test-qdev-global-props.c
+F: tests/qtest/qom-test.c
 
 QOM boilerplate conversion script
 M: Eduardo Habkost <eduardo@habkost.net>
-- 
2.49.0




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

* [PULL 5/5] Revert "tests/qtest: use qos_printf instead of g_test_message"
  2025-09-01 11:52 [PULL 0/5] Testing patches for 2025-09-01 Markus Armbruster
                   ` (3 preceding siblings ...)
  2025-09-01 11:52 ` [PULL 4/5] MAINTAINERS: Cover tests/qtest/qom-test.c Markus Armbruster
@ 2025-09-01 11:53 ` Markus Armbruster
  2025-09-02 13:47 ` [PULL 0/5] Testing patches for 2025-09-01 Richard Henderson
  5 siblings, 0 replies; 7+ messages in thread
From: Markus Armbruster @ 2025-09-01 11:53 UTC (permalink / raw)
  To: qemu-devel; +Cc: richard.henderson

This reverts commit 30ea13e9d97dcbd4ea541ddf9e8857fa1d5cb30f.

Also rewrites qos_printf() calls added later.

"make check" prints many lines like

    stdout: 138: UNKNOWN:     # # qos_test running single test in subprocess
    stdout: 139: UNKNOWN:     # # set_protocol_features: 0x42
    stdout: 140: UNKNOWN:     # # set_owner: start of session
    stdout: 141: UNKNOWN:     # # vhost-user: un-handled message: 14
    stdout: 142: UNKNOWN:     # # vhost-user: un-handled message: 14
    stdout: 143: UNKNOWN:     # # set_vring(0)=enabled
    stdout: 144: UNKNOWN:     # # set_vring(1)=enabled
    stdout: 145: UNKNOWN:     # # set_vring(0)=enabled
    stdout: 146: UNKNOWN:     # # set_vring(1)=enabled
    stdout: 147: UNKNOWN:     # # set_vring(0)=enabled
    stdout: 148: UNKNOWN:     # # set_vring(1)=enabled
    stdout: 149: UNKNOWN:     # # set_vring(0)=enabled
    stdout: 150: UNKNOWN:     # # set_vring(1)=enabled
    stdout: 151: UNKNOWN:     # # set_vring(0)=enabled
    stdout: 152: UNKNOWN:     # # set_vring(1)=enabled
    stdout: 153: UNKNOWN:     # # set_vring_num: 0/256
    stdout: 154: UNKNOWN:     # # set_vring_addr: 0x7f9060000000/0x7f905ffff000/0x7f9060001000

Turns out this is qos-test, and the culprit is a commit meant to ease
debugging.  Revert it until a better solution is found.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20250728145747.3165315-1-armbru@redhat.com>
[Commit message clarified]
---
 tests/qtest/qos-test.c        |  5 -----
 tests/qtest/vhost-user-test.c | 27 +++++++++++++--------------
 2 files changed, 13 insertions(+), 19 deletions(-)

diff --git a/tests/qtest/qos-test.c b/tests/qtest/qos-test.c
index abfd4b9512..00f39f33f6 100644
--- a/tests/qtest/qos-test.c
+++ b/tests/qtest/qos-test.c
@@ -328,11 +328,6 @@ static void walk_path(QOSGraphNode *orig_path, int len)
 int main(int argc, char **argv, char** envp)
 {
     g_test_init(&argc, &argv, NULL);
-
-    if (g_test_subprocess()) {
-        qos_printf("qos_test running single test in subprocess\n");
-    }
-
     if (g_test_verbose()) {
         qos_printf("ENVIRONMENT VARIABLES: {\n");
         for (char **env = envp; *env != 0; env++) {
diff --git a/tests/qtest/vhost-user-test.c b/tests/qtest/vhost-user-test.c
index 75cb3e44b2..56472ca709 100644
--- a/tests/qtest/vhost-user-test.c
+++ b/tests/qtest/vhost-user-test.c
@@ -26,7 +26,6 @@
 #include "libqos/virtio-pci.h"
 
 #include "libqos/malloc-pc.h"
-#include "libqos/qgraph_internal.h"
 #include "hw/virtio/virtio-net.h"
 
 #include "standard-headers/linux/vhost_types.h"
@@ -345,7 +344,7 @@ static void chr_read(void *opaque, const uint8_t *buf, int size)
     }
 
     if (size != VHOST_USER_HDR_SIZE) {
-        qos_printf("%s: Wrong message size received %d\n", __func__, size);
+        g_test_message("Wrong message size received %d", size);
         return;
     }
 
@@ -356,8 +355,8 @@ static void chr_read(void *opaque, const uint8_t *buf, int size)
         p += VHOST_USER_HDR_SIZE;
         size = qemu_chr_fe_read_all(chr, p, msg.size);
         if (size != msg.size) {
-            qos_printf("%s: Wrong message size received %d != %d\n",
-                       __func__, size, msg.size);
+            g_test_message("Wrong message size received %d != %d",
+                           size, msg.size);
             goto out;
         }
     }
@@ -393,7 +392,7 @@ static void chr_read(void *opaque, const uint8_t *buf, int size)
          * We don't need to do anything here, the remote is just
          * letting us know it is in charge. Just log it.
          */
-        qos_printf("set_owner: start of session\n");
+        g_test_message("set_owner: start of session\n");
         break;
 
     case VHOST_USER_GET_PROTOCOL_FEATURES:
@@ -419,7 +418,7 @@ static void chr_read(void *opaque, const uint8_t *buf, int size)
          * the remote end to send this. There is no handshake reply so
          * just log the details for debugging.
          */
-        qos_printf("set_protocol_features: 0x%"PRIx64 "\n", msg.payload.u64);
+        g_test_message("set_protocol_features: 0x%"PRIx64 "\n", msg.payload.u64);
         break;
 
         /*
@@ -427,11 +426,11 @@ static void chr_read(void *opaque, const uint8_t *buf, int size)
          * address of the vrings but we can simply report them.
          */
     case VHOST_USER_SET_VRING_NUM:
-        qos_printf("set_vring_num: %d/%d\n",
+        g_test_message("set_vring_num: %d/%d\n",
                    msg.payload.state.index, msg.payload.state.num);
         break;
     case VHOST_USER_SET_VRING_ADDR:
-        qos_printf("set_vring_addr: 0x%"PRIx64"/0x%"PRIx64"/0x%"PRIx64"\n",
+        g_test_message("set_vring_addr: 0x%"PRIx64"/0x%"PRIx64"/0x%"PRIx64"\n",
                    msg.payload.addr.avail_user_addr,
                    msg.payload.addr.desc_user_addr,
                    msg.payload.addr.used_user_addr);
@@ -464,7 +463,7 @@ static void chr_read(void *opaque, const uint8_t *buf, int size)
     case VHOST_USER_SET_VRING_CALL:
         /* consume the fd */
         if (!qemu_chr_fe_get_msgfds(chr, &fd, 1) && fd < 0) {
-            qos_printf("call fd: %d, do not set non-blocking\n", fd);
+            g_test_message("call fd: %d, do not set non-blocking\n", fd);
             break;
         }
         /*
@@ -510,12 +509,12 @@ static void chr_read(void *opaque, const uint8_t *buf, int size)
          * fully functioning vhost-user we would enable/disable the
          * vring monitoring.
          */
-        qos_printf("set_vring(%d)=%s\n", msg.payload.state.index,
+        g_test_message("set_vring(%d)=%s\n", msg.payload.state.index,
                    msg.payload.state.num ? "enabled" : "disabled");
         break;
 
     default:
-        qos_printf("vhost-user: un-handled message: %d\n", msg.request);
+        g_test_message("vhost-user: un-handled message: %d\n", msg.request);
         break;
     }
 
@@ -539,7 +538,7 @@ static const char *init_hugepagefs(void)
     }
 
     if (access(path, R_OK | W_OK | X_OK)) {
-        qos_printf("access on path (%s): %s", path, strerror(errno));
+        g_test_message("access on path (%s): %s", path, strerror(errno));
         g_test_fail();
         return NULL;
     }
@@ -549,13 +548,13 @@ static const char *init_hugepagefs(void)
     } while (ret != 0 && errno == EINTR);
 
     if (ret != 0) {
-        qos_printf("statfs on path (%s): %s", path, strerror(errno));
+        g_test_message("statfs on path (%s): %s", path, strerror(errno));
         g_test_fail();
         return NULL;
     }
 
     if (fs.f_type != HUGETLBFS_MAGIC) {
-        qos_printf("Warning: path not on HugeTLBFS: %s", path);
+        g_test_message("Warning: path not on HugeTLBFS: %s", path);
         g_test_fail();
         return NULL;
     }
-- 
2.49.0




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

* Re: [PULL 0/5] Testing patches for 2025-09-01
  2025-09-01 11:52 [PULL 0/5] Testing patches for 2025-09-01 Markus Armbruster
                   ` (4 preceding siblings ...)
  2025-09-01 11:53 ` [PULL 5/5] Revert "tests/qtest: use qos_printf instead of g_test_message" Markus Armbruster
@ 2025-09-02 13:47 ` Richard Henderson
  5 siblings, 0 replies; 7+ messages in thread
From: Richard Henderson @ 2025-09-02 13:47 UTC (permalink / raw)
  To: Markus Armbruster, qemu-devel

On 9/1/25 21:52, Markus Armbruster wrote:
> The following changes since commit 91589bcd9fee0e66b241d04e5f37cd4f218187a2:
> 
>    Merge tag 'for-upstream' ofhttps://gitlab.com/bonzini/qemu into staging (2025-08-31 09:08:09 +1000)
> 
> are available in the Git repository at:
> 
>    https://repo.or.cz/qemu/armbru.git tags/pull-tests-2025-09-01
> 
> for you to fetch changes up to c9a1ea9c52e6462ad5c7814f3abd65baa69dc4ce:
> 
>    Revert "tests/qtest: use qos_printf instead of g_test_message" (2025-09-01 13:44:28 +0200)
> 
> ----------------------------------------------------------------
> Testing patches for 2025-09-01


Applied, thanks.  Please update https://wiki.qemu.org/ChangeLog/10.2 as appropriate.

r~


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

end of thread, other threads:[~2025-09-02 13:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-01 11:52 [PULL 0/5] Testing patches for 2025-09-01 Markus Armbruster
2025-09-01 11:52 ` [PULL 1/5] qtest/qom-test: Shallow testing of qom-list / qom-get Markus Armbruster
2025-09-01 11:52 ` [PULL 2/5] qtest/qom-test: Traverse entire QOM tree Markus Armbruster
2025-09-01 11:52 ` [PULL 3/5] qtest/qom-test: Don't bother to execute QMP command quit Markus Armbruster
2025-09-01 11:52 ` [PULL 4/5] MAINTAINERS: Cover tests/qtest/qom-test.c Markus Armbruster
2025-09-01 11:53 ` [PULL 5/5] Revert "tests/qtest: use qos_printf instead of g_test_message" Markus Armbruster
2025-09-02 13:47 ` [PULL 0/5] Testing patches for 2025-09-01 Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).