X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=xen-common.c;h=fd2c92847e14ed5d5329b12ed0359e434c0f91f2;hb=fce5d5386d8613e9659f1edc4be9c3f8b7cff073;hp=acc64d5cc8549a2482661a5255550004b237942a;hpb=b152b05a35acc0ff3da5648fd5cb97136853838c;p=mirror_qemu.git diff --git a/xen-common.c b/xen-common.c index acc64d5cc8..fd2c92847e 100644 --- a/xen-common.c +++ b/xen-common.c @@ -8,10 +8,12 @@ * 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" #include "sysemu/accel.h" +#include "migration/migration.h" //#define DEBUG_XEN @@ -23,7 +25,7 @@ do { } while (0) #endif -static int store_dev_info(int domid, CharDriverState *cs, const char *string) +static int store_dev_info(int domid, Chardev *cs, const char *string) { struct xs_handle *xs = NULL; char *path = NULL; @@ -72,7 +74,7 @@ out: return ret; } -void xenstore_store_pv_console_info(int i, CharDriverState *chr) +void xenstore_store_pv_console_info(int i, Chardev *chr) { if (i == 0) { store_dev_info(xen_domid, chr, "/console"); @@ -110,15 +112,25 @@ static void xen_change_state_handler(void *opaque, int running, } } -static int xen_init(MachineClass *mc) +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); + global_state_set_optional(); + savevm_skip_configuration(); + savevm_skip_section_footers(); + return 0; } @@ -126,7 +138,7 @@ static void xen_accel_class_init(ObjectClass *oc, void *data) { AccelClass *ac = ACCEL_CLASS(oc); ac->name = "Xen"; - ac->init = xen_init; + ac->init_machine = xen_init; ac->allowed = &xen_allowed; }