]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
KVM: Split QEMUMachine typedef into separate header
authorAlexander Graf <agraf@suse.de>
Mon, 27 Jan 2014 17:22:10 +0000 (18:22 +0100)
committerAlexander Graf <agraf@suse.de>
Wed, 5 Mar 2014 02:06:24 +0000 (03:06 +0100)
Older gcc versions (such as the one in SLES11) get confused when you declare
a typedef on the same struct twice.

To work around that limitation, let's extract the QEMUMachine typedef into a
separate header file that is guarded by preprocessor duplicate include checks.

This fixes the following type of compile errors for me:

  In file included from vl.c:125:
  include/hw/xen/xen.h:39: error: redefinition of typedef "QEMUMachine"
  include/sysemu/kvm.h:155: error: previous declaration of "QEMUMachine" was here

Signed-off-by: Alexander Graf <agraf@suse.de>
include/hw/boards.h
include/hw/xen/xen.h
include/sysemu/kvm.h
include/sysemu/qemumachine.h [new file with mode: 0644]
include/sysemu/qtest.h
kvm-stub.c

index 2151460f9ec4be85391104c972f313054574568e..ed6d9f874999e15cac04c1acee3bea2359ace1f5 100644 (file)
@@ -4,10 +4,9 @@
 #define HW_BOARDS_H
 
 #include "sysemu/blockdev.h"
+#include "sysemu/qemumachine.h"
 #include "hw/qdev.h"
 
-typedef struct QEMUMachine QEMUMachine;
-
 typedef struct QEMUMachineInitArgs {
     const QEMUMachine *machine;
     ram_addr_t ram_size;
index e1f88bf9cf8f343733f1f17df76e0f006e712cdf..81e5bb1b22f90c64b2a15ce2361cf3eeee38ab28 100644 (file)
@@ -10,6 +10,7 @@
 
 #include "hw/irq.h"
 #include "qemu-common.h"
+#include "sysemu/qemumachine.h"
 
 /* xen-machine.c */
 enum xen_mode {
index a02d67cd5a09f354d7fe13dd174568c135edd12e..c9825702c97357e9cdf799cf070e3e3d8bd7043f 100644 (file)
@@ -18,6 +18,7 @@
 #include "config-host.h"
 #include "qemu/queue.h"
 #include "qom/cpu.h"
+#include "sysemu/qemumachine.h"
 
 #ifdef CONFIG_KVM
 #include <linux/kvm.h>
diff --git a/include/sysemu/qemumachine.h b/include/sysemu/qemumachine.h
new file mode 100644 (file)
index 0000000..4cefd56
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+ * QEMU Machine typedef
+ *
+ * Copyright Alexander Graf <agraf@suse.de>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ *
+ */
+
+#ifndef QEMUMACHINE_H
+#define QEMUMACHINE_H
+
+typedef struct QEMUMachine QEMUMachine;
+
+#endif /* !QEMUMACHINE_H */
index 28f4875112688ac6ccfce9c78789978d69f9fd0d..d6434cdc14bfdd47c89a571e90c50199b8414fa3 100644 (file)
@@ -16,6 +16,7 @@
 
 #include "qemu-common.h"
 #include "qapi/error.h"
+#include "sysemu/qemumachine.h"
 
 extern bool qtest_allowed;
 
index e979f76d078226df20c29ec4b16bff29143766c0..b1c4429ea822d91b41ff96241f6f1a76ce379563 100644 (file)
@@ -14,6 +14,7 @@
 #include "hw/hw.h"
 #include "cpu.h"
 #include "sysemu/kvm.h"
+#include "sysemu/qemumachine.h"
 
 #ifndef CONFIG_USER_ONLY
 #include "hw/pci/msi.h"