Re: [Xen-devel] [PATCH 01/32] hw/i386: Remove obsolete LoadStateHandler::load_state_old handlers

2019-11-01 Thread Dr. David Alan Gilbert
* Philippe Mathieu-Daudé (phi...@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 
> > Signed-off-by: Philippe Mathieu-Daudé 
> > ---
> >   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, >ar.pm1.evt.sts);
> > -qemu_get_be16s(f, >ar.pm1.evt.en);
> > -qemu_get_be16s(f, >ar.pm1.cnt.cnt);
> > -
> > -ret = vmstate_load_state(f, _apm, >apm, 1);
> > -if (ret) {
> > -return ret;
> > -}
> > -
> > -timer_get(f, s->ar.tmr.timer);
> > -qemu_get_sbe64s(f, >ar.tmr.overflow_time);
> > -
> > -qemu_get_be16s(f, (uint16_t *)s->ar.gpe.sts);
> > -for (i = 0; i < 3; i++) {
> > -qemu_get_be16s(f, );
> > -}
> > -
> > -qemu_get_be16s(f, (uint16_t *)s->ar.gpe.en);
> > -for (i = 0; i < 3; i++) {
> > -qemu_get_be16s(f, );
> > -}
> > -
> > -ret = vmstate_load_state(f, _pci_status,
> > -
> > >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, >apicbase);
> > -qemu_get_8s(f, >id);
> > -qemu_get_8s(f, >arb_id);
> > -qemu_get_8s(f, >tpr);
> > -qemu_get_be32s(f, >spurious_vec);
> > -qemu_get_8s(f, >log_dest);
> > -qemu_get_8s(f, >dest_mode);
> > -for (i = 0; i < 8; i++) {
> > -qemu_get_be32s(f, >isr[i]);
> > -qemu_get_be32s(f, >tmr[i]);
> > -qemu_get_be32s(f, >irr[i]);
> > -}
> > -for (i = 0; i < APIC_LVT_NB; i++) {
> > -qemu_get_be32s(f, >lvt[i]);
> > -}
> > -qemu_get_be32s(f, >esr);
> > -qemu_get_be32s(f, >icr[0]);
> > -qemu_get_be32s(f, >icr[1]);
> > -qemu_get_be32s(f, >divide_conf);
> > -s->count_shift = qemu_get_be32(f);
> > -qemu_get_be32s(f, >initial_count);
> > -s->initial_count_load_time = 

Re: [Xen-devel] [PATCH 01/32] hw/i386: Remove obsolete LoadStateHandler::load_state_old handlers

2019-10-17 Thread Aleksandar Markovic
On Tuesday, October 15, 2019, 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 
> Signed-off-by: Philippe Mathieu-Daudé 
> ---
>  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(-)
>
>
Reviewed-by: Aleksandar Markovic 



> 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, >ar.pm1.evt.sts);
> -qemu_get_be16s(f, >ar.pm1.evt.en);
> -qemu_get_be16s(f, >ar.pm1.cnt.cnt);
> -
> -ret = vmstate_load_state(f, _apm, >apm, 1);
> -if (ret) {
> -return ret;
> -}
> -
> -timer_get(f, s->ar.tmr.timer);
> -qemu_get_sbe64s(f, >ar.tmr.overflow_time);
> -
> -qemu_get_be16s(f, (uint16_t *)s->ar.gpe.sts);
> -for (i = 0; i < 3; i++) {
> -qemu_get_be16s(f, );
> -}
> -
> -qemu_get_be16s(f, (uint16_t *)s->ar.gpe.en);
> -for (i = 0; i < 3; i++) {
> -qemu_get_be16s(f, );
> -}
> -
> -ret = vmstate_load_state(f, _pci_status,
> ->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,
>  .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, >apicbase);
> -qemu_get_8s(f, >id);
> -qemu_get_8s(f, >arb_id);
> -qemu_get_8s(f, >tpr);
> -qemu_get_be32s(f, >spurious_vec);
> -qemu_get_8s(f, >log_dest);
> -qemu_get_8s(f, >dest_mode);
> -for (i = 0; i < 8; i++) {
> -qemu_get_be32s(f, >isr[i]);
> -qemu_get_be32s(f, >tmr[i]);
> -qemu_get_be32s(f, >irr[i]);
> -}
> -for (i = 0; i < APIC_LVT_NB; i++) {
> -qemu_get_be32s(f, >lvt[i]);
> -}
> -qemu_get_be32s(f, >esr);
> -qemu_get_be32s(f, >icr[0]);
> -qemu_get_be32s(f, >icr[1]);
> -qemu_get_be32s(f, >divide_conf);
> -s->count_shift = qemu_get_be32(f);
> -qemu_get_be32s(f, >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,
>  

Re: [Xen-devel] [PATCH 01/32] hw/i386: Remove obsolete LoadStateHandler::load_state_old handlers

2019-10-15 Thread Philippe Mathieu-Daudé

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 
Signed-off-by: Philippe Mathieu-Daudé 
---
  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, >ar.pm1.evt.sts);
-qemu_get_be16s(f, >ar.pm1.evt.en);
-qemu_get_be16s(f, >ar.pm1.cnt.cnt);
-
-ret = vmstate_load_state(f, _apm, >apm, 1);
-if (ret) {
-return ret;
-}
-
-timer_get(f, s->ar.tmr.timer);
-qemu_get_sbe64s(f, >ar.tmr.overflow_time);
-
-qemu_get_be16s(f, (uint16_t *)s->ar.gpe.sts);
-for (i = 0; i < 3; i++) {
-qemu_get_be16s(f, );
-}
-
-qemu_get_be16s(f, (uint16_t *)s->ar.gpe.en);
-for (i = 0; i < 3; i++) {
-qemu_get_be16s(f, );
-}
-
-ret = vmstate_load_state(f, _pci_status,
->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,
  .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, >apicbase);
-qemu_get_8s(f, >id);
-qemu_get_8s(f, >arb_id);
-qemu_get_8s(f, >tpr);
-qemu_get_be32s(f, >spurious_vec);
-qemu_get_8s(f, >log_dest);
-qemu_get_8s(f, >dest_mode);
-for (i = 0; i < 8; i++) {
-qemu_get_be32s(f, >isr[i]);
-qemu_get_be32s(f, >tmr[i]);
-qemu_get_be32s(f, >irr[i]);
-}
-for (i = 0; i < APIC_LVT_NB; i++) {
-qemu_get_be32s(f, >lvt[i]);
-}
-qemu_get_be32s(f, >esr);
-qemu_get_be32s(f, >icr[0]);
-qemu_get_be32s(f, >icr[1]);
-qemu_get_be32s(f, >divide_conf);
-s->count_shift = qemu_get_be32(f);
-qemu_get_be32s(f, >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,
  .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 

[Xen-devel] [PATCH 01/32] hw/i386: Remove obsolete LoadStateHandler::load_state_old handlers

2019-10-15 Thread Philippe Mathieu-Daudé
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 
Signed-off-by: Philippe Mathieu-Daudé 
---
 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, >ar.pm1.evt.sts);
-qemu_get_be16s(f, >ar.pm1.evt.en);
-qemu_get_be16s(f, >ar.pm1.cnt.cnt);
-
-ret = vmstate_load_state(f, _apm, >apm, 1);
-if (ret) {
-return ret;
-}
-
-timer_get(f, s->ar.tmr.timer);
-qemu_get_sbe64s(f, >ar.tmr.overflow_time);
-
-qemu_get_be16s(f, (uint16_t *)s->ar.gpe.sts);
-for (i = 0; i < 3; i++) {
-qemu_get_be16s(f, );
-}
-
-qemu_get_be16s(f, (uint16_t *)s->ar.gpe.en);
-for (i = 0; i < 3; i++) {
-qemu_get_be16s(f, );
-}
-
-ret = vmstate_load_state(f, _pci_status,
->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,
 .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, >apicbase);
-qemu_get_8s(f, >id);
-qemu_get_8s(f, >arb_id);
-qemu_get_8s(f, >tpr);
-qemu_get_be32s(f, >spurious_vec);
-qemu_get_8s(f, >log_dest);
-qemu_get_8s(f, >dest_mode);
-for (i = 0; i < 8; i++) {
-qemu_get_be32s(f, >isr[i]);
-qemu_get_be32s(f, >tmr[i]);
-qemu_get_be32s(f, >irr[i]);
-}
-for (i = 0; i < APIC_LVT_NB; i++) {
-qemu_get_be32s(f, >lvt[i]);
-}
-qemu_get_be32s(f, >esr);
-qemu_get_be32s(f, >icr[0]);
-qemu_get_be32s(f, >icr[1]);
-qemu_get_be32s(f, >divide_conf);
-s->count_shift = qemu_get_be32(f);
-qemu_get_be32s(f, >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,
 .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