KVM: Make kvm header C++ friendly
authornathan binkert <nate@binkert.org>
Sat, 28 Mar 2009 04:53:05 +0000 (21:53 -0700)
committerAvi Kivity <avi@redhat.com>
Wed, 10 Jun 2009 08:48:39 +0000 (11:48 +0300)
Two things needed fixing: 1) g++ does not allow a named structure type
within an anonymous union and 2) Avoid name clash between two padding
fields within the same struct by giving them different names as is
done elsewhere in the header.

Signed-off-by: Nathan Binkert <nate@binkert.org>
Signed-off-by: Avi Kivity <avi@redhat.com>
include/linux/kvm.h

index 644e3a9..3db5d8d 100644 (file)
@@ -119,7 +119,7 @@ struct kvm_run {
                        __u32 error_code;
                } ex;
                /* KVM_EXIT_IO */
-               struct kvm_io {
+               struct {
 #define KVM_EXIT_IO_IN  0
 #define KVM_EXIT_IO_OUT 1
                        __u8 direction;
@@ -224,10 +224,10 @@ struct kvm_interrupt {
 /* for KVM_GET_DIRTY_LOG */
 struct kvm_dirty_log {
        __u32 slot;
-       __u32 padding;
+       __u32 padding1;
        union {
                void __user *dirty_bitmap; /* one bit per page */
-               __u64 padding;
+               __u64 padding2;
        };
 };