All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Steven Sistare <steven.sistare@oracle.com>
Cc: qemu-devel@nongnu.org,  pbonzini@redhat.com,
	 berrange@redhat.com, eduardo@habkost.net
Subject: Re: [PATCH 4/5] qtest/qom-test: Don't bother to execute QMP command quit
Date: Tue, 05 Aug 2025 08:06:54 +0200	[thread overview]
Message-ID: <8734a6fgjl.fsf@pond.sub.org> (raw)
In-Reply-To: <6bb59bfa-8083-4823-9f15-92132e8d6783@oracle.com> (Steven Sistare's message of "Mon, 4 Aug 2025 13:10:53 -0400")

Steven Sistare <steven.sistare@oracle.com> writes:

> On 7/25/2025 9:50 AM, Markus Armbruster wrote:
>> Signed-off-by: Markus Armbruster <armbru@redhat.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 d358b69c7e..6421f2d9d9 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);
>>   }
>
> IMO the quit command improves test coverage, albeit by a small amount.
> It guarantees that qemu did not die after returning the qom result to
> the client.

What if it dies afte returning the quit response?

Detecting QEMU dying on us is the test harness's job.  Check out
qtest_check_status() called by qtest_wait_qemu() called by
qtest_kill_qemu() called by qtest_quit() called by the test.

For what it's worth, the only other qtest using the quit command is
machine-none-test.c.

In qtests, quit races with the test harness's termination of QEMU.  The
quit command requests immediate shutdown.  By the time the test receives
the response, the QEMU process may be alive (still shutting down) or
dead.  If dead, it's in zombie state.  qtest_quit() then kill()s it some
more (does nothing for zombies), and finally reaps it with waitpid().
Works, but the race between quit and kill give me a queasy feeling.

Can't say whether the Windows code handles this robustly.



  reply	other threads:[~2025-08-05  6:07 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-25 13:50 [PATCH 0/5] qtest/qom-test: Leak plug, faster, better coverage Markus Armbruster
2025-07-25 13:50 ` [PATCH 1/5] qtest/qom-test: Plug memory leak with -p Markus Armbruster
2025-08-04 17:11   ` Steven Sistare
2025-08-05  6:54     ` Markus Armbruster
2025-08-05 12:07       ` Steven Sistare
2025-07-25 13:50 ` [PATCH 2/5] qtest/qom-test: Shallow testing of qom-list / qom-get Markus Armbruster
2025-08-04 16:38   ` Steven Sistare
2025-07-25 13:50 ` [PATCH 3/5] qtest/qom-test: Traverse entire QOM tree Markus Armbruster
2025-08-04 16:40   ` Steven Sistare
2025-07-25 13:50 ` [PATCH 4/5] qtest/qom-test: Don't bother to execute QMP command quit Markus Armbruster
2025-08-04 17:10   ` Steven Sistare
2025-08-05  6:06     ` Markus Armbruster [this message]
2025-08-05 12:03       ` Steven Sistare
2025-07-25 13:50 ` [PATCH 5/5] MAINTAINERS: Cover tests/qtest/qom-test.c Markus Armbruster
2025-08-04  7:01 ` [PATCH 0/5] qtest/qom-test: Leak plug, faster, better coverage Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8734a6fgjl.fsf@pond.sub.org \
    --to=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=eduardo@habkost.net \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=steven.sistare@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.