From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48509) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WN1jU-0005Yd-Nh for qemu-devel@nongnu.org; Mon, 10 Mar 2014 11:03:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WN1jM-00020W-AJ for qemu-devel@nongnu.org; Mon, 10 Mar 2014 11:03:12 -0400 Received: from mail-ea0-x229.google.com ([2a00:1450:4013:c01::229]:57543) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WN1jM-00020D-2I for qemu-devel@nongnu.org; Mon, 10 Mar 2014 11:03:04 -0400 Received: by mail-ea0-f169.google.com with SMTP id h14so3810952eaj.28 for ; Mon, 10 Mar 2014 08:03:02 -0700 (PDT) Date: Mon, 10 Mar 2014 16:02:59 +0100 From: Stefan Hajnoczi Message-ID: <20140310150259.GB32400@stefanha-thinkpad.redhat.com> References: <1394453534-24334-1-git-send-email-marcel.a@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1394453534-24334-1-git-send-email-marcel.a@redhat.com> Subject: Re: [Qemu-devel] [PATCH 0/2] tests: Fix possible deadlock in qtest initialization List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Marcel Apfelbaum Cc: afaerber@suse.de, stefanha@redhat.com, qemu-devel@nongnu.org, aliguori@amazon.com, armbru@redhat.com On Mon, Mar 10, 2014 at 02:12:12PM +0200, Marcel Apfelbaum wrote: > '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. See below why I think qtest_state_valid() is unnecessary as a libqtest.h API. > Asserting qtest_state_valid in each test after qtest_init > is a must, as we need to trace which test failed. Inability to tell which qtest failed is a Makefile problem. The solution is not to move all asserts to the outer-most level just so the error message includes the test name. Either we need to invoke gtester separately for each test - that way the Makefile can print "TEST " for each binary. Or maybe gtester has options for formatting output better. Stefan