diff options
Diffstat (limited to 'xen-common.c')
-rw-r--r-- | xen-common.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/xen-common.c b/xen-common.c index f07b35e471..acc64d5cc8 100644 --- a/xen-common.c +++ b/xen-common.c @@ -11,6 +11,7 @@ #include "hw/xen/xen_backend.h" #include "qmp-commands.h" #include "sysemu/char.h" +#include "sysemu/accel.h" //#define DEBUG_XEN @@ -109,7 +110,7 @@ static void xen_change_state_handler(void *opaque, int running, } } -int xen_init(MachineClass *mc) +static int xen_init(MachineClass *mc) { xen_xc = xen_xc_interface_open(0, 0, 0); if (xen_xc == XC_HANDLER_INITIAL_VALUE) { @@ -121,3 +122,25 @@ int xen_init(MachineClass *mc) return 0; } +static void xen_accel_class_init(ObjectClass *oc, void *data) +{ + AccelClass *ac = ACCEL_CLASS(oc); + ac->name = "Xen"; + ac->init = xen_init; + ac->allowed = &xen_allowed; +} + +#define TYPE_XEN_ACCEL ACCEL_CLASS_NAME("xen") + +static const TypeInfo xen_accel_type = { + .name = TYPE_XEN_ACCEL, + .parent = TYPE_ACCEL, + .class_init = xen_accel_class_init, +}; + +static void xen_type_init(void) +{ + type_register_static(&xen_accel_type); +} + +type_init(xen_type_init); |