[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH for-3.2 v4 15/28] hw: apply accel compat properties without touching globals



On Tue, 27 Nov 2018 13:27:48 +0400
Marc-André Lureau <marcandre.lureau@xxxxxxxxxx> wrote:

> Introduce object_apply_global_props() function, to apply compatibility
> properties from a GPtrArray.
> 
> For accel compatibility properties, apply them during
> device_post_init(), after accel_register_compat_props() has set them.
> 
> To populate the compatibility properties, introduce SET_COMPAT(), a
> more generic version of SET_MACHINE_COMPAT() that can set compat
> properties on other objects than Machine, and using GPtrArray.
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@xxxxxxxxxx>
> ---
>  include/hw/qdev-core.h | 13 +++++++++++++
>  include/qom/object.h   |  3 +++
>  include/sysemu/accel.h |  4 +---
>  accel/accel.c          | 12 ------------
>  hw/core/qdev.c         | 11 +++++++++++
>  hw/xen/xen-common.c    | 38 +++++++++++++++++++-------------------
>  qom/object.c           | 25 +++++++++++++++++++++++++
>  vl.c                   |  2 +-
>  8 files changed, 73 insertions(+), 35 deletions(-)
> 
[...]

> diff --git a/vl.c b/vl.c
> index fa25d1ae2d..c06e94271c 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -2963,7 +2963,7 @@ static void user_register_global_props(void)
>   */
>  static void register_global_properties(MachineState *ms)
>  {
> -    accel_register_compat_props(ms->accelerator);
> +    
> accel_register_compat_props(ACCEL_GET_CLASS(ms->accelerator)->compat_props);
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Acceptable way to do above is:
 Foo *foo =CAST(something)
 FUNC(foo->member)
if I recall correctly

>      machine_register_compat_props(ms);
>      user_register_global_props();
>  }


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.