[Top][All Lists]

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

Re: [PULL 1/2] hw: m68k: virt: Add compat machine for 6.1

From: Peter Maydell
Subject: Re: [PULL 1/2] hw: m68k: virt: Add compat machine for 6.1
Date: Wed, 10 Nov 2021 14:27:37 +0000

On Tue, 9 Nov 2021 at 23:33, BALATON Zoltan <balaton@eik.bme.hu> wrote:
> On Tue, 9 Nov 2021, Peter Maydell wrote:
> > On Tue, 9 Nov 2021 at 20:01, BALATON Zoltan <balaton@eik.bme.hu> wrote:
> >> But maybe it's too late to change at this point.
> >
> > Massively too late. We've been using this versioned-machine
> > scheme for over a decade, and the upheaval of changing the
> > way it works now would be rather out of proportion purely to
> > tidy up the list of machines in the help output...
> Well it's more than just tidy up the list, as not adding identical
> machines would have saved maintenance of adding these, lines of code in
> code base that do nothing just making it harder to read and also would be
> easier for users but these benefits are maybe less than the effort to
> change it now so then it's too late (not because how long it's been done
> this way but how much effort would be to change for how much benefit). I'm
> OK with that, was just wondering so asked it to clarify.

The other reason for always adding these machine types, which I forgot
about yesterday, is that it decouples the "add new machine type"
part from "incompatible changes in devices" part. We add the new
machine types as a boilerplate change to all versioned machines
at the start of a release cycle. Then later on when a particular
device needs a change that's only enabled in the newer machine
versions, we make that change in the device and add the property
setting to the hw_compat_6_1[] array in hw/core/machine.c. That
causes it to be automatically used for every versioned machine type
that uses that device. If we only added new versioned machines
"on demand", then for every device change like that we would need
to identify all the machine types which have that device or
could use that device, and then add the new versioned machine
at that point. I think that would be easy to forget to do for
all the machines, or to accidentally not identify every versioned
machine that can use the device.

-- PMM

reply via email to

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