qemu-arm
[Top][All Lists]
Advanced

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

Re: [Qemu-arm] [Qemu-devel] [PATCH for-3.2 v4 16/28] hw: apply machine c


From: Igor Mammedov
Subject: Re: [Qemu-arm] [Qemu-devel] [PATCH for-3.2 v4 16/28] hw: apply machine compat properties without touching globals
Date: Fri, 30 Nov 2018 12:37:10 +0100

On Thu, 29 Nov 2018 14:32:18 +0400
Marc-André Lureau <address@hidden> wrote:

> Hi
> On Wed, Nov 28, 2018 at 9:53 PM Igor Mammedov <address@hidden> wrote:
> >
> > On Tue, 27 Nov 2018 11:35:27 -0200
> > Eduardo Habkost <address@hidden> wrote:
> >  
> > > On Tue, Nov 27, 2018 at 05:10:05PM +0400, Marc-André Lureau wrote:  
> > > > On Tue, Nov 27, 2018 at 4:57 PM Eduardo Habkost <address@hidden> wrote: 
> > > >  
> > > > >
> > > > > On Tue, Nov 27, 2018 at 01:27:49PM +0400, Marc-André Lureau wrote:  
> > > > > > Similarly to accel properties, move compat properties out of globals
> > > > > > registration, and apply the machine compat properties during
> > > > > > device_post_init().
> > > > > >
> > > > > > Signed-off-by: Marc-André Lureau <address@hidden>  
> > > > > [...]  
> > > > > > diff --git a/hw/core/qdev.c b/hw/core/qdev.c
> > > > > > index 7066d28271..3b31b2c025 100644
> > > > > > --- a/hw/core/qdev.c
> > > > > > +++ b/hw/core/qdev.c
> > > > > > @@ -971,17 +971,26 @@ static void device_initfn(Object *obj)
> > > > > >  }
> > > > > >
> > > > > >  static const GPtrArray *ac_compat_props;
> > > > > > +static const GPtrArray *mc_compat_props;  
> > why you didn't use just 'compat_props' for both?
> > (it would be cleaner have single registry for compat
> > properties, and the place that takes care of registration
> > will take care of necessary ordering)  
> 
> There are two arrays, one from the accelerator class, the other from
> the machine class. We can't make it a singleton (all compats props for
> the various machines would be mixed).
My impression was that we register properties explicitly here,
so only registered ones endup here and in the order they were added.
Hence machine and accel compats could be merged here.
 
> We could create a third array that would be the set of both, but that
> would require more copy/allocation.
[...]



reply via email to

[Prev in Thread] Current Thread [Next in Thread]