[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 007/130] KVM: Split QEMUMachine typedef into separate
From: |
Alexander Graf |
Subject: |
[Qemu-devel] [PULL 007/130] KVM: Split QEMUMachine typedef into separate header |
Date: |
Fri, 7 Mar 2014 00:32:14 +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 <address@hidden>
---
include/hw/boards.h | 3 +--
include/hw/xen/xen.h | 1 +
include/sysemu/kvm.h | 1 +
include/sysemu/qemumachine.h | 16 ++++++++++++++++
include/sysemu/qtest.h | 1 +
kvm-stub.c | 1 +
6 files changed, 21 insertions(+), 2 deletions(-)
create mode 100644 include/sysemu/qemumachine.h
diff --git a/include/hw/boards.h b/include/hw/boards.h
index 2151460..ed6d9f8 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -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;
diff --git a/include/hw/xen/xen.h b/include/hw/xen/xen.h
index e1f88bf..81e5bb1 100644
--- a/include/hw/xen/xen.h
+++ b/include/hw/xen/xen.h
@@ -10,6 +10,7 @@
#include "hw/irq.h"
#include "qemu-common.h"
+#include "sysemu/qemumachine.h"
/* xen-machine.c */
enum xen_mode {
diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h
index a02d67c..c982570 100644
--- a/include/sysemu/kvm.h
+++ b/include/sysemu/kvm.h
@@ -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
index 0000000..4cefd56
--- /dev/null
+++ b/include/sysemu/qemumachine.h
@@ -0,0 +1,16 @@
+/*
+ * QEMU Machine typedef
+ *
+ * Copyright Alexander Graf <address@hidden>
+ *
+ * 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 */
diff --git a/include/sysemu/qtest.h b/include/sysemu/qtest.h
index 28f4875..d6434cd 100644
--- a/include/sysemu/qtest.h
+++ b/include/sysemu/qtest.h
@@ -16,6 +16,7 @@
#include "qemu-common.h"
#include "qapi/error.h"
+#include "sysemu/qemumachine.h"
extern bool qtest_allowed;
diff --git a/kvm-stub.c b/kvm-stub.c
index e979f76..b1c4429 100644
--- a/kvm-stub.c
+++ b/kvm-stub.c
@@ -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"
--
1.8.1.4
- [Qemu-devel] [PULL 00/130] ppc patch queue 2014-03- 05, Alexander Graf, 2014/03/06
- [Qemu-devel] [PULL 009/130] target-ppc: dump DAR and DSISR, Alexander Graf, 2014/03/06
- [Qemu-devel] [PULL 010/130] target-ppc: fix Authority Mask Register init value, Alexander Graf, 2014/03/06
- [Qemu-devel] [PULL 002/130] target-ppc: fix LPCR SPR number, Alexander Graf, 2014/03/06
- [Qemu-devel] [PULL 005/130] target-ppc: remove embedded MMU SPRs from 970, P5+/7/7+/8, Alexander Graf, 2014/03/06
- [Qemu-devel] [PULL 001/130] target-ppc: fix compile error when PPC_DUMP_CPU is enabled, Alexander Graf, 2014/03/06
- [Qemu-devel] [PULL 003/130] target-ppc: remove powerpc 970gx, Alexander Graf, 2014/03/06
- [Qemu-devel] [PULL 012/130] PPC: KVM: fix "set one register", Alexander Graf, 2014/03/06
- [Qemu-devel] [PULL 007/130] KVM: Split QEMUMachine typedef into separate header,
Alexander Graf <=
- [Qemu-devel] [PULL 011/130] mmu-hash64: fix Virtual Page Class Key Protection, Alexander Graf, 2014/03/06
- [Qemu-devel] [PULL 006/130] target-ppc: remove unsupported SPRs from 970 and P5+, Alexander Graf, 2014/03/06
- [Qemu-devel] [PULL 016/130] target-ppc: disable unsupported modes for SPR_CTRL/SPR_UCTRL, Alexander Graf, 2014/03/06
- [Qemu-devel] [PULL 027/130] target-ppc: Add VSX ISA2.06 Multiply Add Instructions, Alexander Graf, 2014/03/06
- [Qemu-devel] [PULL 021/130] target-ppc: Add VSX ISA2.06 xdiv Instructions, Alexander Graf, 2014/03/06
- [Qemu-devel] [PULL 014/130] spapr-pci: enable adding PHB via -device, Alexander Graf, 2014/03/06
- [Qemu-devel] [PULL 019/130] target-ppc: Add VSX ISA2.06 xadd/xsub Instructions, Alexander Graf, 2014/03/06
- [Qemu-devel] [PULL 031/130] target-ppc: Add VSX Floating Point to Floating Point Conversion Instructions, Alexander Graf, 2014/03/06
- [Qemu-devel] [PULL 029/130] target-ppc: Add VSX xmax/xmin Instructions, Alexander Graf, 2014/03/06