2010/5/27 Eric Blake <eblake(a)redhat.com>:
On 05/26/2010 06:02 AM, Jean-Baptiste Rouault wrote:
> Hi there,
>
> Here's a patch to add support to VirtualBox 3.2.
> +++ b/src/vbox/vbox_CAPI_v3_2.h
> @@ -0,0 +1,5607 @@
> +
> +/*
> + * DO NOT EDIT! This is a generated file.
> + *
> + * XPCOM IDL (XPIDL) definition for VirtualBox Main API (COM interfaces)
> + * generated from XIDL (XML interface definition).
> + *
> + * Source : src/VBox/Main/idl/VirtualBox.xidl
> + * Generator : src/VBox/Main/idl/xpcidl.xsl
Is this generator something that should be run as part of building
libvirt, or are we okay with checking in just the generated file?
He probably didn't generate the file. Those headers are part of the
VirtualBox SDK. As the comment indicates they can also be generated
from the VirtualBox.xidl file using a XSLT transformation.
We _could_ include the VirtualBox.xidl and xpcidl.xsl file for all
supported VirtualBox version, but I vote against that for size
reasons. The generated headers are ~150 kb each, but the
VirtualBox.xidl files are ~500kb each (because they include the
complete API documentation too) plus ~35kb for the xpcidl.xsl file.
Either way,
> +#ifndef ___VirtualBox_CXPCOM_h
> +#define ___VirtualBox_CXPCOM_h
Lines like this fail the cppi syntax-check. Either we need to modify
cfg.mk to exempt this file from cppi checks, or you need to fix the
generation process to filter the file through cppi before committing it
into libvirt.
I just tried to make the vbox_CAPI_v3_2.h conform to cppi's checks,
but the patch touches ~500 lines. Therefore, the less invasive fix
would be to just ignore the vbox_CAPI_*.h headers for cppi checks.
diff --git a/cfg.mk b/cfg.mk
index bdf9ea9..b332030 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -416,7 +416,7 @@ sc_prohibit_trailing_blank_lines:
test $$found = 0
# Regex for grep -E that exempts generated files from style rules.
-preprocessor_exempt = (remote_(driver|protocol)\.h)$$
+preprocessor_exempt = (remote_(driver|protocol)\.h|vbox_CAPI_v.*\.h)$$
# Enforce recommended preprocessor indentation style.
sc_preprocessor_indentation:
@if cppi --version >/dev/null 2>&1; then \
Matthias