aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2012-04-23 09:58:54 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2012-04-23 09:58:54 -0500
commit53878a132aaadbedbe8fe0e44afa032a4ed73aea (patch)
treed487f4157b2d8b394575cd04a22183222ef20bd1 /hw
parent6b03296606c665beb570eaa53a71f7688a43b9e7 (diff)
parent4c9f8d1b4eb0e1a7e69df6373e9c2d40a929494d (diff)
Merge remote-tracking branch 'sstabellini/build_fix' into staging
* sstabellini/build_fix: xen: add a dummy xc_hvm_inject_msi for Xen < 4.2 xen,configure: detect Xen 4.2
Diffstat (limited to 'hw')
-rw-r--r--hw/pc.c2
-rw-r--r--hw/xen.h10
-rw-r--r--hw/xen_common.h15
3 files changed, 26 insertions, 1 deletions
diff --git a/hw/pc.c b/hw/pc.c
index 1f5aacb2d2..4d34a335ed 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -916,7 +916,7 @@ static DeviceState *apic_init(void *env, uint8_t apic_id)
msi_supported = true;
}
- if (xen_enabled()) {
+ if (xen_msi_support()) {
msi_supported = true;
}
diff --git a/hw/xen.h b/hw/xen.h
index e5926b7b8a..3ae4cd0f5c 100644
--- a/hw/xen.h
+++ b/hw/xen.h
@@ -57,4 +57,14 @@ void xen_register_framebuffer(struct MemoryRegion *mr);
# define HVM_MAX_VCPUS 32
#endif
+static inline int xen_msi_support(void)
+{
+#if defined(CONFIG_XEN_CTRL_INTERFACE_VERSION) \
+ && CONFIG_XEN_CTRL_INTERFACE_VERSION >= 420
+ return xen_enabled();
+#else
+ return 0;
+#endif
+}
+
#endif /* QEMU_HW_XEN_H */
diff --git a/hw/xen_common.h b/hw/xen_common.h
index 0409ac7971..7043c14cae 100644
--- a/hw/xen_common.h
+++ b/hw/xen_common.h
@@ -133,6 +133,21 @@ static inline int xc_fd(xc_interface *xen_xc)
}
#endif
+/* Xen before 4.2 */
+#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 420
+static inline int xen_xc_hvm_inject_msi(XenXC xen_xc, domid_t dom,
+ uint64_t addr, uint32_t data)
+{
+ return -ENOSYS;
+}
+#else
+static inline int xen_xc_hvm_inject_msi(XenXC xen_xc, domid_t dom,
+ uint64_t addr, uint32_t data)
+{
+ return xc_hvm_inject_msi(xen_xc, dom, addr, data);
+}
+#endif
+
void destroy_hvm_domain(void);
#endif /* QEMU_HW_XEN_COMMON_H */