From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44285) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVhEQ-0001nG-Gk for qemu-devel@nongnu.org; Thu, 03 Apr 2014 08:59:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WVhEJ-0003c1-QL for qemu-devel@nongnu.org; Thu, 03 Apr 2014 08:58:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51524) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVhEJ-0003bX-Hu for qemu-devel@nongnu.org; Thu, 03 Apr 2014 08:58:51 -0400 Date: Thu, 3 Apr 2014 14:58:47 +0200 From: Stefan Hajnoczi Message-ID: <20140403125847.GA6962@stefanha-thinkpad.redhat.com> References: <1396450668-12145-1-git-send-email-afaerber@suse.de> <20140403084624.GD27704@stefanha-thinkpad.redhat.com> <533D49D8.3010601@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <533D49D8.3010601@suse.de> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RFC] tests: Add ivshmem qtest List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andreas =?iso-8859-1?Q?F=E4rber?= Cc: pbonzini@redhat.com, Cam Macdonell , qemu-devel@nongnu.org, mst@redhat.com On Thu, Apr 03, 2014 at 01:45:28PM +0200, Andreas F=E4rber wrote: > Am 03.04.2014 10:46, schrieb Stefan Hajnoczi: > > The name should be unique and we should clean up in both success and > > failure (abort(3)) cases. >=20 > The recipe for unique filenames elsewhere is mkstemp(), which I was > planning to use here as well using "/dev/shm/qtest.XXXXXX" and then to > somehow strip the /dev/shm/ part, e.g. &...[9]. >=20 > However I do not see any existing test specially cleaning up such > temporary files on SIGABRT rather than just on success. Do you have a > pointer or suggestion how to do that? We currently don't have a atabort() mechanism (like atexit(3)) but I think this is needed. This would be a separate libqtest patch. > Still the actual question of this RFC is, how do I detect whether we ma= y > run this test at all? >=20 > 1) Relying on being run in the build directory, we could try to peek at > $arch-softmmu/config-target.mak, looking for CONFIG_KVM. Ugly. >=20 > 2) Determine via QMP whether KVM is available in the QEMU binary. How? > Involves an additional process before launching the actual process with > -device ivshmem. >=20 > 3) Determine via QMP whether the device QOM type is available in the > QEMU binary. Involves an additional process. >=20 > 4) Make ivshmem build independent of CONFIG_KVM. Too much work for a > single out of many test cases. >=20 > 5) ??? Another ugly option, add the test to the i386/x86_64 softmmu target and only run on Linux hosts. Stefan