qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] qdev_get_machine() can return something non-NULL but no


From: Igor Mammedov
Subject: Re: [Qemu-devel] qdev_get_machine() can return something non-NULL but not TYPE_MACHINE
Date: Tue, 12 Sep 2017 11:53:24 +0200

On Tue, 12 Sep 2017 10:11:32 +0100
Peter Maydell <address@hidden> wrote:

> On 12 September 2017 at 08:40, Igor Mammedov <address@hidden> wrote:
> > On Mon, 11 Sep 2017 14:33:03 +0100
> > Peter Maydell <address@hidden> wrote:  
> >> It's not possible in all cases to set a CPU property from the
> >> top level board code. In quite a lot of cases the CPU
> >> object is created by an SoC object which is in turn
> >> created by the board code, and there is no plumbing
> >> there to pass arbitrary properties through to the CPU
> >> object...  
> > there is a cleaner way without cpu accessing machine,
> > make it property of cpu and use compat machinery that
> > was invented for fixing up stuff of this kind.
> >
> > SET_MACHINE_COMPAT(MachineClass,
> >                    { .driver = "arm-cpu",
> >                      .property = "foo",
> >                      .value    = "off",
> >                    }
> >                   )  
> 
> It looks like we only use that machine-compat stuff on
> our versioned boards, which is pretty much the only place
> where we don't need to set this particular flag...
typically, yes it's used for versioned boards to, because
it's where we have to fixup/override defaults to keep compatibility.
But it's does not mean that it's limited to it.

in this case it allows to keep clean separation of device model
and not add an extra member to generic MachineClass which is used
by some old boards.


> thanks
> -- PMM
> 




reply via email to

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