Re: Fix to issues with kvm.h and g++

Avi Kivity
2008-11-06T15:57:59Z

Daniel Godás wrote:
> Hello,
>
> I am writing a kvm-based emulation framework in c++. When I included
> <linux/kvm.h> I got the following errors:
>
> /usr/include/linux/kvm.h:89: error: 'struct kvm_run::<anonymous
> union>::kvm_io' invalid; an anonymous union can only have non-static
> data members
> /usr/include/linux/kvm.h:230: error: declaration of '__u64
> kvm_dirty_log::<anonymous union>::padding'
> /usr/include/linux/kvm.h:227: error: conflicts with previous
> declaration '__u32 kvm_dirty_log::padding'
> /usr/include/linux/kvm.h:89: error: 'struct kvm_run::<anonymous
> union>::kvm_io' invalid; an anonymous union can only have non-static
> data members
> /usr/include/linux/kvm.h:230: error: declaration of '__u64
> kvm_dirty_log::<anonymous union>::padding'
> /usr/include/linux/kvm.h:227: error: conflicts with previous
> declaration '__u32 kvm_dirty_log::padding'
>
> It looks like nobody uses struct kvm_io nor in kernel or user space.
>

Please move it outside the outer structure, just in case.

> The same happens with the two padding fields. The following patch
> fixes the errors:
>
>

And resend with a signoff and changelog entry.