From ea9ce8934c5d2cc8925359a6d8d45eb829a9f27f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Mon, 26 Nov 2018 22:04:32 +0400 Subject: hw: apply accel compat properties without touching globals MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of registering compat properties as globals, let's keep them in their own array, to avoid mixing with user globals. Introduce object_apply_global_props() function, to apply compatibility properties from a GPtrArray. Signed-off-by: Marc-André Lureau Reviewed-by: Igor Mammedov Reviewed-by: Cornelia Huck Acked-by: Eduardo Habkost --- hw/xen/xen-common.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'hw/xen') diff --git a/hw/xen/xen-common.c b/hw/xen/xen-common.c index 6ec14c7..4532aa8 100644 --- a/hw/xen/xen-common.c +++ b/hw/xen/xen-common.c @@ -174,18 +174,21 @@ static GlobalProperty xen_compat_props[] = { .driver = "migration", .property = "send-section-footer", .value = "off", - }, - { /* end of list */ }, + } }; static void xen_accel_class_init(ObjectClass *oc, void *data) { AccelClass *ac = ACCEL_CLASS(oc); + ac->name = "Xen"; ac->init_machine = xen_init; ac->setup_post = xen_setup_post; ac->allowed = &xen_allowed; - ac->global_props = xen_compat_props; + ac->compat_props = g_ptr_array_new(); + + compat_props_add(ac->compat_props, + xen_compat_props, G_N_ELEMENTS(xen_compat_props)); } #define TYPE_XEN_ACCEL ACCEL_CLASS_NAME("xen") -- cgit v1.1