From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [PATCH kvm-unit-tests 0/4] API test framework Date: Mon, 29 Nov 2010 14:09:15 -0200 Message-ID: <20101129160915.GA16443@amt.cnet> References: <1290595933-13122-1-git-send-email-avi@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from mx1.redhat.com ([209.132.183.28]:39269 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754865Ab0K2QJe (ORCPT ); Mon, 29 Nov 2010 11:09:34 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oATG9YjN015896 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 29 Nov 2010 11:09:34 -0500 Content-Disposition: inline In-Reply-To: <1290595933-13122-1-git-send-email-avi@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Nov 24, 2010 at 12:52:09PM +0200, Avi Kivity wrote: > This patchset adds an API test framework. Rather than driving kvm from qemu, > we now have a way of calling the kvm API directly and observing the results. > We can switch to guest mode and back at will and see any micro effects such > as the result of executing particular instructions. > > As an experiment, the framework is coded in C++. > > Avi Kivity (4): > Makefile: add support for C++ > Introduce a C++ wrapper for the kvm APIs > Add support for calling a function in guest mode > Add sample test using the api test harness > > Makefile | 4 +- > api/identity.cc | 76 ++++++++++++++++++++++ > api/identity.h | 28 ++++++++ > api/kvmxx.cc | 168 +++++++++++++++++++++++++++++++++++++++++++++++++ > api/kvmxx.h | 80 +++++++++++++++++++++++ > config-x86-common.mak | 8 +++ > x86/api-sample.cc | 23 +++++++ > 7 files changed, 386 insertions(+), 1 deletions(-) > create mode 100644 api/identity.cc > create mode 100644 api/identity.h > create mode 100644 api/kvmxx.cc > create mode 100644 api/kvmxx.h > create mode 100644 x86/api-sample.cc I fail to see practical advantages of this compared to current unit tests. Could you give some exciting examples? The fact that it does not run inside QEMU means you can't test QEMU interactions (re: http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/59060). Perhaps you can write a save/restore example as mentioned in the URL above? To me it seems having an interface to QEMU from unit tests would be more beneficial.