@@ -137,30 +137,6 @@ void qmp_xen_set_global_dirty_log(bool enable, Error **errp)
{
}
-static int xen_init_ioreq(XenIOState *state, unsigned int max_cpus)
-{
- xen_dmod = xendevicemodel_open(0, 0);
- xen_xc = xc_interface_open(0, 0, 0);
-
- if (xen_xc == NULL) {
- perror("xen: can't open xen interface\n");
- return -1;
- }
-
- xen_fmem = xenforeignmemory_open(0, 0);
- if (xen_fmem == NULL) {
- perror("xen: can't open xen fmem interface\n");
- xc_interface_close(xen_xc);
- return -1;
- }
-
- xen_register_ioreq(state, max_cpus, xen_memory_listener);
-
- xenstore_record_dm_state(xenstore, "running");
-
- return 0;
-}
-
static void xen_enable_tpm(void)
{
#ifdef CONFIG_TPM
@@ -198,9 +174,7 @@ static void xen_arm_init(MachineState *machine)
xen_init_ram(machine);
- if (xen_init_ioreq(xam->state, machine->smp.cpus)) {
- return;
- }
+ xen_register_ioreq(xam->state, machine->smp.cpus, xen_memory_listener);
xen_create_virtio_mmio_devices(xam);
@@ -218,6 +192,7 @@ static void xen_arm_machine_class_init(ObjectClass *oc, void *data)
mc->max_cpus = 1;
/* Set explicitly here to make sure that real ram_size is passed */
mc->default_ram_size = 0;
+ mc->default_machine_opts = "accel=xen";
machine_class_allow_dynamic_sysbus_dev(mc, TYPE_TPM_TIS_SYSBUS);
}