qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCHv2 2/4] pc: refactor compat code


From: Michael S. Tsirkin
Subject: Re: [Qemu-devel] [PATCHv2 2/4] pc: refactor compat code
Date: Wed, 29 Aug 2012 00:29:45 +0300

On Tue, Aug 28, 2012 at 01:37:18PM -0300, Marcelo Tosatti wrote:
> On Tue, Aug 28, 2012 at 07:31:24PM +0300, Michael S. Tsirkin wrote:
> > On Tue, Aug 28, 2012 at 01:23:18PM -0300, Marcelo Tosatti wrote:
> > > On Mon, Aug 27, 2012 at 03:20:13PM +0300, Michael S. Tsirkin wrote:
> > > > In preparation to adding PV EOI migration for 1.2,
> > > > trivially refactor some some compat code
> > > > to make it easier to add version specific
> > > > cpuid tweaks.
> > > > 
> > > > Signed-off-by: Michael S. Tsirkin <address@hidden>
> > > > ---
> > > >  hw/pc_piix.c | 44 ++++++++++++++++++++++++++++++++++++--------
> > > >  1 file changed, 36 insertions(+), 8 deletions(-)
> > > 
> > > Why can't you clear the cpuid bit in kvm paravirt leaf at hw/pc_piix.c, 
> > > leaving compat code isolated there?
> > 
> > This is not how we handle it for compat properties:
> > there we set flag in pc_piix and make devices look at
> > that flag.
> > And it makes sense because what you suggest does not scale: we can not
> > teach pc_piix about quirks of all hardware.
> 
> What is there to scale? Old machines are static, they don't change.

But we keep adding new features in each version and each of them adds
new device specific stuff. If we stick all logic in pc_piix.c it will
quickly have to know about internals of virtio,cdrom,ide,cpu ...

> This
> way you are putting the burden of compat support in the generic driver
> code, which has better things to worry about than old machine types.
> 
> IMO it is better to have all of the compat mess localized.
>
> > It will also scale better if we ever get interested about
> > compatibility and migration for non pc machines.
> > -- 
> > MST
> 
> Alright, will wait a couple of days before merging.



reply via email to

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