From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: "Philippe Mathieu-Daudé" <philmd@redhat.com>
Cc: qemu-devel@nongnu.org,
"Daniel P . Berrange" <berrange@redhat.com>,
"Juan Quintela" <quintela@redhat.com>,
"Aleksandar Markovic" <amarkovic@wavecomp.com>,
"Aurelien Jarno" <aurelien@aurel32.net>,
"Eduardo Habkost" <ehabkost@redhat.com>,
"Thomas Huth" <thuth@redhat.com>,
"Igor Mammedov" <imammedo@redhat.com>,
"Anthony Perard" <anthony.perard@citrix.com>,
"Stefano Stabellini" <sstabellini@kernel.org>,
"Paul Durrant" <paul@xen.org>,
"Hervé Poussineau" <hpoussin@reactos.org>,
"Aleksandar Rikalo" <aleksandar.rikalo@rt-rk.com>,
xen-devel@lists.xenproject.org,
"Laurent Vivier" <lvivier@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Richard Henderson" <rth@twiddle.net>,
kvm@vger.kernel.org, "Peter Maydell" <peter.maydell@linaro.org>
Subject: Re: [PATCH 01/32] hw/i386: Remove obsolete LoadStateHandler::load_state_old handlers
Date: Fri, 1 Nov 2019 10:19:51 +0000 [thread overview]
Message-ID: <20191101101951.GB2432@work-vm> (raw)
In-Reply-To: <cb2a33d5-16a7-67bb-b155-1e3d8e2e2cbc@redhat.com>
* Philippe Mathieu-Daudé (philmd@redhat.com) wrote:
> I forgot to Cc David and Daniel for this one.
>
> On 10/15/19 6:26 PM, Philippe Mathieu-Daudé wrote:
> > These devices implemented their load_state_old() handler 10 years
> > ago, previous to QEMU v0.12.
> > Since commit cc425b5ddf removed the pc-0.10 and pc-0.11 machines,
> > we can drop this code.
> >
> > Note: the mips_r4k machine started to use the i8254 device just
> > after QEMU v0.5.0, but the MIPS machine types are not versioned,
> > so there is no migration compatibility issue removing this handler.
> >
> > Suggested-by: Peter Maydell <peter.maydell@linaro.org>
> > Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> > ---
> > hw/acpi/piix4.c | 40 ---------------------------------
> > hw/intc/apic_common.c | 49 -----------------------------------------
> > hw/pci-host/piix.c | 25 ---------------------
> > hw/timer/i8254_common.c | 40 ---------------------------------
> > 4 files changed, 154 deletions(-)
> >
> > diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
> > index 5742c3df87..1d29d438c7 100644
> > --- a/hw/acpi/piix4.c
> > +++ b/hw/acpi/piix4.c
> > @@ -42,7 +42,6 @@
> > #include "hw/acpi/memory_hotplug.h"
> > #include "hw/acpi/acpi_dev_interface.h"
> > #include "hw/xen/xen.h"
> > -#include "migration/qemu-file-types.h"
> > #include "migration/vmstate.h"
> > #include "hw/core/cpu.h"
> > #include "trace.h"
> > @@ -205,43 +204,6 @@ static const VMStateDescription vmstate_pci_status = {
> > }
> > };
> > -static int acpi_load_old(QEMUFile *f, void *opaque, int version_id)
> > -{
> > - PIIX4PMState *s = opaque;
> > - int ret, i;
> > - uint16_t temp;
> > -
> > - ret = pci_device_load(PCI_DEVICE(s), f);
> > - if (ret < 0) {
> > - return ret;
> > - }
> > - qemu_get_be16s(f, &s->ar.pm1.evt.sts);
> > - qemu_get_be16s(f, &s->ar.pm1.evt.en);
> > - qemu_get_be16s(f, &s->ar.pm1.cnt.cnt);
> > -
> > - ret = vmstate_load_state(f, &vmstate_apm, &s->apm, 1);
> > - if (ret) {
> > - return ret;
> > - }
> > -
> > - timer_get(f, s->ar.tmr.timer);
> > - qemu_get_sbe64s(f, &s->ar.tmr.overflow_time);
> > -
> > - qemu_get_be16s(f, (uint16_t *)s->ar.gpe.sts);
> > - for (i = 0; i < 3; i++) {
> > - qemu_get_be16s(f, &temp);
> > - }
> > -
> > - qemu_get_be16s(f, (uint16_t *)s->ar.gpe.en);
> > - for (i = 0; i < 3; i++) {
> > - qemu_get_be16s(f, &temp);
> > - }
> > -
> > - ret = vmstate_load_state(f, &vmstate_pci_status,
> > - &s->acpi_pci_hotplug.acpi_pcihp_pci_status[ACPI_PCIHP_BSEL_DEFAULT], 1);
> > - return ret;
> > -}
> > -
> > static bool vmstate_test_use_acpi_pci_hotplug(void *opaque, int version_id)
> > {
> > PIIX4PMState *s = opaque;
> > @@ -313,8 +275,6 @@ static const VMStateDescription vmstate_acpi = {
> > .name = "piix4_pm",
> > .version_id = 3,
> > .minimum_version_id = 3,
> > - .minimum_version_id_old = 1,
> > - .load_state_old = acpi_load_old,
Can you exlain why this is old enough? That was chnanged by b0b873a
that was some version id specific hack, but also 4cf3e6f3d85 - isn't
that before 0.12.0 ?
> > .post_load = vmstate_acpi_post_load,
> > .fields = (VMStateField[]) {
> > VMSTATE_PCI_DEVICE(parent_obj, PIIX4PMState),
> > diff --git a/hw/intc/apic_common.c b/hw/intc/apic_common.c
> > index aafd8e0e33..375cb6abe9 100644
> > --- a/hw/intc/apic_common.c
> > +++ b/hw/intc/apic_common.c
> > @@ -31,7 +31,6 @@
> > #include "sysemu/kvm.h"
> > #include "hw/qdev-properties.h"
> > #include "hw/sysbus.h"
> > -#include "migration/qemu-file-types.h"
> > #include "migration/vmstate.h"
> > static int apic_irq_delivered;
> > @@ -262,52 +261,6 @@ static void apic_reset_common(DeviceState *dev)
> > apic_init_reset(dev);
> > }
> > -/* This function is only used for old state version 1 and 2 */
> > -static int apic_load_old(QEMUFile *f, void *opaque, int version_id)
> > -{
> > - APICCommonState *s = opaque;
> > - APICCommonClass *info = APIC_COMMON_GET_CLASS(s);
> > - int i;
> > -
> > - if (version_id > 2) {
> > - return -EINVAL;
> > - }
> > -
> > - /* XXX: what if the base changes? (registered memory regions) */
> > - qemu_get_be32s(f, &s->apicbase);
> > - qemu_get_8s(f, &s->id);
> > - qemu_get_8s(f, &s->arb_id);
> > - qemu_get_8s(f, &s->tpr);
> > - qemu_get_be32s(f, &s->spurious_vec);
> > - qemu_get_8s(f, &s->log_dest);
> > - qemu_get_8s(f, &s->dest_mode);
> > - for (i = 0; i < 8; i++) {
> > - qemu_get_be32s(f, &s->isr[i]);
> > - qemu_get_be32s(f, &s->tmr[i]);
> > - qemu_get_be32s(f, &s->irr[i]);
> > - }
> > - for (i = 0; i < APIC_LVT_NB; i++) {
> > - qemu_get_be32s(f, &s->lvt[i]);
> > - }
> > - qemu_get_be32s(f, &s->esr);
> > - qemu_get_be32s(f, &s->icr[0]);
> > - qemu_get_be32s(f, &s->icr[1]);
> > - qemu_get_be32s(f, &s->divide_conf);
> > - s->count_shift = qemu_get_be32(f);
> > - qemu_get_be32s(f, &s->initial_count);
> > - s->initial_count_load_time = qemu_get_be64(f);
> > - s->next_time = qemu_get_be64(f);
> > -
> > - if (version_id >= 2) {
> > - s->timer_expiry = qemu_get_be64(f);
> > - }
> > -
> > - if (info->post_load) {
> > - info->post_load(s);
> > - }
> > - return 0;
> > -}
> > -
> > static const VMStateDescription vmstate_apic_common;
> > static void apic_common_realize(DeviceState *dev, Error **errp)
> > @@ -408,8 +361,6 @@ static const VMStateDescription vmstate_apic_common = {
> > .name = "apic",
> > .version_id = 3,
> > .minimum_version_id = 3,
> > - .minimum_version_id_old = 1,
> > - .load_state_old = apic_load_old,
OK, I see that was changed by 695dcf71 in 2009 before 0.12.0
> > .pre_load = apic_pre_load,
> > .pre_save = apic_dispatch_pre_save,
> > .post_load = apic_dispatch_post_load,
> > diff --git a/hw/pci-host/piix.c b/hw/pci-host/piix.c
> > index 135c645535..2f4cbcbfe9 100644
> > --- a/hw/pci-host/piix.c
> > +++ b/hw/pci-host/piix.c
> > @@ -33,7 +33,6 @@
> > #include "qapi/error.h"
> > #include "qemu/range.h"
> > #include "hw/xen/xen.h"
> > -#include "migration/qemu-file-types.h"
> > #include "migration/vmstate.h"
> > #include "hw/pci-host/pam.h"
> > #include "sysemu/reset.h"
> > @@ -174,28 +173,6 @@ static void i440fx_write_config(PCIDevice *dev,
> > }
> > }
> > -static int i440fx_load_old(QEMUFile* f, void *opaque, int version_id)
> > -{
> > - PCII440FXState *d = opaque;
> > - PCIDevice *pd = PCI_DEVICE(d);
> > - int ret, i;
> > - uint8_t smm_enabled;
> > -
> > - ret = pci_device_load(pd, f);
> > - if (ret < 0)
> > - return ret;
> > - i440fx_update_memory_mappings(d);
> > - qemu_get_8s(f, &smm_enabled);
> > -
> > - if (version_id == 2) {
> > - for (i = 0; i < PIIX_NUM_PIRQS; i++) {
> > - qemu_get_be32(f); /* dummy load for compatibility */
> > - }
> > - }
> > -
> > - return 0;
> > -}
> > -
> > static int i440fx_post_load(void *opaque, int version_id)
> > {
> > PCII440FXState *d = opaque;
> > @@ -208,8 +185,6 @@ static const VMStateDescription vmstate_i440fx = {
> > .name = "I440FX",
> > .version_id = 3,
> > .minimum_version_id = 3,
> > - .minimum_version_id_old = 1,
> > - .load_state_old = i440fx_load_old,
Changed in 2009 before 0.12; OK
> > .post_load = i440fx_post_load,
> > .fields = (VMStateField[]) {
> > VMSTATE_PCI_DEVICE(parent_obj, PCII440FXState),
> > diff --git a/hw/timer/i8254_common.c b/hw/timer/i8254_common.c
> > index 57bf10cc94..050875b497 100644
> > --- a/hw/timer/i8254_common.c
> > +++ b/hw/timer/i8254_common.c
> > @@ -29,7 +29,6 @@
> > #include "qemu/timer.h"
> > #include "hw/timer/i8254.h"
> > #include "hw/timer/i8254_internal.h"
> > -#include "migration/qemu-file-types.h"
> > #include "migration/vmstate.h"
> > /* val must be 0 or 1 */
> > @@ -202,43 +201,6 @@ static const VMStateDescription vmstate_pit_channel = {
> > }
> > };
> > -static int pit_load_old(QEMUFile *f, void *opaque, int version_id)
> > -{
> > - PITCommonState *pit = opaque;
> > - PITCommonClass *c = PIT_COMMON_GET_CLASS(pit);
> > - PITChannelState *s;
> > - int i;
> > -
> > - if (version_id != 1) {
> > - return -EINVAL;
> > - }
> > -
> > - for (i = 0; i < 3; i++) {
> > - s = &pit->channels[i];
> > - s->count = qemu_get_be32(f);
> > - qemu_get_be16s(f, &s->latched_count);
> > - qemu_get_8s(f, &s->count_latched);
> > - qemu_get_8s(f, &s->status_latched);
> > - qemu_get_8s(f, &s->status);
> > - qemu_get_8s(f, &s->read_state);
> > - qemu_get_8s(f, &s->write_state);
> > - qemu_get_8s(f, &s->write_latch);
> > - qemu_get_8s(f, &s->rw_mode);
> > - qemu_get_8s(f, &s->mode);
> > - qemu_get_8s(f, &s->bcd);
> > - qemu_get_8s(f, &s->gate);
> > - s->count_load_time = qemu_get_be64(f);
> > - s->irq_disabled = 0;
> > - if (i == 0) {
> > - s->next_transition_time = qemu_get_be64(f);
> > - }
> > - }
> > - if (c->post_load) {
> > - c->post_load(pit);
> > - }
> > - return 0;
> > -}
> > -
> > static int pit_dispatch_pre_save(void *opaque)
> > {
> > PITCommonState *s = opaque;
> > @@ -266,8 +228,6 @@ static const VMStateDescription vmstate_pit_common = {
> > .name = "i8254",
> > .version_id = 3,
> > .minimum_version_id = 2,
> > - .minimum_version_id_old = 1,
> > - .load_state_old = pit_load_old,
Also 2009 pre 0.12
> > .pre_save = pit_dispatch_pre_save,
> > .post_load = pit_dispatch_post_load,
> > .fields = (VMStateField[]) {
> >
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
next prev parent reply other threads:[~2019-11-01 10:20 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-15 16:26 [PATCH 00/32] hw/i386/pc: Split PIIX3 southbridge from i440FX northbridge Philippe Mathieu-Daudé
2019-10-15 16:26 ` [PATCH 01/32] hw/i386: Remove obsolete LoadStateHandler::load_state_old handlers Philippe Mathieu-Daudé
2019-10-15 16:29 ` Philippe Mathieu-Daudé
2019-11-01 10:19 ` Dr. David Alan Gilbert [this message]
2019-10-15 16:26 ` [PATCH 02/32] hw/i386/pc: Move kvm_i8259_init() declaration to sysemu/kvm.h Philippe Mathieu-Daudé
2019-10-17 15:04 ` Thomas Huth
2019-10-17 15:31 ` Philippe Mathieu-Daudé
2019-10-17 15:40 ` Thomas Huth
[not found] ` <CAL1e-=iC9hR-jqTSu9c6KtgiNWFwftnTMq9W87NWFPb37hjCoA@mail.gmail.com>
2019-10-17 15:08 ` Philippe Mathieu-Daudé
2019-10-15 16:26 ` [PATCH 03/32] mc146818rtc: move structure to header file Philippe Mathieu-Daudé
2019-10-15 16:26 ` [PATCH 04/32] mc146818rtc: Move RTC_ISA_IRQ definition Philippe Mathieu-Daudé
[not found] ` <CAL1e-=jOiMe2--=ht0Wgwh0a_At=sDhUzX7EkNU86nPt230a-g@mail.gmail.com>
2019-10-17 15:12 ` Philippe Mathieu-Daudé
2019-10-15 16:26 ` [PATCH 05/32] mc146818rtc: Include "mc146818rtc_regs.h" directly in mc146818rtc.c Philippe Mathieu-Daudé
2019-10-15 16:26 ` [PATCH 06/32] mc146818rtc: always register rtc to rtc list Philippe Mathieu-Daudé
2019-10-15 16:26 ` [PATCH 07/32] MAINTAINERS: Keep PIIX4 South Bridge separate from PC Chipsets Philippe Mathieu-Daudé
2019-10-15 16:26 ` [PATCH 08/32] piix4: rename some variables in realize function Philippe Mathieu-Daudé
2019-10-17 15:13 ` Thomas Huth
2019-10-15 16:26 ` [PATCH 09/32] piix4: add Reset Control Register Philippe Mathieu-Daudé
2019-10-15 16:26 ` [PATCH 10/32] piix4: add a i8259 interrupt controller as specified in datasheet Philippe Mathieu-Daudé
2019-10-15 16:26 ` [PATCH 11/32] Revert "irq: introduce qemu_irq_proxy()" Philippe Mathieu-Daudé
2019-10-17 15:16 ` Thomas Huth
2019-10-15 16:26 ` [PATCH 12/32] piix4: rename PIIX4 object to piix4-isa Philippe Mathieu-Daudé
2019-10-15 16:26 ` [PATCH 13/32] piix4: convert reset function to QOM Philippe Mathieu-Daudé
2019-10-15 16:26 ` [PATCH 14/32] piix4: add a i8257 dma controller as specified in datasheet Philippe Mathieu-Daudé
2019-10-17 15:19 ` Thomas Huth
2019-10-15 16:26 ` [PATCH 15/32] piix4: add a i8254 pit " Philippe Mathieu-Daudé
2019-10-15 16:26 ` [PATCH 16/32] piix4: add a mc146818rtc " Philippe Mathieu-Daudé
2019-10-15 16:26 ` [PATCH 17/32] hw/mips/mips_malta: Create IDE hard drive array dynamically Philippe Mathieu-Daudé
2019-10-15 16:26 ` [PATCH 18/32] hw/mips/mips_malta: Extract the PIIX4 creation code as piix4_create() Philippe Mathieu-Daudé
2019-10-15 16:26 ` [PATCH 19/32] hw/isa/piix4: Move piix4_create() to hw/isa/piix4.c Philippe Mathieu-Daudé
2019-10-15 16:26 ` [PATCH 20/32] hw/i386/pc: Extract pc_gsi_create() Philippe Mathieu-Daudé
2019-10-17 15:33 ` Thomas Huth
2019-10-15 16:26 ` [PATCH 21/32] hw/i386/pc: Reduce gsi_handler scope Philippe Mathieu-Daudé
[not found] ` <CAL1e-=hLUDDqFiV8W1f2PFGYJMomvmZUXmjA55X7WEEYMykjHQ@mail.gmail.com>
2019-10-17 15:37 ` Philippe Mathieu-Daudé
2019-10-17 15:41 ` Thomas Huth
2019-10-15 16:26 ` [PATCH 22/32] hw/i386/pc: Move gsi_state creation code Philippe Mathieu-Daudé
2019-10-15 16:26 ` [PATCH 23/32] hw/i386/pc: Extract pc_i8259_create() Philippe Mathieu-Daudé
2019-10-15 16:26 ` [PATCH 24/32] hw/i386/pc: Remove kvm_i386.h include Philippe Mathieu-Daudé
2019-10-15 16:26 ` [PATCH 25/32] hw/pci-host/piix: Extract piix3_create() Philippe Mathieu-Daudé
2019-10-15 16:26 ` [PATCH 26/32] hw/pci-host/piix: Move RCR_IOPORT register definition Philippe Mathieu-Daudé
[not found] ` <CAL1e-=jVr+idQKNdOGSrODeq7XU-0JcCFTwapqk9-JvAKxk6Pw@mail.gmail.com>
2019-10-18 10:13 ` Philippe Mathieu-Daudé
2019-10-15 16:27 ` [PATCH 27/32] hw/pci-host/piix: Define and use the PIIX IRQ Route Control Registers Philippe Mathieu-Daudé
2019-10-16 11:24 ` Paul Durrant
2019-10-15 16:27 ` [PATCH 28/32] hw/pci-host/piix: Move i440FX declarations to hw/pci-host/i440fx.h Philippe Mathieu-Daudé
2019-10-15 16:27 ` [PATCH 29/32] hw/pci-host/piix: Fix code style issues Philippe Mathieu-Daudé
2019-10-15 16:27 ` [PATCH 30/32] hw/pci-host/piix: Extract PIIX3 functions to hw/isa/piix3.c Philippe Mathieu-Daudé
2019-10-15 16:27 ` [PATCH 31/32] hw/pci-host: Rename incorrectly named 'piix' as 'i440fx' Philippe Mathieu-Daudé
2019-10-15 16:27 ` [PATCH 32/32] hw/pci-host/i440fx: Remove the last PIIX3 traces Philippe Mathieu-Daudé
2019-10-16 4:13 ` [PATCH 00/32] hw/i386/pc: Split PIIX3 southbridge from i440FX northbridge no-reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191101101951.GB2432@work-vm \
--to=dgilbert@redhat.com \
--cc=aleksandar.rikalo@rt-rk.com \
--cc=amarkovic@wavecomp.com \
--cc=anthony.perard@citrix.com \
--cc=aurelien@aurel32.net \
--cc=berrange@redhat.com \
--cc=ehabkost@redhat.com \
--cc=hpoussin@reactos.org \
--cc=imammedo@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=lvivier@redhat.com \
--cc=marcel.apfelbaum@gmail.com \
--cc=mst@redhat.com \
--cc=paul@xen.org \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=rth@twiddle.net \
--cc=sstabellini@kernel.org \
--cc=thuth@redhat.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).