From: Marcel Apfelbaum <marcel.a@redhat.com>
To: qemu-devel@nongnu.org
Cc: armbru@redhat.com, aliguori@amazon.com, stefanha@redhat.com,
afaerber@suse.de
Subject: [Qemu-devel] [PATCH 0/2] tests: Fix possible deadlock in qtest initialization
Date: Mon, 10 Mar 2014 14:12:12 +0200 [thread overview]
Message-ID: <1394453534-24334-1-git-send-email-marcel.a@redhat.com> (raw)
'socket_accept' waits for Qemu to init its unix socket.
If Qemu encounters an error during command line parsing,
it can exit before initializing the communication channel.
It gets worse as the make check-qtest-* gets stuck without
notifying which test exactly has problems, so debugging can
be a challenge.
The solution has two parts:
- Use a timeout for the socket.
- Expose a qtest_state_valid that checks that the connections
with Qemu are OK.
Asserting qtest_state_valid in each test after qtest_init
is a must, as we need to trace which test failed.
As a nice side effect, even the nop tests will
check at least that the device/option is still
supported by Qemu.
Note: I encountered this issue while working on 'Machine as QOM object';
because of my changes some tests tried to run qtest with a not supported
machine. The result was 'make check' getting stuck with no clue why is happening.
Marcel Apfelbaum (2):
tests/libqtest: Fix possible deadlock in qtest initialization
tests: check that qtest state is valid before starting the test
tests/acpi-test.c | 4 +++-
tests/blockdev-test.c | 4 +++-
tests/boot-order-test.c | 4 +++-
tests/e1000-test.c | 5 ++++-
tests/eepro100-test.c | 1 +
tests/endianness-test.c | 15 ++++++++++++---
tests/fdc-test.c | 5 ++++-
tests/fw_cfg-test.c | 2 ++
tests/hd-geo-test.c | 20 ++++++++++++++++----
tests/i440fx-test.c | 10 ++++++++--
tests/ide-test.c | 5 ++++-
tests/ipoctal232-test.c | 5 ++++-
tests/libqtest.c | 26 +++++++++++++++++++++-----
tests/libqtest.h | 8 ++++++++
tests/m48t59-test.c | 1 +
tests/ne2000-test.c | 5 ++++-
tests/pcnet-test.c | 5 ++++-
tests/qdev-monitor-test.c | 4 +++-
tests/qom-test.c | 10 ++++++++--
tests/rtc-test.c | 4 +++-
tests/rtl8139-test.c | 5 ++++-
tests/tmp105-test.c | 4 +++-
tests/tpci200-test.c | 5 ++++-
tests/virtio-net-test.c | 5 ++++-
tests/vmxnet3-test.c | 5 ++++-
25 files changed, 135 insertions(+), 32 deletions(-)
--
1.8.3.1
next reply other threads:[~2014-03-10 12:12 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-10 12:12 Marcel Apfelbaum [this message]
2014-03-10 12:12 ` [Qemu-devel] [PATCH 1/2] tests/libqtest: Fix possible deadlock in qtest initialization Marcel Apfelbaum
2014-03-10 19:02 ` Stefan Hajnoczi
2014-03-12 9:42 ` Markus Armbruster
2014-03-12 9:54 ` Marcel Apfelbaum
2014-03-10 12:12 ` [Qemu-devel] [PATCH 2/2] tests: check that qtest state is valid before starting the test Marcel Apfelbaum
2014-03-10 15:02 ` [Qemu-devel] [PATCH 0/2] tests: Fix possible deadlock in qtest initialization Stefan Hajnoczi
2014-03-10 15:21 ` Marcel Apfelbaum
2014-03-10 19:13 ` Stefan Hajnoczi
2014-03-11 10:11 ` Marcel Apfelbaum
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=1394453534-24334-1-git-send-email-marcel.a@redhat.com \
--to=marcel.a@redhat.com \
--cc=afaerber@suse.de \
--cc=aliguori@amazon.com \
--cc=armbru@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.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 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).