From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Michael S. Tsirkin" Subject: Re: [PATCH kvm-unit-tests 2/4] Introduce a C++ wrapper for the kvm APIs Date: Sun, 28 Nov 2010 13:59:21 +0200 Message-ID: <20101128115921.GB11685@redhat.com> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Avi Kivity , Marcelo Tosatti , kvm@vger.kernel.org To: Alexander Graf Return-path: Received: from mx1.redhat.com ([209.132.183.28]:55095 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752652Ab0K1L7o (ORCPT ); Sun, 28 Nov 2010 06:59:44 -0500 Content-Disposition: inline In-Reply-To: <50DD1E97-0ECD-41E6-B6F8-1D78AA4A4876@suse.de> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Nov 24, 2010 at 01:59:14PM +0100, 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. A major issue is existing tools. Using C++ would prevent us from using sparce for static code checking. We should be adding more annotations instead of throwing existing ones out. ctags is also broken with C++ which will make it much harder for me to browse the codebase. C++ support in gdb has some limitations if you use overloading, exceptions, templates. The example posted here uses two of these, so it would be harder to debug. I also hoped we'll be able to adopt checkpatch at some point for coding style enforcement, C++ syntax is just too complex for a perl script to be of any use. -- MST