qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 0/3] qtest patches
@ 2018-11-20 10:52 Thomas Huth
  2018-11-20 10:52 ` [Qemu-devel] [PULL 1/3] tests: add qmp/missing-any-arg test Thomas Huth
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Thomas Huth @ 2018-11-20 10:52 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell
  Cc: Marc-André Lureau, Markus Armbruster, Laurent Vivier,
	Thomas Huth

 Hi Peter,

the following changes since commit d304cf014bf9feec3dcd7ee65c75a7f52206ecdf:

  Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20181119' into staging (2018-11-19 15:58:17 +0000)

are available in the git repository at:

  https://gitlab.com/huth/qemu.git tags/pull-request-2018-11-20

for you to fetch changes up to ced09f9b07e425690d3bfe524cf93c4dbf4b26bc:

  qtest: log QEMU command line (2018-11-20 10:49:12 +0100)

----------------------------------------------------------------
- One additional simple qmp-test
- A fix for ide-test
- Add logging of QEMU parameters in libqtest
----------------------------------------------------------------

Marc-André Lureau (1):
      tests: add qmp/missing-any-arg test

Paolo Bonzini (1):
      qtest: log QEMU command line

Thomas Huth (1):
      tests/ide: Free pcibus when finishing a test

 tests/ide-test.c |  4 ++++
 tests/libqtest.c | 26 +++++++++++++++-----------
 tests/qmp-test.c | 14 ++++++++++++++
 3 files changed, 33 insertions(+), 11 deletions(-)

Marc-André Lureau (1):
  tests: add qmp/missing-any-arg test

Paolo Bonzini (1):
  qtest: log QEMU command line

Thomas Huth (1):
  tests/ide: Free pcibus when finishing a test

 tests/ide-test.c |  4 ++++
 tests/libqtest.c | 26 +++++++++++++++-----------
 tests/qmp-test.c | 14 ++++++++++++++
 3 files changed, 33 insertions(+), 11 deletions(-)

-- 
1.8.3.1

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

* [Qemu-devel] [PULL 1/3] tests: add qmp/missing-any-arg test
  2018-11-20 10:52 [Qemu-devel] [PULL 0/3] qtest patches Thomas Huth
@ 2018-11-20 10:52 ` Thomas Huth
  2018-11-20 10:52 ` [Qemu-devel] [PULL 2/3] tests/ide: Free pcibus when finishing a test Thomas Huth
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Thomas Huth @ 2018-11-20 10:52 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell
  Cc: Marc-André Lureau, Markus Armbruster, Laurent Vivier,
	Thomas Huth

From: Marc-André Lureau <marcandre.lureau@redhat.com>

test_qmp_missing_any_arg() is about a bug in infrastructure used by
the QMP core, fixed in commit c489780203.  We covered the bug in
infrastructure unit tests (commit bce3035a44).  Let's test
it at the QMP level as well.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
[thuth: Tweaked the commit message according to Markus' suggestion]
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/qmp-test.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/tests/qmp-test.c b/tests/qmp-test.c
index 6c419f6..7517be4 100644
--- a/tests/qmp-test.c
+++ b/tests/qmp-test.c
@@ -318,6 +318,19 @@ static void test_qmp_preconfig(void)
     qtest_quit(qs);
 }
 
+static void test_qmp_missing_any_arg(void)
+{
+    QTestState *qts;
+    QDict *resp;
+
+    qts = qtest_init(common_args);
+    resp = qtest_qmp(qts, "{'execute': 'qom-set', 'arguments':"
+                     " { 'path': '/machine', 'property': 'rtc-time' } }");
+    g_assert_nonnull(resp);
+    qmp_assert_error_class(resp, "GenericError");
+    qtest_quit(qts);
+}
+
 int main(int argc, char *argv[])
 {
     g_test_init(&argc, &argv, NULL);
@@ -325,6 +338,7 @@ int main(int argc, char *argv[])
     qtest_add_func("qmp/protocol", test_qmp_protocol);
     qtest_add_func("qmp/oob", test_qmp_oob);
     qtest_add_func("qmp/preconfig", test_qmp_preconfig);
+    qtest_add_func("qmp/missing-any-arg", test_qmp_missing_any_arg);
 
     return g_test_run();
 }
-- 
1.8.3.1

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

* [Qemu-devel] [PULL 2/3] tests/ide: Free pcibus when finishing a test
  2018-11-20 10:52 [Qemu-devel] [PULL 0/3] qtest patches Thomas Huth
  2018-11-20 10:52 ` [Qemu-devel] [PULL 1/3] tests: add qmp/missing-any-arg test Thomas Huth
@ 2018-11-20 10:52 ` Thomas Huth
  2018-11-20 10:52 ` [Qemu-devel] [PULL 3/3] qtest: log QEMU command line Thomas Huth
  2018-11-20 11:36 ` [Qemu-devel] [PULL 0/3] qtest patches Peter Maydell
  3 siblings, 0 replies; 5+ messages in thread
From: Thomas Huth @ 2018-11-20 10:52 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell
  Cc: Marc-André Lureau, Markus Armbruster, Laurent Vivier,
	Thomas Huth

Once a test has finished, the pcibus structure should be freed, to
avoid leaking memory and to make sure that the structure is properly
re-initialized when the next test starts.

Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/ide-test.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tests/ide-test.c b/tests/ide-test.c
index 33cef61..f0280e6 100644
--- a/tests/ide-test.c
+++ b/tests/ide-test.c
@@ -142,6 +142,10 @@ static void ide_test_start(const char *cmdline_fmt, ...)
 
 static void ide_test_quit(void)
 {
+    if (pcibus) {
+        qpci_free_pc(pcibus);
+        pcibus = NULL;
+    }
     pc_alloc_uninit(guest_malloc);
     guest_malloc = NULL;
     qtest_end();
-- 
1.8.3.1

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

* [Qemu-devel] [PULL 3/3] qtest: log QEMU command line
  2018-11-20 10:52 [Qemu-devel] [PULL 0/3] qtest patches Thomas Huth
  2018-11-20 10:52 ` [Qemu-devel] [PULL 1/3] tests: add qmp/missing-any-arg test Thomas Huth
  2018-11-20 10:52 ` [Qemu-devel] [PULL 2/3] tests/ide: Free pcibus when finishing a test Thomas Huth
@ 2018-11-20 10:52 ` Thomas Huth
  2018-11-20 11:36 ` [Qemu-devel] [PULL 0/3] qtest patches Peter Maydell
  3 siblings, 0 replies; 5+ messages in thread
From: Thomas Huth @ 2018-11-20 10:52 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell
  Cc: Marc-André Lureau, Markus Armbruster, Laurent Vivier,
	Thomas Huth

From: Paolo Bonzini <pbonzini@redhat.com>

Record the command line that was used to start QEMU.  This can be
useful for debugging.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
[thuth: removed trailing \n from the message string]
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/libqtest.c | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/tests/libqtest.c b/tests/libqtest.c
index 44ce118..75e07e1 100644
--- a/tests/libqtest.c
+++ b/tests/libqtest.c
@@ -215,24 +215,28 @@ QTestState *qtest_init_without_qmp_handshake(bool use_oob,
 
     qtest_add_abrt_handler(kill_qemu_hook_func, s);
 
+    command = g_strdup_printf("exec %s "
+                              "-qtest unix:%s,nowait "
+                              "-qtest-log %s "
+                              "-chardev socket,path=%s,nowait,id=char0 "
+                              "-mon chardev=char0,mode=control%s "
+                              "-machine accel=qtest "
+                              "-display none "
+                              "%s", qemu_binary, socket_path,
+                              getenv("QTEST_LOG") ? "/dev/fd/2" : "/dev/null",
+                              qmp_socket_path, use_oob ? ",x-oob=on" : "",
+                              extra_args ?: "");
+
+    g_test_message("starting QEMU: %s", command);
+
     s->qemu_pid = fork();
     if (s->qemu_pid == 0) {
         setenv("QEMU_AUDIO_DRV", "none", true);
-        command = g_strdup_printf("exec %s "
-                                  "-qtest unix:%s,nowait "
-                                  "-qtest-log %s "
-                                  "-chardev socket,path=%s,nowait,id=char0 "
-                                  "-mon chardev=char0,mode=control%s "
-                                  "-machine accel=qtest "
-                                  "-display none "
-                                  "%s", qemu_binary, socket_path,
-                                  getenv("QTEST_LOG") ? "/dev/fd/2" : "/dev/null",
-                                  qmp_socket_path, use_oob ? ",x-oob=on" : "",
-                                  extra_args ?: "");
         execlp("/bin/sh", "sh", "-c", command, NULL);
         exit(1);
     }
 
+    g_free(command);
     s->fd = socket_accept(sock);
     if (s->fd >= 0) {
         s->qmp_fd = socket_accept(qmpsock);
-- 
1.8.3.1

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

* Re: [Qemu-devel] [PULL 0/3] qtest patches
  2018-11-20 10:52 [Qemu-devel] [PULL 0/3] qtest patches Thomas Huth
                   ` (2 preceding siblings ...)
  2018-11-20 10:52 ` [Qemu-devel] [PULL 3/3] qtest: log QEMU command line Thomas Huth
@ 2018-11-20 11:36 ` Peter Maydell
  3 siblings, 0 replies; 5+ messages in thread
From: Peter Maydell @ 2018-11-20 11:36 UTC (permalink / raw)
  To: Thomas Huth
  Cc: QEMU Developers, Marc-André Lureau, Markus Armbruster,
	Laurent Vivier

On 20 November 2018 at 10:52, Thomas Huth <thuth@redhat.com> wrote:
>  Hi Peter,
>
> the following changes since commit d304cf014bf9feec3dcd7ee65c75a7f52206ecdf:
>
>   Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20181119' into staging (2018-11-19 15:58:17 +0000)
>
> are available in the git repository at:
>
>   https://gitlab.com/huth/qemu.git tags/pull-request-2018-11-20
>
> for you to fetch changes up to ced09f9b07e425690d3bfe524cf93c4dbf4b26bc:
>
>   qtest: log QEMU command line (2018-11-20 10:49:12 +0100)
>
> ----------------------------------------------------------------
> - One additional simple qmp-test
> - A fix for ide-test
> - Add logging of QEMU parameters in libqtest
> ----------------------------------------------------------------
>

Applied, thanks.

-- PMM

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

end of thread, other threads:[~2018-11-20 11:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-20 10:52 [Qemu-devel] [PULL 0/3] qtest patches Thomas Huth
2018-11-20 10:52 ` [Qemu-devel] [PULL 1/3] tests: add qmp/missing-any-arg test Thomas Huth
2018-11-20 10:52 ` [Qemu-devel] [PULL 2/3] tests/ide: Free pcibus when finishing a test Thomas Huth
2018-11-20 10:52 ` [Qemu-devel] [PULL 3/3] qtest: log QEMU command line Thomas Huth
2018-11-20 11:36 ` [Qemu-devel] [PULL 0/3] qtest patches Peter Maydell

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