Re: [PATCH kvm-unit-tests 2/4] Introduce a C++ wrapper for the kvm APIs

Michael S. Tsirkin
2010-11-28T11:59:44Z

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 <avi@redhat.com>
>
>
> 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