[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2] hw/i386: Deprecate the machines pc-0.10 to p
From: |
Eduardo Habkost |
Subject: |
Re: [Qemu-devel] [PATCH v2] hw/i386: Deprecate the machines pc-0.10 to pc-1.2 |
Date: |
Tue, 30 May 2017 11:27:32 -0300 |
User-agent: |
Mutt/1.8.0 (2017-02-23) |
On Tue, May 30, 2017 at 12:35:01PM +0200, Gerd Hoffmann wrote:
> Hi,
>
> > > v2:
> > > - Deprecate machines up to pc-1.2
> > >
> > > hw/i386/pc_piix.c | 9 +++++++++
> > > 1 file changed, 9 insertions(+)
> > >
> > > diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
> > > index 9f102aa..aace378 100644
> > > --- a/hw/i386/pc_piix.c
> > > +++ b/hw/i386/pc_piix.c
> > > @@ -38,6 +38,7 @@
> > > #include "sysemu/kvm.h"
> > > #include "hw/kvm/clock.h"
> > > #include "sysemu/sysemu.h"
> > > +#include "sysemu/qtest.h"
> > > #include "hw/sysbus.h"
> > > #include "sysemu/arch_init.h"
> > > #include "sysemu/block-backend.h"
> > > @@ -84,6 +85,14 @@ static void pc_init1(MachineState *machine,
> > > MemoryRegion *pci_memory;
> > > MemoryRegion *rom_memory;
> > > ram_addr_t lowmem;
> > > + char *mc_name = MACHINE_CLASS(pcmc)->name;
> > > +
> > > + /* Machines pc-0.10 up to pc-1.2 are considered as deprecated
> > > */
> > > + if (!qtest_enabled() && (!strncmp(mc_name, "pc-0.", 5)
> > > + || (!strncmp(mc_name, "pc-1.", 5) && mc_name[5] < '3'))) {
> > > + error_report("Machine type '%s' is deprecated, "
> > > + "please use a newer type instead", mc_name);
> > > + }
> > >
> > > /*
> > > * Calculate ram split, for memory below and above 4G. It's a
> > > bit
> > >
> >
> > Ping! Any comments on this version of the patch?
>
> Does it make sense to build some infrastructure for this, so we don't
> have ad-hoc code to print deprecation warnings everywhere?
>
> Something like adding a "bool deprecated" or "char *deprecated_msg"
> field to MachineClass (and possibly elsewhere too, for example
> DeviceClass).
I would prefer that. And as our class_init
(pc_*_machine_options()) functions already call their successors,
we would need only one deprecated=true line in the code (at
pc_i440fx_1_3_machine_options()).
It's probably a good idea to report the deprecated flag on the
'query-machines' QMP command too.
--
Eduardo
Re: [Qemu-devel] [PATCH v2] hw/i386: Deprecate the machines pc-0.10 to pc-1.2, Michael S. Tsirkin, 2017/05/30