[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [QEMU][RFC V2 03/10] xen: add wrappers for new Xen disaggregation hypercalls



QEMU disaggregation is not supported on old Xen versions.

Signed-off-by: Julien Grall <julien.grall@xxxxxxxxxx>
---
 hw/xen_common.h |   58 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 58 insertions(+), 0 deletions(-)

diff --git a/hw/xen_common.h b/hw/xen_common.h
index 727757a..b2525ad 100644
--- a/hw/xen_common.h
+++ b/hw/xen_common.h
@@ -152,6 +152,64 @@ static inline int xen_xc_hvm_inject_msi(XenXC xen_xc, 
domid_t dom,
 }
 #endif
 
+/* Xen before 4.3 */
+#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 430
+static inline int xen_xc_hvm_register_pcidev(XenXC xen_xc, domid_t dom,
+        unsigned int serverid, uint8_t domain,
+        uint8_t bus, uint8_t device, uint8_t function)
+{
+    return 0;
+}
+
+static inline int xen_xc_hvm_map_io_range_to_ioreq_server(XenXC xen_xc,
+        domid_t dom, unsigned int serverid, int is_mmio,
+        uint64_t start, uint64_t end)
+{
+    return 1;
+}
+
+static inline int xen_xc_hvm_unmap_io_range_from_ioreq_server(XenXC xen_xc,
+        domid_t dom, unsigned int serverid, int is_mmio, uint64_t start)
+{
+    return 1;
+}
+
+static inline int xen_xc_hvm_register_ioreq_server(XenXC xen_xc, domid_t dom)
+{
+    return 0;
+}
+
+#else
+static inline int xen_xc_hvm_register_pcidev(XenXC xen_xc, domid_t dom,
+        unsigned int serverid, uint8_t domain,
+        uint8_t bus, uint8_t device, uint8_t function)
+{
+    return xc_hvm_register_pcidev(xen_xc, dom, serverid, domain,
+                                  bus, device, function);
+}
+
+static inline int xen_xc_hvm_map_io_range_to_ioreq_server(XenXC xen_xc,
+        domid_t dom, unsigned int serverid, int is_mmio,
+        uint64_t start, uint64_t end)
+{
+    return xc_hvm_map_io_range_to_ioreq_server(xen_xc, dom, serverid, is_mmio,
+                                               start, end);
+}
+
+static inline int xen_xc_hvm_unmap_io_range_from_ioreq_server(XenXC xen_xc,
+        domid_t dom, unsigned int serverid, int is_mmio, uint64_t start)
+{
+    return xc_hvm_unmap_io_range_from_ioreq_server(xen_xc, dom, serverid,
+                                                   is_mmio, start);
+}
+
+static inline int xen_xc_hvm_register_ioreq_server(XenXC xen_xc, domid_t dom)
+{
+    return xc_hvm_register_ioreq_server(xen_xc, dom);
+}
+
+#endif
+
 void destroy_hvm_domain(bool reboot);
 
 /* shutdown/destroy current domain because of an error */
-- 
Julien Grall


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.