]> git.proxmox.com Git - mirror_qemu.git/blobdiff - xen-common.c
Merge remote-tracking branch 'jasowang/tags/net-pull-request' into staging
[mirror_qemu.git] / xen-common.c
index 0dcdbc39f473e0e690b4a18f993b690e853e5e89..909976071c243c1f1cd1b7d08cb05cc511c5e89c 100644 (file)
@@ -8,6 +8,7 @@
  * GNU GPL, version 2 or (at your option) any later version.
  */
 
+#include "qemu/osdep.h"
 #include "hw/xen/xen_backend.h"
 #include "qmp-commands.h"
 #include "sysemu/char.h"
@@ -113,9 +114,15 @@ static void xen_change_state_handler(void *opaque, int running,
 
 static int xen_init(MachineState *ms)
 {
-    xen_xc = xen_xc_interface_open(0, 0, 0);
-    if (xen_xc == XC_HANDLER_INITIAL_VALUE) {
-        xen_be_printf(NULL, 0, "can't open xen interface\n");
+    xen_xc = xc_interface_open(0, 0, 0);
+    if (xen_xc == NULL) {
+        xen_pv_printf(NULL, 0, "can't open xen interface\n");
+        return -1;
+    }
+    xen_fmem = xenforeignmemory_open(0, 0);
+    if (xen_fmem == NULL) {
+        xen_pv_printf(NULL, 0, "can't open xen fmem interface\n");
+        xc_interface_close(xen_xc);
         return -1;
     }
     qemu_add_vm_change_state_handler(xen_change_state_handler, NULL);