From 88cbe0737401843c550f79f611193455c6380bcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 12 Dec 2018 18:01:23 +0400 Subject: machine: move compat properties out of globals MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move the compat arrays inside functions that use them. Signed-off-by: Marc-André Lureau Reviewed-by: Igor Mammedov Reviewed-by: Cornelia Huck Acked-by: Eduardo Habkost --- hw/xen/xen-common.c | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) (limited to 'hw/xen/xen-common.c') diff --git a/hw/xen/xen-common.c b/hw/xen/xen-common.c index 4532aa8..d51148b 100644 --- a/hw/xen/xen-common.c +++ b/hw/xen/xen-common.c @@ -159,27 +159,26 @@ static int xen_init(MachineState *ms) return 0; } -static GlobalProperty xen_compat_props[] = { - { - .driver = "migration", - .property = "store-global-state", - .value = "off", - }, - { - .driver = "migration", - .property = "send-configuration", - .value = "off", - }, - { - .driver = "migration", - .property = "send-section-footer", - .value = "off", - } -}; - static void xen_accel_class_init(ObjectClass *oc, void *data) { AccelClass *ac = ACCEL_CLASS(oc); + static GlobalProperty compat[] = { + { + .driver = "migration", + .property = "store-global-state", + .value = "off", + }, + { + .driver = "migration", + .property = "send-configuration", + .value = "off", + }, + { + .driver = "migration", + .property = "send-section-footer", + .value = "off", + } + }; ac->name = "Xen"; ac->init_machine = xen_init; @@ -187,8 +186,7 @@ static void xen_accel_class_init(ObjectClass *oc, void *data) ac->allowed = &xen_allowed; ac->compat_props = g_ptr_array_new(); - compat_props_add(ac->compat_props, - xen_compat_props, G_N_ELEMENTS(xen_compat_props)); + compat_props_add(ac->compat_props, compat, G_N_ELEMENTS(compat)); } #define TYPE_XEN_ACCEL ACCEL_CLASS_NAME("xen") -- cgit v1.1