From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: [PATCH kvm-unit-tests 2/4] Introduce a C++ wrapper for the kvm APIs Date: Wed, 24 Nov 2010 08:24:39 -0600 Message-ID: <4CED2027.2060602@codemonkey.ws> References: <1290595933-13122-1-git-send-email-avi@redhat.com> <1290595933-13122-3-git-send-email-avi@redhat.com> <50DD1E97-0ECD-41E6-B6F8-1D78AA4A4876@suse.de> <4CED1EB4.70105@codemonkey.ws> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Avi Kivity , Marcelo Tosatti , kvm@vger.kernel.org To: Alexander Graf Return-path: Received: from mail-gx0-f174.google.com ([209.85.161.174]:32974 "EHLO mail-gx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751544Ab0KXOZN (ORCPT ); Wed, 24 Nov 2010 09:25:13 -0500 Received: by gxk22 with SMTP id 22so754076gxk.19 for ; Wed, 24 Nov 2010 06:25:12 -0800 (PST) In-Reply-To: <4CED1EB4.70105@codemonkey.ws> Sender: kvm-owner@vger.kernel.org List-ID: On 11/24/2010 08:18 AM, Anthony Liguori wrote: > On 11/24/2010 06:59 AM, Alexander Graf wrote: >> On 24.11.2010, at 11:52, Avi Kivity wrote: >> >>> Introduce exception-safe objects for calling system, vm, and vcpu >>> ioctls. >>> >>> Signed-off-by: Avi Kivity >> >> FWIW, I still disagree with C++ and believe this code to be hardly >> readable. > > Take a look at http://repo.or.cz/w/qemupp.git repo.or.cz seems to be down so: http://git.qemu.org/qemupp.git/ Regards, Anthony Liguori > > Start with test/test-mc146818a.cpp > > This test infrastructure is arguably a bad place to start because it > doesn't benefit really at all from C++. The object hierarchy is > extremely simple and most of the time you're interfacing with legacy C > interfaces so a lot of effort is spent bridging those interfaces. > > OTOH, the device models interact very little with the external world > and the object model is complex is subtle ways. I think C++ is a much > better fit there. > > In the above repo, I've converted the PIT, RTC, keyboard controller, > and have started working on the i440fx. The i440fx is a lot of work > but it's also one of the more interesting devices to try and model > correctly. > > For all devices, there are very intensive unit tests that use > fuzzing. I hope to have something postable for serious consideration > by the end of the year. > > BTW, given the ability to test programmatically, I ended up rewriting > a good bit of the PIT and RTC. The way that the unit conversion is > handled right now in QEMU is a train wreck. The new version is much > more accurate and as a consequence, the interrupt catch up logic is > much more precise. There are also three different catch up algorithms > that are selectable at run time. > > This is all tested with a time simulation that can simulate random > amounts of drift over random periods of time. > > Regards, > > Anthony Liguori > >> >> Alex >> >> >> -- >> To unsubscribe from this list: send the line "unsubscribe kvm" in >> the body of a message to majordomo@vger.kernel.org >> More majordomo info at http://vger.kernel.org/majordomo-info.html >