migration queue
Hi Peter
This is the previous pull request with:
- Added fix for RDMA
- Change default downtime
- fix the compilation error on 32bits, basically use RAM_ADDR_FMT for the format checked that it compiles
Please, apply, Juan.
The following changes since commit 06a59afac4505f5ed942db4200e5ca16fcbba74d:
Merge remote-tracking branch 'remotes/kraxel/tags/pull-usb-20140613-1' into staging (2014-06-13 18:18:55 +0100)
are available in the git repository at:
git://github.com/juanquintela/qemu.git tags/migration/20140616
for you to fetch changes up to db80facefa62dff42bb50c73b0f03eda5f732b49:
migration: catch unknown flags in ram_load (2014-06-16 04:55:27 +0200)
----------------------------------------------------------------
migration/next for 20140616
----------------------------------------------------------------
Alexey Kardashevskiy (1):
migration: Increase default max_downtime from 30ms to 300ms
Gonglei (1):
rdma: Fix block during rdma migration
Juan Quintela (3):
savevm: Remove all the unneeded version_minimum_id_old (ppc)
savevm: Remove all the unneeded version_minimum_id_old (x86)
vmstate: Refactor opening of files
Peter Lieven (1):
migration: catch unknown flags in ram_load
arch_init.c | 42 +++++++++++++++------------- hw/acpi/ich9.c | 1 - hw/acpi/pcihp.c | 3 +- hw/acpi/piix4.c | 8 ++---- hw/audio/ac97.c | 6 ++-- hw/audio/cs4231.c | 3 +- hw/audio/cs4231a.c | 3 +- hw/audio/es1370.c | 6 ++-- hw/audio/gus.c | 3 +- hw/audio/hda-codec.c | 4 +-- hw/audio/intel-hda.c | 4 +-- hw/audio/sb16.c | 3 +- hw/block/fdc.c | 16 ++++------- hw/char/escc.c | 6 ++-- hw/char/serial-pci.c | 4 +-- hw/char/serial.c | 2 +- hw/char/spapr_vty.c | 3 +- hw/display/cirrus_vga.c | 6 ++-- hw/display/vga-pci.c | 3 +- hw/display/vga.c | 3 +- hw/display/vmware_vga.c | 6 ++-- hw/dma/i8257.c | 6 ++-- hw/i386/acpi-build.c | 3 +- hw/i386/kvm/clock.c | 1 - hw/i386/kvmvapic.c | 3 -- hw/i386/pc.c | 3 +- hw/i386/xen/xen_platform.c | 3 +- hw/ide/ahci.c | 6 ++-- hw/ide/ich.c | 2 +- hw/ide/isa.c | 3 +- hw/ide/pci.c | 12 +++----- hw/input/pckbd.c | 6 ++-- hw/input/ps2.c | 12 +++----- hw/input/vmmouse.c | 3 +- hw/intc/heathrow_pic.c | 6 ++-- hw/intc/i8259_common.c | 1 - hw/intc/ioapic_common.c | 1 - hw/intc/xics.c | 9 ++---- hw/isa/apm.c | 1 - hw/isa/lpc_ich9.c | 1 - hw/isa/piix4.c | 3 +- hw/isa/vt82c686.c | 6 ++-- hw/net/e1000.c | 6 ++-- hw/net/eepro100.c | 3 +- hw/net/ne2000-isa.c | 3 +- hw/net/ne2000.c | 6 ++-- hw/net/pcnet-pci.c | 3 +- hw/net/pcnet.c | 3 +- hw/net/rtl8139.c | 9 ++---- hw/net/spapr_llan.c | 3 +- hw/net/vmxnet3.c | 4 +-- hw/nvram/eeprom93xx.c | 3 +- hw/nvram/fw_cfg.c | 3 +- hw/pci-bridge/ioh3420.c | 1 - hw/pci-bridge/xio3130_downstream.c | 1 - hw/pci-bridge/xio3130_upstream.c | 1 - hw/pci-host/piix.c | 7 ++--- hw/pci-host/ppce500.c | 9 ++---- hw/pci-host/q35.c | 3 +- hw/pci/pci.c | 9 ++---- hw/pci/pcie_aer.c | 6 ++-- hw/ppc/ppc4xx_pci.c | 9 ++---- hw/ppc/spapr.c | 3 +- hw/ppc/spapr_iommu.c | 3 +- hw/ppc/spapr_pci.c | 9 ++---- hw/ppc/spapr_vio.c | 3 +- hw/scsi/lsi53c895a.c | 3 +- hw/scsi/megasas.c | 3 +- hw/scsi/scsi-bus.c | 4 +-- hw/scsi/scsi-disk.c | 1 - hw/scsi/spapr_vscsi.c | 6 ++-- hw/scsi/vmw_pvscsi.c | 3 +- hw/timer/hpet.c | 9 ++---- hw/timer/i8254_common.c | 1 - hw/timer/m48t59.c | 3 +- hw/timer/mc146818rtc.c | 3 +- hw/watchdog/wdt_i6300esb.c | 14 +++++----- hw/watchdog/wdt_ib700.c | 3 +- migration-rdma.c | 1 + migration.c | 4 +-- target-i386/machine.c | 57 +++++++++++++------------------------- target-ppc/machine.c | 38 +++++++++---------------- tests/test-vmstate.c | 38 ++++++++++++------------- 83 files changed, 195 insertions(+), 332 deletions(-)
PATCH 1/6 savevm: Remove all the unneeded version_minimum_id_old (ppc)
After previous Peter patch, they are redundant. This way we don't assign them except when needed. Once there, there were lots of case where the ".fields" indentation was wrong:
.fields = (VMStateField []) {
and
.fields = (VMStateField []) {Change all the combinations to:
.fields = (VMStateField[]){The biggest problem (appart from aesthetics) was that checkpatch complained when we copy&pasted the code from one place to another.
--- hw/char/escc.c | 6 ++---- hw/char/spapr_vty.c | 3 +-- hw/intc/heathrow_pic.c | 6 ++---- hw/intc/xics.c | 9 +++------ hw/net/spapr_llan.c | 3 +-- hw/pci-host/ppce500.c | 9 +++------ hw/ppc/ppc4xx_pci.c | 9 +++------ hw/ppc/spapr.c | 3 +-- hw/ppc/spapr_iommu.c | 3 +-- hw/ppc/spapr_pci.c | 9 +++------ hw/ppc/spapr_vio.c | 3 +-- hw/scsi/spapr_vscsi.c | 6 ++---- hw/timer/m48t59.c | 3 +-- target-ppc/machine.c | 38 +++++++++++++------------------------- 14 files changed, 37 insertions(+), 73 deletions(-)
hw/char/escc.c +2 -4
@@ -660,8 +660,7 @@ static const VMStateDescription vmstate_escc_chn = { .name ="escc_chn", .version_id = 2, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT32 (vmstate_dummy, ChannelState),VMSTATE_UINT32 (reg, ChannelState),VMSTATE_UINT32 (rxint, ChannelState),
@@ -680,8 +679,7 @@ static const VMStateDescription vmstate_escc = { .name ="escc", .version_id = 2, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_STRUCT_ARRAY (chn, ESCCState,2 ,2 , vmstate_escc_chn, ChannelState),VMSTATE_END_OF_LIST ()
hw/char/spapr_vty.c +1 -2
@@ -148,8 +148,7 @@ static const VMStateDescription vmstate_spapr_vty = { .name = "spapr_vty", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_SPAPR_VIO (sdev, VIOsPAPRVTYDevice),VMSTATE_UINT32 (in, VIOsPAPRVTYDevice),
hw/intc/heathrow_pic.c +2 -4
@@ -159,8 +159,7 @@ static const VMStateDescription vmstate_heathrow_pic_one = { .name = "heathrow_pic_one", .version_id = 0, .minimum_version_id = 0, - .minimum_version_id_old = 0, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT32 (events, HeathrowPIC),VMSTATE_UINT32 (mask, HeathrowPIC),VMSTATE_UINT32 (levels, HeathrowPIC),
@@ -173,8 +172,7 @@ static const VMStateDescription vmstate_heathrow_pic = { .name = "heathrow_pic", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_STRUCT_ARRAY (pics, HeathrowPICS,2 ,1 , vmstate_heathrow_pic_one, HeathrowPIC),VMSTATE_END_OF_LIST ()
hw/intc/xics.c +3 -6
@@ -330,10 +330,9 @@ static const VMStateDescription vmstate_icp_server = { .name = "icp/server", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .pre_save = icp_dispatch_pre_save, .post_load = icp_dispatch_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField []) {/* Sanity check */ VMSTATE_UINT32 (xirr, ICPState),VMSTATE_UINT8 (pending_priority, ICPState),
@@ -566,8 +565,7 @@ static const VMStateDescription vmstate_ics_irq = { .name = "ics/irq", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT32 (server, ICSIRQState),VMSTATE_UINT8 (priority, ICSIRQState),VMSTATE_UINT8 (saved_priority, ICSIRQState),
@@ -580,10 +578,9 @@ static const VMStateDescription vmstate_ics = { .name = "ics", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .pre_save = ics_dispatch_pre_save, .post_load = ics_dispatch_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField []) {/* Sanity check */ VMSTATE_UINT32_EQUAL (nr_irqs, ICSState),
hw/net/spapr_llan.c +1 -2
@@ -509,8 +509,7 @@ static const VMStateDescription vmstate_spapr_llan = { .name = "spapr_llan", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_SPAPR_VIO (sdev, VIOsPAPRVLANDevice),/* LLAN state */ VMSTATE_BOOL (isopen, VIOsPAPRVLANDevice),
hw/pci-host/ppce500.c +3 -6
@@ -278,8 +278,7 @@ static const VMStateDescription vmstate_pci_outbound = { .name = "pci_outbound", .version_id = 0, .minimum_version_id = 0, - .minimum_version_id_old = 0, - .fields = (VMStateField []) { + .fields = (VMStateField []) { VMSTATE_UINT32(potar, struct pci_outbound), VMSTATE_UINT32(potear, struct pci_outbound), VMSTATE_UINT32(powbar, struct pci_outbound),
@@ -292,8 +291,7 @@ static const VMStateDescription vmstate_pci_inbound = { .name = "pci_inbound", .version_id = 0, .minimum_version_id = 0, - .minimum_version_id_old = 0, - .fields = (VMStateField []) { + .fields = (VMStateField []) { VMSTATE_UINT32(pitar, struct pci_inbound), VMSTATE_UINT32(piwbar, struct pci_inbound), VMSTATE_UINT32(piwbear, struct pci_inbound),
@@ -306,8 +304,7 @@ static const VMStateDescription vmstate_ppce500_pci = { .name = "ppce500_pci", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_STRUCT_ARRAY (pob, PPCE500PCIState,PPCE500_PCI_NR_POBS ,1 , vmstate_pci_outbound, struct pci_outbound), VMSTATE_STRUCT_ARRAY(pib, PPCE500PCIState, PPCE500_PCI_NR_PIBS, 1,
hw/ppc/ppc4xx_pci.c +3 -6
@@ -294,8 +294,7 @@ static const VMStateDescription vmstate_pci_master_map = { .name = "pci_master_map", .version_id = 0, .minimum_version_id = 0, - .minimum_version_id_old = 0, - .fields = (VMStateField []) { + .fields = (VMStateField []) { VMSTATE_UINT32(la, struct PCIMasterMap), VMSTATE_UINT32(ma, struct PCIMasterMap), VMSTATE_UINT32(pcila, struct PCIMasterMap),
@@ -308,8 +307,7 @@ static const VMStateDescription vmstate_pci_target_map = { .name = "pci_target_map", .version_id = 0, .minimum_version_id = 0, - .minimum_version_id_old = 0, - .fields = (VMStateField []) { + .fields = (VMStateField []) { VMSTATE_UINT32(ms, struct PCITargetMap), VMSTATE_UINT32(la, struct PCITargetMap),VMSTATE_END_OF_LIST ()
@@ -320,8 +318,7 @@ static const VMStateDescription vmstate_ppc4xx_pci = { .name = "ppc4xx_pci", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_STRUCT_ARRAY (pmm, PPC4xxPCIState, PPC4xx_PCI_NR_PMMS,1 , vmstate_pci_master_map, struct PCIMasterMap),
hw/ppc/spapr.c +1 -2
@@ -819,8 +819,7 @@ static const VMStateDescription vmstate_spapr = { .name = "spapr", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT32 (next_irq, sPAPREnvironment),/* RTC offset */
hw/ppc/spapr_iommu.c +1 -2
@@ -97,9 +97,8 @@ static const VMStateDescription vmstate_spapr_tce_table = { .name = "spapr_iommu", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .pre_load = spapr_tce_table_pre_load, - .fields = (VMStateField []) { + .fields = (VMStateField []) {/* Sanity check */ VMSTATE_UINT32_EQUAL (liobn, sPAPRTCETable),VMSTATE_UINT32_EQUAL (window_size, sPAPRTCETable),
hw/ppc/spapr_pci.c +3 -6
@@ -659,8 +659,7 @@ static const VMStateDescription vmstate_spapr_pci_lsi = { .name = "spapr_pci/lsi", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) { VMSTATE_UINT32_EQUAL(irq, struct spapr_pci_lsi),VMSTATE_END_OF_LIST ()
@@ -671,8 +670,7 @@ static const VMStateDescription vmstate_spapr_pci_msi = { .name = "spapr_pci/lsi", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) { VMSTATE_UINT32(config_addr, struct spapr_pci_msi), VMSTATE_UINT32(irq, struct spapr_pci_msi), VMSTATE_UINT32(nvec, struct spapr_pci_msi),
@@ -685,8 +683,7 @@ static const VMStateDescription vmstate_spapr_pci = { .name = "spapr_pci", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT64_EQUAL (buid, sPAPRPHBState),VMSTATE_UINT32_EQUAL (dma_liobn, sPAPRPHBState),VMSTATE_UINT64_EQUAL (mem_win_addr, sPAPRPHBState),
hw/ppc/spapr_vio.c +1 -2
@@ -547,8 +547,7 @@ const VMStateDescription vmstate_spapr_vio = { .name = "spapr_vio", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {/* Sanity check */ VMSTATE_UINT32_EQUAL (reg, VIOsPAPRDevice),VMSTATE_UINT32_EQUAL (irq, VIOsPAPRDevice),
hw/scsi/spapr_vscsi.c +2 -4
@@ -598,8 +598,7 @@ static const VMStateDescription vmstate_spapr_vscsi_req = { .name = "spapr_vscsi_req", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_BUFFER (crq.raw, vscsi_req),VMSTATE_BUFFER (iu.srp.reserved, vscsi_req),VMSTATE_UINT32 (qtag, vscsi_req),
@@ -1260,8 +1259,7 @@ static const VMStateDescription vmstate_spapr_vscsi = { .name = "spapr_vscsi", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_SPAPR_VIO (vdev, VSCSIState),/* VSCSI state */ /* ???? */
hw/timer/m48t59.c +1 -2
@@ -595,8 +595,7 @@ static const VMStateDescription vmstate_m48t59 = { .name = "m48t59", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT8 (lock, M48t59State),VMSTATE_UINT16 (addr, M48t59State),VMSTATE_VBUFFER_UINT32 (buffer, M48t59State,0 ,NULL ,0 , size),
target-ppc/machine.c +13 -25
@@ -202,8 +202,7 @@ static const VMStateDescription vmstate_fpu = { .name = "cpu/fpu", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_FLOAT64_ARRAY (env.fpr, PowerPCCPU,32 ),VMSTATE_UINTTL (env.fpscr, PowerPCCPU),VMSTATE_END_OF_LIST ()
@@ -221,8 +220,7 @@ static const VMStateDescription vmstate_altivec = { .name = "cpu/altivec", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_AVR_ARRAY (env.avr, PowerPCCPU,32 ),VMSTATE_UINT32 (env.vscr, PowerPCCPU),VMSTATE_END_OF_LIST ()
@@ -240,8 +238,7 @@ static const VMStateDescription vmstate_vsx = { .name = "cpu/vsx", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT64_ARRAY (env.vsr, PowerPCCPU,32 ),VMSTATE_END_OF_LIST () },
@@ -262,8 +259,7 @@ static const VMStateDescription vmstate_sr = { .name = "cpu/sr", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINTTL_ARRAY (env.sr, PowerPCCPU,32 ),VMSTATE_END_OF_LIST () },
@@ -312,8 +308,7 @@ static const VMStateDescription vmstate_slb = { .name = "cpu/slb", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_INT32_EQUAL (env.slb_nr, PowerPCCPU),VMSTATE_SLB_ARRAY (env.slb, PowerPCCPU,MAX_SLB_ENTRIES ),VMSTATE_END_OF_LIST ()
@@ -325,8 +320,7 @@ static const VMStateDescription vmstate_tlb6xx_entry = { .name = "cpu/tlb6xx_entry", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINTTL (pte0, ppc6xx_tlb_t),VMSTATE_UINTTL (pte1, ppc6xx_tlb_t),VMSTATE_UINTTL (EPN , ppc6xx_tlb_t),
@@ -346,8 +340,7 @@ static const VMStateDescription vmstate_tlb6xx = { .name = "cpu/tlb6xx", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_INT32_EQUAL (env.nb_tlb, PowerPCCPU), VMSTATE_STRUCT_VARRAY_POINTER_INT32(env.tlb.tlb6, PowerPCCPU, env.nb_tlb,
@@ -362,8 +355,7 @@ static const VMStateDescription vmstate_tlbemb_entry = { .name = "cpu/tlbemb_entry", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT64 (RPN , ppcemb_tlb_t),VMSTATE_UINTTL (EPN , ppcemb_tlb_t),VMSTATE_UINTTL (PID , ppcemb_tlb_t),
@@ -394,8 +386,7 @@ static const VMStateDescription vmstate_pbr403 = { .name = "cpu/pbr403", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINTTL_ARRAY (env.pb, PowerPCCPU,4 ),VMSTATE_END_OF_LIST () },
@@ -405,8 +396,7 @@ static const VMStateDescription vmstate_tlbemb = { .name = "cpu/tlb6xx", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_INT32_EQUAL (env.nb_tlb, PowerPCCPU), VMSTATE_STRUCT_VARRAY_POINTER_INT32(env.tlb.tlbe, PowerPCCPU, env.nb_tlb,
@@ -429,8 +419,7 @@ static const VMStateDescription vmstate_tlbmas_entry = { .name = "cpu/tlbmas_entry", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT32 (mas8, ppcmas_tlb_t),VMSTATE_UINT32 (mas1, ppcmas_tlb_t),VMSTATE_UINT64 (mas2, ppcmas_tlb_t),
@@ -451,8 +440,7 @@ static const VMStateDescription vmstate_tlbmas = { .name = "cpu/tlbmas", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_INT32_EQUAL (env.nb_tlb, PowerPCCPU), VMSTATE_STRUCT_VARRAY_POINTER_INT32(env.tlb.tlbm, PowerPCCPU, env.nb_tlb,
@@ -470,7 +458,7 @@ const VMStateDescription vmstate_ppc_cpu = { .load_state_old = cpu_load_old, .pre_save = cpu_pre_save, .post_load = cpu_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField []) {/* Verify we haven't changed the pvr */ VMSTATE_UINTTL_EQUAL (env.spr[SPR_PVR ], PowerPCCPU),
Signature · 1 line
1.9.3
PATCH 2/6 savevm: Remove all the unneeded version_minimum_id_old (x86)
In reply to Juan QuintelaAfter previous Peter patch, they are redundant. This way we don't assign them except when needed. Once there, there were lots of case where the ".fields" indentation was wrong:
.fields = (VMStateField []) {
and
.fields = (VMStateField []) {Change all the combinations to:
.fields = (VMStateField[]){The biggest problem (appart from aesthetics) was that checkpatch complained when we copy&pasted the code from one place to another.
--- hw/acpi/ich9.c | 1 - hw/acpi/pcihp.c | 3 +- hw/acpi/piix4.c | 8 ++---- hw/audio/ac97.c | 6 ++-- hw/audio/cs4231.c | 3 +- hw/audio/cs4231a.c | 3 +- hw/audio/es1370.c | 6 ++-- hw/audio/gus.c | 3 +- hw/audio/hda-codec.c | 4 +-- hw/audio/intel-hda.c | 4 +-- hw/audio/sb16.c | 3 +- hw/block/fdc.c | 16 ++++------- hw/char/serial-pci.c | 4 +-- hw/char/serial.c | 2 +- hw/display/cirrus_vga.c | 6 ++-- hw/display/vga-pci.c | 3 +- hw/display/vga.c | 3 +- hw/display/vmware_vga.c | 6 ++-- hw/dma/i8257.c | 6 ++-- hw/i386/acpi-build.c | 3 +- hw/i386/kvm/clock.c | 1 - hw/i386/kvmvapic.c | 3 -- hw/i386/pc.c | 3 +- hw/i386/xen/xen_platform.c | 3 +- hw/ide/ahci.c | 6 ++-- hw/ide/ich.c | 2 +- hw/ide/isa.c | 3 +- hw/ide/pci.c | 12 +++----- hw/input/pckbd.c | 6 ++-- hw/input/ps2.c | 12 +++----- hw/input/vmmouse.c | 3 +- hw/intc/i8259_common.c | 1 - hw/intc/ioapic_common.c | 1 - hw/isa/apm.c | 1 - hw/isa/lpc_ich9.c | 1 - hw/isa/piix4.c | 3 +- hw/isa/vt82c686.c | 6 ++-- hw/net/e1000.c | 6 ++-- hw/net/eepro100.c | 3 +- hw/net/ne2000-isa.c | 3 +- hw/net/ne2000.c | 6 ++-- hw/net/pcnet-pci.c | 3 +- hw/net/pcnet.c | 3 +- hw/net/rtl8139.c | 9 ++---- hw/net/vmxnet3.c | 4 +-- hw/nvram/eeprom93xx.c | 3 +- hw/nvram/fw_cfg.c | 3 +- hw/pci-bridge/ioh3420.c | 1 - hw/pci-bridge/xio3130_downstream.c | 1 - hw/pci-bridge/xio3130_upstream.c | 1 - hw/pci-host/piix.c | 7 ++--- hw/pci-host/q35.c | 3 +- hw/pci/pci.c | 9 ++---- hw/pci/pcie_aer.c | 6 ++-- hw/scsi/lsi53c895a.c | 3 +- hw/scsi/megasas.c | 3 +- hw/scsi/scsi-bus.c | 4 +-- hw/scsi/scsi-disk.c | 1 - hw/scsi/vmw_pvscsi.c | 3 +- hw/timer/hpet.c | 9 ++---- hw/timer/i8254_common.c | 1 - hw/timer/mc146818rtc.c | 3 +- hw/watchdog/wdt_i6300esb.c | 14 +++++----- hw/watchdog/wdt_ib700.c | 3 +- target-i386/machine.c | 57 +++++++++++++------------------------- 65 files changed, 113 insertions(+), 219 deletions(-)
hw/acpi/ich9.c +0 -1
@@ -143,7 +143,6 @@ const VMStateDescription vmstate_ich9_pm = { .name = "ich9_pm", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .post_load = ich9_pm_post_load, .fields = (VMStateField []) {VMSTATE_UINT16 (acpi_regs.pm1.evt.sts, ICH9LPCPMRegs),
hw/acpi/pcihp.c +1 -2
@@ -324,8 +324,7 @@ const VMStateDescription vmstate_acpi_pcihp_pci_status = { .name = "acpi_pcihp_pci_status", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT32 (up, AcpiPciHpPciStatus),VMSTATE_UINT32 (down, AcpiPciHpPciStatus),VMSTATE_END_OF_LIST ()
hw/acpi/piix4.c +3 -5
@@ -177,8 +177,7 @@ static const VMStateDescription vmstate_gpe = { .name = "gpe", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_GPE_ARRAY (sts,ACPIGPE ),VMSTATE_GPE_ARRAY (en,ACPIGPE ),VMSTATE_END_OF_LIST ()
@@ -189,8 +188,7 @@ static const VMStateDescription vmstate_pci_status = { .name = "pci_status", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) { VMSTATE_UINT32(up, struct AcpiPciHpPciStatus), VMSTATE_UINT32(down, struct AcpiPciHpPciStatus),VMSTATE_END_OF_LIST ()
@@ -259,7 +257,7 @@ static const VMStateDescription vmstate_acpi = { .minimum_version_id_old = 1, .load_state_old = acpi_load_old, .post_load = vmstate_acpi_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_PCI_DEVICE (parent_obj, PIIX4PMState),VMSTATE_UINT16 (ar.pm1.evt.sts, PIIX4PMState),VMSTATE_UINT16 (ar.pm1.evt.en, PIIX4PMState),
hw/audio/ac97.c +2 -4
@@ -1163,8 +1163,7 @@ static const VMStateDescription vmstate_ac97_bm_regs = { .name = "ac97_bm_regs", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT32 (bdbar, AC97BusMasterRegs),VMSTATE_UINT8 (civ, AC97BusMasterRegs),VMSTATE_UINT8 (lvi, AC97BusMasterRegs),
@@ -1211,9 +1210,8 @@ static const VMStateDescription vmstate_ac97 = { .name = "ac97", .version_id = 3, .minimum_version_id = 2, - .minimum_version_id_old = 2, .post_load = ac97_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_PCI_DEVICE (dev, AC97LinkState),VMSTATE_UINT32 (glob_cnt, AC97LinkState),VMSTATE_UINT32 (glob_sta, AC97LinkState),
hw/audio/cs4231.c +1 -2
@@ -137,8 +137,7 @@ static const VMStateDescription vmstate_cs4231 = { .name ="cs4231", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT32_ARRAY (regs, CSState,CS_REGS ),VMSTATE_UINT8_ARRAY (dregs, CSState,CS_DREGS ),VMSTATE_END_OF_LIST ()
hw/audio/cs4231a.c +1 -2
@@ -621,10 +621,9 @@ static const VMStateDescription vmstate_cs4231a = { .name = "cs4231a", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .pre_load = cs4231a_pre_load, .post_load = cs4231a_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT32_ARRAY (regs, CSState,CS_REGS ),VMSTATE_BUFFER (dregs, CSState),VMSTATE_INT32 (dma_running, CSState),
hw/audio/es1370.c +2 -4
@@ -953,8 +953,7 @@ static const VMStateDescription vmstate_es1370_channel = { .name = "es1370_channel", .version_id = 2, .minimum_version_id = 2, - .minimum_version_id_old = 2, - .fields = (VMStateField []) { + .fields = (VMStateField []) { VMSTATE_UINT32 (shift, struct chan), VMSTATE_UINT32 (leftover, struct chan), VMSTATE_UINT32 (scount, struct chan),
@@ -997,9 +996,8 @@ static const VMStateDescription vmstate_es1370 = { .name = "es1370", .version_id = 2, .minimum_version_id = 2, - .minimum_version_id_old = 2, .post_load = es1370_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_PCI_DEVICE (dev, ES1370State),VMSTATE_STRUCT_ARRAY (chan, ES1370State,NB_CHANNELS ,2 , vmstate_es1370_channel, struct chan),
hw/audio/gus.c +1 -2
@@ -222,8 +222,7 @@ static const VMStateDescription vmstate_gus = { .name = "gus", .version_id = 2, .minimum_version_id = 2, - .minimum_version_id_old = 2, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_INT32 (pos, GUSState),VMSTATE_INT32 (left, GUSState),VMSTATE_INT32 (shift, GUSState),
hw/audio/hda-codec.c +2 -2
@@ -583,7 +583,7 @@ static void hda_audio_reset(DeviceState *dev)static const VMStateDescription vmstate_hda_audio_stream = { .name ="hda-audio-stream" , .version_id =1 , - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT32 (stream, HDAAudioStream),VMSTATE_UINT32 (channel, HDAAudioStream),VMSTATE_UINT32 (format, HDAAudioStream),
@@ -601,7 +601,7 @@ static const VMStateDescription vmstate_hda_audio = { .name = "hda-audio", .version_id = 2, .post_load = hda_audio_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_STRUCT_ARRAY (st, HDAAudioState,4 ,0 , vmstate_hda_audio_stream, HDAAudioStream),
hw/audio/intel-hda.c +2 -2
@@ -1176,7 +1176,7 @@ static int intel_hda_post_load(void *opaque, int version)static const VMStateDescription vmstate_intel_hda_stream = { .name ="intel-hda-stream" , .version_id =1 , - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT32 (ctl, IntelHDAStream),VMSTATE_UINT32 (lpib, IntelHDAStream),VMSTATE_UINT32 (cbl, IntelHDAStream),
@@ -1192,7 +1192,7 @@ static const VMStateDescription vmstate_intel_hda = { .name = "intel-hda", .version_id = 1, .post_load = intel_hda_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_PCI_DEVICE (pci, IntelHDAState),/* registers */
hw/audio/sb16.c +1 -2
@@ -1289,9 +1289,8 @@ static const VMStateDescription vmstate_sb16 = { .name = "sb16", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .post_load = sb16_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT32 (irq, SB16State),VMSTATE_UINT32 (dma, SB16State),VMSTATE_UINT32 (hdma, SB16State),
hw/block/fdc.c +6 -10
@@ -672,8 +672,7 @@ static const VMStateDescription vmstate_fdrive_media_changed = { .name = "fdrive/media_changed", .version_id = 1, .minimum_version_id =1 , - .minimum_version_id_old =1 , - .fields = (VMStateField[]) { + .fields = (VMStateField[]) {VMSTATE_UINT8 (media_changed, FDrive),VMSTATE_END_OF_LIST () }
@@ -690,8 +689,7 @@ static const VMStateDescription vmstate_fdrive_media_rate = { .name = "fdrive/media_rate", .version_id = 1, .minimum_version_id =1 , - .minimum_version_id_old =1 , - .fields = (VMStateField[]) { + .fields = (VMStateField[]) {VMSTATE_UINT8 (media_rate, FDrive),VMSTATE_END_OF_LIST () }
@@ -701,8 +699,7 @@ static const VMStateDescription vmstate_fdrive = { .name = "fdrive", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT8 (head, FDrive),VMSTATE_UINT8 (track, FDrive),VMSTATE_UINT8 (sect, FDrive),
@@ -741,10 +738,9 @@ static const VMStateDescription vmstate_fdc = { .name = "fdc", .version_id = 2, .minimum_version_id = 2, - .minimum_version_id_old = 2, .pre_save = fdc_pre_save, .post_load = fdc_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField []) {/* Controller State */ VMSTATE_UINT8 (sra, FDCtrl),VMSTATE_UINT8 (srb, FDCtrl),
@@ -2209,7 +2205,7 @@ static const VMStateDescription vmstate_isa_fdc ={ .name = "fdc", .version_id = 2, .minimum_version_id =2 , - .fields = (VMStateField []) { + .fields = (VMStateField[]) {VMSTATE_STRUCT (state, FDCtrlISABus,0 , vmstate_fdc, FDCtrl),VMSTATE_END_OF_LIST () }
@@ -2251,7 +2247,7 @@ static const VMStateDescription vmstate_sysbus_fdc ={ .name = "fdc", .version_id = 2, .minimum_version_id =2 , - .fields = (VMStateField []) { + .fields = (VMStateField[]) {VMSTATE_STRUCT (state, FDCtrlSysBus,0 , vmstate_fdc, FDCtrl),VMSTATE_END_OF_LIST () }
hw/char/serial-pci.c +2 -2
@@ -159,7 +159,7 @@ static const VMStateDescription vmstate_pci_serial = { .name = "pci-serial", .version_id = 1, .minimum_version_id = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_PCI_DEVICE (dev, PCISerialState),VMSTATE_STRUCT (state, PCISerialState,0 , vmstate_serial, SerialState),VMSTATE_END_OF_LIST ()
@@ -170,7 +170,7 @@ static const VMStateDescription vmstate_pci_multi_serial = { .name = "pci-serial-multi", .version_id = 1, .minimum_version_id = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_PCI_DEVICE (dev, PCIMultiSerialState),VMSTATE_STRUCT_ARRAY (state, PCIMultiSerialState,PCI_SERIAL_MAX_PORTS ,0 , vmstate_serial, SerialState),
hw/char/serial.c +1 -1
@@ -602,7 +602,7 @@ const VMStateDescription vmstate_serial = { .minimum_version_id = 2, .pre_save = serial_pre_save, .post_load = serial_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT16_V (divider, SerialState,2 ),VMSTATE_UINT8 (rbr, SerialState),VMSTATE_UINT8 (ier, SerialState),
hw/display/cirrus_vga.c +2 -4
@@ -2702,9 +2702,8 @@ static const VMStateDescription vmstate_cirrus_vga = { .name = "cirrus_vga", .version_id = 2, .minimum_version_id = 1, - .minimum_version_id_old = 1, .post_load = cirrus_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT32 (vga.latch, CirrusVGAState),VMSTATE_UINT8 (vga.sr_index, CirrusVGAState),VMSTATE_BUFFER (vga.sr, CirrusVGAState),
@@ -2742,8 +2741,7 @@ static const VMStateDescription vmstate_pci_cirrus_vga = { .name = "cirrus_vga", .version_id = 2, .minimum_version_id = 2, - .minimum_version_id_old = 2, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_PCI_DEVICE (dev, PCICirrusVGAState),VMSTATE_STRUCT (cirrus_vga, PCICirrusVGAState,0 , vmstate_cirrus_vga, CirrusVGAState),
hw/display/vga-pci.c +1 -2
@@ -54,8 +54,7 @@ static const VMStateDescription vmstate_vga_pci = { .name = "vga", .version_id = 2, .minimum_version_id = 2, - .minimum_version_id_old = 2, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_PCI_DEVICE (dev, PCIVGAState),VMSTATE_STRUCT (vga, PCIVGAState,0 , vmstate_vga_common, VGACommonState),VMSTATE_END_OF_LIST ()
hw/display/vga.c +1 -2
@@ -2214,9 +2214,8 @@ const VMStateDescription vmstate_vga_common = { .name = "vga", .version_id = 2, .minimum_version_id = 2, - .minimum_version_id_old = 2, .post_load = vga_common_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT32 (latch, VGACommonState),VMSTATE_UINT8 (sr_index, VGACommonState),VMSTATE_PARTIAL_BUFFER (sr, VGACommonState,8 ),
hw/display/vmware_vga.c +2 -4
@@ -1152,9 +1152,8 @@ static const VMStateDescription vmstate_vmware_vga_internal = { .name = "vmware_vga_internal", .version_id = 0, .minimum_version_id = 0, - .minimum_version_id_old = 0, .post_load = vmsvga_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField []) { VMSTATE_INT32_EQUAL(new_depth, struct vmsvga_state_s), VMSTATE_INT32(enable, struct vmsvga_state_s), VMSTATE_INT32(config, struct vmsvga_state_s),
@@ -1179,8 +1178,7 @@ static const VMStateDescription vmstate_vmware_vga = { .name = "vmware_vga", .version_id = 0, .minimum_version_id = 0, - .minimum_version_id_old = 0, - .fields = (VMStateField []) { + .fields = (VMStateField []) { VMSTATE_PCI_DEVICE(parent_obj, struct pci_vmsvga_state_s), VMSTATE_STRUCT(chip, struct pci_vmsvga_state_s, 0, vmstate_vmware_vga_internal, struct vmsvga_state_s),
hw/dma/i8257.c +2 -4
@@ -551,8 +551,7 @@ static const VMStateDescription vmstate_dma_regs = { .name = "dma_regs", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) { VMSTATE_INT32_ARRAY(now, struct dma_regs, 2), VMSTATE_UINT16_ARRAY(base, struct dma_regs, 2), VMSTATE_UINT8(mode, struct dma_regs),
@@ -575,9 +574,8 @@ static const VMStateDescription vmstate_dma = { .name = "dma", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .post_load = dma_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField []) { VMSTATE_UINT8(command, struct dma_cont), VMSTATE_UINT8(mask, struct dma_cont), VMSTATE_UINT8(flip_flop, struct dma_cont),
hw/i386/acpi-build.c +1 -2
@@ -1504,8 +1504,7 @@ static const VMStateDescription vmstate_acpi_build = { .name = "acpi_build", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT8 (patched, AcpiBuildState),VMSTATE_END_OF_LIST () },
hw/i386/kvm/clock.c +0 -1
@@ -154,7 +154,6 @@ static const VMStateDescription kvmclock_vmsd = { .name = "kvmclock", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .fields = (VMStateField []) {VMSTATE_UINT64 (clock, KVMClockState),VMSTATE_END_OF_LIST ()
hw/i386/kvmvapic.c +0 -3
@@ -770,7 +770,6 @@ static const VMStateDescription vmstate_handlers = { .name = "kvmvapic-handlers", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .fields = (VMStateField []) {VMSTATE_UINT32 (set_tpr, VAPICHandlers),VMSTATE_UINT32 (set_tpr_eax, VAPICHandlers),
@@ -784,7 +783,6 @@ static const VMStateDescription vmstate_guest_rom = { .name = "kvmvapic-guest-rom", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .fields = (VMStateField []) {VMSTATE_UNUSED (8 ),/* signature */ VMSTATE_UINT32 (vaddr, GuestROMState),
@@ -804,7 +802,6 @@ static const VMStateDescription vmstate_vapic = { .name = "kvm-tpr-opt", /* compatible with qemu-kvm VAPIC */ .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .post_load = vapic_post_load, .fields = (VMStateField []) { VMSTATE_STRUCT(rom_state, VAPICROMState, 0, vmstate_guest_rom,
hw/i386/pc.c +1 -2
@@ -503,8 +503,7 @@ static const VMStateDescription vmstate_port92_isa = { .name = "port92", .version_id = 1, .minimum_version_id =1 , - .minimum_version_id_old =1 , - .fields = (VMStateField []) { + .fields = (VMStateField[]) {VMSTATE_UINT8 (outport, Port92State),VMSTATE_END_OF_LIST () }
hw/i386/xen/xen_platform.c +1 -2
@@ -375,9 +375,8 @@ static const VMStateDescription vmstate_xen_platform = { .name = "platform", .version_id = 4, .minimum_version_id = 4, - .minimum_version_id_old = 4, .post_load = xen_platform_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_PCI_DEVICE (parent_obj, PCIXenPlatformState),VMSTATE_UINT8 (flags, PCIXenPlatformState),VMSTATE_END_OF_LIST ()
hw/ide/ahci.c +3 -3
@@ -1225,7 +1225,7 @@ void ahci_reset(AHCIState *s)static const VMStateDescription vmstate_ahci_device = { .name ="ahci port" , .version_id =1 , - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_IDE_BUS (port, AHCIDevice),VMSTATE_UINT32 (port_state, AHCIDevice),VMSTATE_UINT32 (finished, AHCIDevice),
@@ -1284,7 +1284,7 @@ const VMStateDescription vmstate_ahci = { .name = "ahci", .version_id = 1, .post_load = ahci_state_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_STRUCT_VARRAY_POINTER_INT32 (dev, AHCIState, ports, vmstate_ahci_device, AHCIDevice),VMSTATE_UINT32 (control_regs.cap, AHCIState),
@@ -1313,7 +1313,7 @@ typedef struct SysbusAHCIState {static const VMStateDescription vmstate_sysbus_ahci = { .name ="sysbus-ahci" , .unmigratable =1 ,/* Still buggy under I/O load */ - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_AHCI (ahci, SysbusAHCIState),VMSTATE_END_OF_LIST () },
hw/ide/ich.c +1 -1
@@ -83,7 +83,7 @@ static const VMStateDescription vmstate_ich9_ahci = { .name = "ich9_ahci", .unmigratable = 1, /* Still buggy under I/O load */ .version_id = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_PCI_DEVICE (parent_obj, AHCIPCIState),VMSTATE_AHCI (ahci, AHCIPCIState),VMSTATE_END_OF_LIST ()
hw/ide/isa.c +1 -2
@@ -57,8 +57,7 @@ static const VMStateDescription vmstate_ide_isa = { .name = "isa-ide", .version_id = 3, .minimum_version_id = 0, - .minimum_version_id_old = 0, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_IDE_BUS (bus, ISAIDEState),VMSTATE_IDE_DRIVES (bus.ifs, ISAIDEState),VMSTATE_END_OF_LIST ()
hw/ide/pci.c +4 -8
@@ -411,8 +411,7 @@ static const VMStateDescription vmstate_bmdma_current = { .name = "ide bmdma_current", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT32 (cur_addr, BMDMAState),VMSTATE_UINT32 (cur_prd_last, BMDMAState),VMSTATE_UINT32 (cur_prd_addr, BMDMAState),
@@ -425,8 +424,7 @@ static const VMStateDescription vmstate_bmdma_status = { .name ="ide bmdma/status", .version_id = 1, .minimum_version_id =1 , - .minimum_version_id_old =1 , - .fields = (VMStateField []) { + .fields = (VMStateField[]) {VMSTATE_UINT8 (status, BMDMAState),VMSTATE_END_OF_LIST () }
@@ -436,9 +434,8 @@ static const VMStateDescription vmstate_bmdma = { .name = "ide bmdma", .version_id = 3, .minimum_version_id = 0, - .minimum_version_id_old = 0, .pre_save = ide_bmdma_pre_save, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT8 (cmd, BMDMAState),VMSTATE_UINT8 (migration_compat_status, BMDMAState),VMSTATE_UINT32 (addr, BMDMAState),
@@ -479,9 +476,8 @@ const VMStateDescription vmstate_ide_pci = { .name = "ide", .version_id = 3, .minimum_version_id = 0, - .minimum_version_id_old = 0, .post_load = ide_pci_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_PCI_DEVICE (parent_obj, PCIIDEState),VMSTATE_STRUCT_ARRAY (bmdma, PCIIDEState,2 ,0 , vmstate_bmdma, BMDMAState),
hw/input/pckbd.c +2 -4
@@ -373,8 +373,7 @@ static const VMStateDescription vmstate_kbd = { .name = "pckbd", .version_id = 3, .minimum_version_id = 3, - .minimum_version_id_old = 3, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT8 (write_cmd, KBDState),VMSTATE_UINT8 (status, KBDState),VMSTATE_UINT8 (mode, KBDState),
@@ -462,8 +461,7 @@ static const VMStateDescription vmstate_kbd_isa = { .name = "pckbd", .version_id = 3, .minimum_version_id =3 , - .minimum_version_id_old =3 , - .fields = (VMStateField []) { + .fields = (VMStateField[]) {VMSTATE_STRUCT (kbd, ISAKBDState,0 , vmstate_kbd, KBDState),VMSTATE_END_OF_LIST () }
hw/input/ps2.c +4 -8
@@ -633,8 +633,7 @@ static const VMStateDescription vmstate_ps2_common = { .name = "PS2 Common State", .version_id = 3, .minimum_version_id = 2, - .minimum_version_id_old = 2, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_INT32 (write_cmd, PS2State),VMSTATE_INT32 (queue.rptr, PS2State),VMSTATE_INT32 (queue.wptr, PS2State),
@@ -663,9 +662,8 @@ static const VMStateDescription vmstate_ps2_keyboard_ledstate = { .name = "ps2kbd/ledstate", .version_id = 3, .minimum_version_id = 2, - .minimum_version_id_old = 2, .post_load = ps2_kbd_ledstate_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField[]) {VMSTATE_INT32 (ledstate, PS2KbdState),VMSTATE_END_OF_LIST () }
@@ -696,10 +694,9 @@ static const VMStateDescription vmstate_ps2_keyboard = { .name = "ps2kbd", .version_id = 3, .minimum_version_id = 2, - .minimum_version_id_old = 2, .post_load = ps2_kbd_post_load, .pre_save = ps2_kbd_pre_save, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_STRUCT (common, PS2KbdState,0 , vmstate_ps2_common, PS2State),VMSTATE_INT32 (scan_enabled, PS2KbdState),VMSTATE_INT32 (translate, PS2KbdState),
@@ -738,10 +735,9 @@ static const VMStateDescription vmstate_ps2_mouse = { .name = "ps2mouse", .version_id = 2, .minimum_version_id = 2, - .minimum_version_id_old = 2, .post_load = ps2_mouse_post_load, .pre_save = ps2_mouse_pre_save, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_STRUCT (common, PS2MouseState,0 , vmstate_ps2_common, PS2State),VMSTATE_UINT8 (mouse_status, PS2MouseState),VMSTATE_UINT8 (mouse_resolution, PS2MouseState),
hw/input/vmmouse.c +1 -2
@@ -240,9 +240,8 @@ static const VMStateDescription vmstate_vmmouse = { .name = "vmmouse", .version_id = 0, .minimum_version_id = 0, - .minimum_version_id_old = 0, .post_load = vmmouse_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_INT32_EQUAL (queue_size, VMMouseState),VMSTATE_UINT32_ARRAY (queue, VMMouseState,VMMOUSE_QUEUE_SIZE ),VMSTATE_UINT16 (nb_queue, VMMouseState),
hw/intc/i8259_common.c +0 -1
@@ -98,7 +98,6 @@ static const VMStateDescription vmstate_pic_common = { .name = "i8259", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .pre_save = pic_dispatch_pre_save, .post_load = pic_dispatch_post_load, .fields = (VMStateField []) {
hw/intc/ioapic_common.c +0 -1
@@ -86,7 +86,6 @@ static const VMStateDescription vmstate_ioapic_common = { .name = "ioapic", .version_id = 3, .minimum_version_id = 1, - .minimum_version_id_old = 1, .pre_save = ioapic_dispatch_pre_save, .post_load = ioapic_dispatch_post_load, .fields = (VMStateField []) {
hw/isa/apm.c +0 -1
@@ -72,7 +72,6 @@ const VMStateDescription vmstate_apm = { .name = "APM State", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .fields = (VMStateField []) {VMSTATE_UINT8 (apmc, APMState),VMSTATE_UINT8 (apms, APMState),
hw/isa/lpc_ich9.c +0 -1
@@ -616,7 +616,6 @@ static const VMStateDescription vmstate_ich9_lpc = { .name = "ICH9LPC", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .post_load = ich9_lpc_post_load, .fields = (VMStateField []) {VMSTATE_PCI_DEVICE (d, ICH9LPCState),
hw/isa/piix4.c +1 -2
@@ -76,8 +76,7 @@ static const VMStateDescription vmstate_piix4 = { .name = "PIIX4", .version_id = 2, .minimum_version_id =2 , - .minimum_version_id_old =2 , - .fields = (VMStateField[]) { + .fields = (VMStateField[]) {VMSTATE_PCI_DEVICE (dev, PIIX4State),VMSTATE_END_OF_LIST () }
hw/isa/vt82c686.c +2 -4
@@ -230,9 +230,8 @@ static const VMStateDescription vmstate_acpi = { .name = "vt82c686b_pm", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .post_load = vmstate_acpi_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_PCI_DEVICE (dev, VT686PMState),VMSTATE_UINT16 (ar.pm1.evt.sts, VT686PMState),VMSTATE_UINT16 (ar.pm1.evt.en, VT686PMState),
@@ -418,8 +417,7 @@ static const VMStateDescription vmstate_via = { .name = "vt82c686b", .version_id = 1, .minimum_version_id =1 , - .minimum_version_id_old =1 , - .fields = (VMStateField []) { + .fields = (VMStateField[]) {VMSTATE_PCI_DEVICE (dev, VT82C686BState),VMSTATE_END_OF_LIST () }
hw/net/e1000.c +2 -4
@@ -1338,8 +1338,7 @@ static const VMStateDescription vmstate_e1000_mit_state = { .name = "e1000/mit_state", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT32 (mac_reg[RDTR ], E1000State),VMSTATE_UINT32 (mac_reg[RADV ], E1000State),VMSTATE_UINT32 (mac_reg[TADV ], E1000State),
@@ -1353,10 +1352,9 @@ static const VMStateDescription vmstate_e1000 = { .name = "e1000", .version_id = 2, .minimum_version_id = 1, - .minimum_version_id_old = 1, .pre_save = e1000_pre_save, .post_load = e1000_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_PCI_DEVICE (parent_obj, E1000State),VMSTATE_UNUSED_TEST (is_version_1,4 ),/* was instance id */ VMSTATE_UNUSED (4 ),/* Was mmio_base. */
hw/net/eepro100.c +1 -2
@@ -1784,8 +1784,7 @@ static ssize_t nic_receive(NetClientState *nc, const uint8_t * buf, size_t size)static const VMStateDescription vmstate_eepro100 = { .version_id =3 , .minimum_version_id =2 , - .minimum_version_id_old =2 , - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_PCI_DEVICE (dev, EEPRO100State),VMSTATE_UNUSED (32 ),VMSTATE_BUFFER (mult, EEPRO100State),
hw/net/ne2000-isa.c +1 -2
@@ -59,8 +59,7 @@ static const VMStateDescription vmstate_isa_ne2000 = { .name = "ne2000", .version_id = 2, .minimum_version_id =0 , - .minimum_version_id_old =0 , - .fields = (VMStateField []) { + .fields = (VMStateField[]) {VMSTATE_STRUCT (ne2000, ISANE2000State,0 , vmstate_ne2000, NE2000State),VMSTATE_END_OF_LIST () }
hw/net/ne2000.c +2 -4
@@ -615,9 +615,8 @@ const VMStateDescription vmstate_ne2000 = { .name = "ne2000", .version_id = 2, .minimum_version_id = 0, - .minimum_version_id_old = 0, .post_load = ne2000_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT8_V (rxcr, NE2000State,2 ),VMSTATE_UINT8 (cmd, NE2000State),VMSTATE_UINT32 (start, NE2000State),
@@ -645,8 +644,7 @@ static const VMStateDescription vmstate_pci_ne2000 = { .name = "ne2000", .version_id = 3, .minimum_version_id = 3, - .minimum_version_id_old = 3, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_PCI_DEVICE (dev, PCINE2000State),VMSTATE_STRUCT (ne2000, PCINE2000State,0 , vmstate_ne2000, NE2000State),VMSTATE_END_OF_LIST ()
hw/net/pcnet-pci.c +1 -2
@@ -241,8 +241,7 @@ static const VMStateDescription vmstate_pci_pcnet = { .name = "pcnet", .version_id = 3, .minimum_version_id = 2, - .minimum_version_id_old = 2, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_PCI_DEVICE (parent_obj, PCIPCNetState),VMSTATE_STRUCT (state, PCIPCNetState,0 , vmstate_pcnet, PCNetState),VMSTATE_END_OF_LIST ()
hw/net/pcnet.c +1 -2
@@ -1700,8 +1700,7 @@ const VMStateDescription vmstate_pcnet = { .name = "pcnet", .version_id = 3, .minimum_version_id = 2, - .minimum_version_id_old = 2, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_INT32 (rap, PCNetState),VMSTATE_INT32 (isr, PCNetState),VMSTATE_INT32 (lnkst, PCNetState),
hw/net/rtl8139.c +3 -6
@@ -1358,8 +1358,7 @@ static const VMStateDescription vmstate_tally_counters = { .name = "tally_counters", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT64 (TxOk, RTL8139TallyCounters),VMSTATE_UINT64 (RxOk, RTL8139TallyCounters),VMSTATE_UINT64 (TxERR, RTL8139TallyCounters),
@@ -3271,8 +3270,7 @@ static const VMStateDescription vmstate_rtl8139_hotplug_ready ={ .name = "rtl8139/hotplug_ready", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_END_OF_LIST () } };
@@ -3293,10 +3291,9 @@ static const VMStateDescription vmstate_rtl8139 = { .name = "rtl8139", .version_id = 4, .minimum_version_id = 3, - .minimum_version_id_old = 3, .post_load = rtl8139_post_load, .pre_save = rtl8139_pre_save, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_PCI_DEVICE (parent_obj, RTL8139State),VMSTATE_PARTIAL_BUFFER (phys, RTL8139State,6 ),VMSTATE_BUFFER (mult, RTL8139State),
hw/net/vmxnet3.c +1 -3
@@ -2223,7 +2223,6 @@ static const VMStateDescription vmxstate_vmxnet3_mcast_list = { .name = "vmxnet3/mcast_list", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .pre_load = vmxnet3_mcast_list_pre_load, .fields = (VMStateField []) { VMSTATE_VBUFFER_UINT32(mcast_list, VMXNET3State, 0, NULL, 0,
@@ -2433,10 +2432,9 @@ static const VMStateDescription vmstate_vmxnet3 = { .name = "vmxnet3", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .pre_save = vmxnet3_pre_save, .post_load = vmxnet3_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_PCI_DEVICE (parent_obj, VMXNET3State),VMSTATE_BOOL (rx_packets_compound, VMXNET3State),VMSTATE_BOOL (rx_vlan_stripping, VMXNET3State),
hw/nvram/eeprom93xx.c +1 -2
@@ -125,8 +125,7 @@ static const VMStateDescription vmstate_eeprom = { .name = "eeprom", .version_id = EEPROM_VERSION, .minimum_version_id = OLD_EEPROM_VERSION, - .minimum_version_id_old = OLD_EEPROM_VERSION, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT8 (tick, eeprom_t),VMSTATE_UINT8 (address, eeprom_t),VMSTATE_UINT8 (command, eeprom_t),
hw/nvram/fw_cfg.c +1 -2
@@ -377,8 +377,7 @@ static const VMStateDescription vmstate_fw_cfg = { .name = "fw_cfg", .version_id = 2, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT16 (cur_entry, FWCfgState),VMSTATE_UINT16_HACK (cur_offset, FWCfgState, is_version_1),VMSTATE_UINT32_V (cur_offset, FWCfgState,2 ),
hw/pci-bridge/ioh3420.c +0 -1
@@ -184,7 +184,6 @@ static const VMStateDescription vmstate_ioh3420 = { .name = "ioh-3240-express-root-port", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .post_load = pcie_cap_slot_post_load, .fields = (VMStateField []) {VMSTATE_PCIE_DEVICE (parent_obj.parent_obj.parent_obj, PCIESlot),
hw/pci-bridge/xio3130_downstream.c +0 -1
@@ -151,7 +151,6 @@ static const VMStateDescription vmstate_xio3130_downstream = { .name = "xio3130-express-downstream-port", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .post_load = pcie_cap_slot_post_load, .fields = (VMStateField []) {VMSTATE_PCIE_DEVICE (parent_obj.parent_obj.parent_obj, PCIESlot),
hw/pci-bridge/xio3130_upstream.c +0 -1
@@ -131,7 +131,6 @@ static const VMStateDescription vmstate_xio3130_upstream = { .name = "xio3130-express-upstream-port", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .fields = (VMStateField []) {VMSTATE_PCIE_DEVICE (parent_obj.parent_obj, PCIEPort), VMSTATE_STRUCT(parent_obj.parent_obj.exp.aer_log, PCIEPort, 0,
hw/pci-host/piix.c +3 -4
@@ -203,7 +203,7 @@ static const VMStateDescription vmstate_i440fx = { .minimum_version_id_old = 1, .load_state_old = i440fx_load_old, .post_load = i440fx_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_PCI_DEVICE (parent_obj, PCII440FXState),VMSTATE_UINT8 (smm_enabled, PCII440FXState),VMSTATE_END_OF_LIST ()
@@ -553,7 +553,7 @@ static const VMStateDescription vmstate_piix3_rcr = { .name = "PIIX3/rcr", .version_id = 1, .minimum_version_id =1 , - .fields = (VMStateField []) { + .fields = (VMStateField[]) {VMSTATE_UINT8 (rcr, PIIX3State),VMSTATE_END_OF_LIST () }
@@ -563,10 +563,9 @@ static const VMStateDescription vmstate_piix3 = { .name = "PIIX3", .version_id = 3, .minimum_version_id = 2, - .minimum_version_id_old = 2, .post_load = piix3_post_load, .pre_save = piix3_pre_save, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_PCI_DEVICE (dev, PIIX3State),VMSTATE_INT32_ARRAY_V (pci_irq_levels_vmstate, PIIX3State,PIIX_NUM_PIRQS ,3 ),
hw/pci-host/q35.c +1 -2
@@ -326,9 +326,8 @@ static const VMStateDescription vmstate_mch = { .name = "mch", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .post_load = mch_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_PCI_DEVICE (parent_obj, MCHPCIState),VMSTATE_UINT8 (smm_enabled, MCHPCIState),VMSTATE_END_OF_LIST ()
hw/pci/pci.c +3 -6
@@ -64,8 +64,7 @@ static const VMStateDescription vmstate_pcibus = { .name = "PCIBUS", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_INT32_EQUAL (nirq, PCIBus), VMSTATE_VARRAY_INT32(irq_count, PCIBus, nirq, 0, vmstate_info_int32,
@@ -473,8 +472,7 @@ const VMStateDescription vmstate_pci_device = { .name = "PCIDevice", .version_id = 2, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_INT32_POSITIVE_LE (version_id, PCIDevice), VMSTATE_BUFFER_UNSAFE_INFO(config, PCIDevice, 0, vmstate_info_pci_config,
@@ -490,8 +488,7 @@ const VMStateDescription vmstate_pcie_device = { .name = "PCIEDevice", .version_id = 2, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_INT32_POSITIVE_LE (version_id, PCIDevice), VMSTATE_BUFFER_UNSAFE_INFO(config, PCIDevice, 0, vmstate_info_pci_config,
hw/pci/pcie_aer.c +2 -4
@@ -784,8 +784,7 @@ static const VMStateDescription vmstate_pcie_aer_err = { .name = "PCIE_AER_ERROR", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT32 (status, PCIEAERErr),VMSTATE_UINT16 (source_id, PCIEAERErr),VMSTATE_UINT16 (flags, PCIEAERErr),
@@ -806,8 +805,7 @@ const VMStateDescription vmstate_pcie_aer_log = { .name = "PCIE_AER_ERROR_LOG", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT16 (log_num, PCIEAERLog),VMSTATE_UINT16_EQUAL (log_max, PCIEAERLog),VMSTATE_VALIDATE ("log_num <= log_max" , pcie_aer_state_log_num_valid),
hw/scsi/lsi53c895a.c +1 -2
@@ -1994,9 +1994,8 @@ static const VMStateDescription vmstate_lsi_scsi = { .name = "lsiscsi", .version_id = 0, .minimum_version_id = 0, - .minimum_version_id_old = 0, .pre_save = lsi_pre_save, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_PCI_DEVICE (parent_obj, LSIState),VMSTATE_INT32 (carry, LSIState),
hw/scsi/megasas.c +1 -2
@@ -2101,8 +2101,7 @@ static const VMStateDescription vmstate_megasas = { .name = "megasas", .version_id = 0, .minimum_version_id = 0, - .minimum_version_id_old = 0, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_PCI_DEVICE (parent_obj, MegasasState),VMSTATE_MSIX (parent_obj, MegasasState),
hw/scsi/scsi-bus.c +1 -3
@@ -1917,8 +1917,7 @@ static const VMStateDescription vmstate_scsi_sense_state = { .name = "SCSIDevice/sense", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT8_SUB_ARRAY (sense, SCSIDevice,SCSI_SENSE_BUF_SIZE_OLD ,SCSI_SENSE_BUF_SIZE -SCSI_SENSE_BUF_SIZE_OLD ),
@@ -1930,7 +1929,6 @@ const VMStateDescription vmstate_scsi_device = { .name = "SCSIDevice", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .fields = (VMStateField []) {VMSTATE_UINT8 (unit_attention.key, SCSIDevice),VMSTATE_UINT8 (unit_attention.asc, SCSIDevice),
hw/scsi/scsi-disk.c +0 -1
@@ -2577,7 +2577,6 @@ static const VMStateDescription vmstate_scsi_disk_state = { .name = "scsi-disk", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .fields = (VMStateField []) {VMSTATE_SCSI_DEVICE (qdev, SCSIDiskState),VMSTATE_BOOL (media_changed, SCSIDiskState),
hw/scsi/vmw_pvscsi.c +1 -2
@@ -1143,10 +1143,9 @@ static const VMStateDescription vmstate_pvscsi = { .name = "pvscsi", .version_id = 0, .minimum_version_id = 0, - .minimum_version_id_old = 0, .pre_save = pvscsi_pre_save, .post_load = pvscsi_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_PCI_DEVICE (parent_obj, PVSCSIState),VMSTATE_UINT8 (msi_used, PVSCSIState),VMSTATE_UINT32 (resetting, PVSCSIState),
hw/timer/hpet.c +3 -6
@@ -282,8 +282,7 @@ static const VMStateDescription vmstate_hpet_rtc_irq_level = { .name = "hpet/rtc_irq_level", .version_id = 1, .minimum_version_id =1 , - .minimum_version_id_old =1 , - .fields = (VMStateField[]) { + .fields = (VMStateField[]) {VMSTATE_UINT8 (rtc_irq_level, HPETState),VMSTATE_END_OF_LIST () }
@@ -293,8 +292,7 @@ static const VMStateDescription vmstate_hpet_timer = { .name = "hpet_timer", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT8 (tn, HPETTimer),VMSTATE_UINT64 (config, HPETTimer),VMSTATE_UINT64 (cmp, HPETTimer),
@@ -310,11 +308,10 @@ static const VMStateDescription vmstate_hpet = { .name = "hpet", .version_id = 2, .minimum_version_id = 1, - .minimum_version_id_old = 1, .pre_save = hpet_pre_save, .pre_load = hpet_pre_load, .post_load = hpet_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT64 (config, HPETState),VMSTATE_UINT64 (isr, HPETState),VMSTATE_UINT64 (hpet_counter, HPETState),
hw/timer/i8254_common.c +0 -1
@@ -180,7 +180,6 @@ static const VMStateDescription vmstate_pit_channel = { .name = "pit channel", .version_id = 2, .minimum_version_id = 2, - .minimum_version_id_old = 2, .fields = (VMStateField []) {VMSTATE_INT32 (count, PITChannelState),VMSTATE_UINT16 (latched_count, PITChannelState),
hw/timer/mc146818rtc.c +1 -2
@@ -720,9 +720,8 @@ static const VMStateDescription vmstate_rtc = { .name = "mc146818rtc", .version_id = 3, .minimum_version_id = 1, - .minimum_version_id_old = 1, .post_load = rtc_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_BUFFER (cmos_data, RTCState),VMSTATE_UINT8 (cmos_index, RTCState),VMSTATE_UNUSED (7 *4 ),
hw/watchdog/wdt_i6300esb.c +7 -7
@@ -379,18 +379,18 @@ static const VMStateDescription vmstate_i6300esb = {* version_id to be set for every build. This eventually broke * migration. * -* To correct this without breaking old->new migration for older versions -* of QEMU, we've set version_id to a value high enough to exceed all past -* values of sizeof(I6300State) across various build environments, and have -* reset minimum_version_id_old/minimum_version_id to 1, since this VMSD -* has never changed and thus can accept all past versions. +* To correct this without breaking old->new migration for older +* versions of QEMU, we've set version_id to a value high enough +* to exceed all past values of sizeof(I6300State) across various +* build environments, and have reset minimum_version_id to 1, +* since this VMSD has never changed and thus can accept all past +* versions. * * For future changes we can treat these values as we normally would. */ .version_id = 10000, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_PCI_DEVICE (dev, I6300State),VMSTATE_INT32 (reboot_enabled, I6300State),VMSTATE_INT32 (clock_scale, I6300State),
hw/watchdog/wdt_ib700.c +1 -2
@@ -92,8 +92,7 @@ static const VMStateDescription vmstate_ib700 = { .name = "ib700_wdt", .version_id = 0, .minimum_version_id =0 , - .minimum_version_id_old =0 , - .fields = (VMStateField []) { + .fields = (VMStateField[]) {VMSTATE_TIMER (timer, IB700State),VMSTATE_END_OF_LIST () }
target-i386/machine.c +19 -38
173 lines not on this page · raw message
Signature · 1 line
1.9.3
PATCH 3/6 vmstate: Refactor opening of files
In reply to Juan Quintela--- tests/test-vmstate.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-)
tests/test-vmstate.c +19 -19
@@ -44,14 +44,14 @@ void yield_until_fd_readable(int fd) }/* Duplicate temp_fd and seek to the beginning of the file */ -static int dup_temp_fd (bool truncate) +static QEMUFile *open_test_file (bool write) {int fd =dup (temp_fd);lseek (fd,0 ,SEEK_SET ); -if (truncate) { +if (write) { g_assert_cmpint(ftruncate(fd, 0), ==, 0); } -return fd; +return qemu_fdopen (fd, write ?"wb" :"rb" ); } typedef struct TestSruct {
@@ -76,13 +76,13 @@ static const VMStateDescription vmstate_simple = {static void test_simple_save (void ) { -QEMUFile *fsave =qemu_fdopen (dup_temp_fd (true),"wb" ); +QEMUFile *fsave =open_test_file (true);TestStruct obj = { .a =1 , .b =2 , .c =3 , .d =4 };vmstate_save_state (fsave, &vmstate_simple, &obj);g_assert (!qemu_file_get_error (fsave));qemu_fclose (fsave); -QEMUFile *loading =qemu_fdopen (dup_temp_fd (false),"rb" ); +QEMUFile *loading =open_test_file (false);uint8_t expected[] = {0 ,0 ,0 ,1 ,/* a */ 0 ,0 ,0 ,2 ,/* b */
@@ -104,7 +104,7 @@ static void test_simple_save(void)static void test_simple_load (void ) { -QEMUFile *fsave =qemu_fdopen (dup_temp_fd (true),"wb" ); +QEMUFile *fsave =open_test_file (true);uint8_t buf[] = {0 ,0 ,0 ,10 ,/* a */ 0 ,0 ,0 ,20 ,/* b */
@@ -115,7 +115,7 @@ static void test_simple_load(void)qemu_put_buffer (fsave, buf,sizeof (buf));qemu_fclose (fsave); -QEMUFile *loading =qemu_fdopen (dup_temp_fd (false),"rb" ); +QEMUFile *loading =open_test_file (false);TestStruct obj;vmstate_load_state (loading, &vmstate_simple, &obj,1 );g_assert (!qemu_file_get_error (loading));
@@ -145,7 +145,7 @@ static const VMStateDescription vmstate_versioned = {static void test_load_v1 (void ) { -QEMUFile *fsave =qemu_fdopen (dup_temp_fd (true),"wb" ); +QEMUFile *fsave =open_test_file (true);uint8_t buf[] = {0 ,0 ,0 ,10 ,/* a */ 0 ,0 ,0 ,30 ,/* c */
@@ -155,7 +155,7 @@ static void test_load_v1(void)qemu_put_buffer (fsave, buf,sizeof (buf));qemu_fclose (fsave); -QEMUFile *loading =qemu_fdopen (dup_temp_fd (false),"rb" ); +QEMUFile *loading =open_test_file (false);TestStruct obj = { .b =200 , .e =500 , .f =600 };vmstate_load_state (loading, &vmstate_versioned, &obj,1 );g_assert (!qemu_file_get_error (loading));
@@ -170,7 +170,7 @@ static void test_load_v1(void)static void test_load_v2 (void ) { -QEMUFile *fsave =qemu_fdopen (dup_temp_fd (true),"wb" ); +QEMUFile *fsave =open_test_file (true);uint8_t buf[] = {0 ,0 ,0 ,10 ,/* a */ 0 ,0 ,0 ,20 ,/* b */
@@ -183,7 +183,7 @@ static void test_load_v2(void)qemu_put_buffer (fsave, buf,sizeof (buf));qemu_fclose (fsave); -QEMUFile *loading =qemu_fdopen (dup_temp_fd (false),"rb" ); +QEMUFile *loading =open_test_file (false);TestStruct obj;vmstate_load_state (loading, &vmstate_versioned, &obj,2 ); g_assert_cmpint(obj.a, ==, 10);
@@ -219,14 +219,14 @@ static const VMStateDescription vmstate_skipping = {static void test_save_noskip (void ) { -QEMUFile *fsave =qemu_fdopen (dup_temp_fd (true),"wb" ); +QEMUFile *fsave =open_test_file (true);TestStruct obj = { .a =1 , .b =2 , .c =3 , .d =4 , .e =5 , .f =6 , .skip_c_e = false };vmstate_save_state (fsave, &vmstate_skipping, &obj);g_assert (!qemu_file_get_error (fsave));qemu_fclose (fsave); -QEMUFile *loading =qemu_fdopen (dup_temp_fd (false),"rb" ); +QEMUFile *loading =open_test_file (false);uint8_t expected[] = {0 ,0 ,0 ,1 ,/* a */ 0 ,0 ,0 ,2 ,/* b */
@@ -250,14 +250,14 @@ static void test_save_noskip(void)static void test_save_skip (void ) { -QEMUFile *fsave =qemu_fdopen (dup_temp_fd (true),"wb" ); +QEMUFile *fsave =open_test_file (true);TestStruct obj = { .a =1 , .b =2 , .c =3 , .d =4 , .e =5 , .f =6 , .skip_c_e = true };vmstate_save_state (fsave, &vmstate_skipping, &obj);g_assert (!qemu_file_get_error (fsave));qemu_fclose (fsave); -QEMUFile *loading =qemu_fdopen (dup_temp_fd (false),"rb" ); +QEMUFile *loading =open_test_file (false);uint8_t expected[] = {0 ,0 ,0 ,1 ,/* a */ 0 ,0 ,0 ,2 ,/* b */
@@ -280,7 +280,7 @@ static void test_save_skip(void)static void test_load_noskip (void ) { -QEMUFile *fsave =qemu_fdopen (dup_temp_fd (true),"wb" ); +QEMUFile *fsave =open_test_file (true);uint8_t buf[] = {0 ,0 ,0 ,10 ,/* a */ 0 ,0 ,0 ,20 ,/* b */
@@ -293,7 +293,7 @@ static void test_load_noskip(void)qemu_put_buffer (fsave, buf,sizeof (buf));qemu_fclose (fsave); -QEMUFile *loading =qemu_fdopen (dup_temp_fd (false),"rb" ); +QEMUFile *loading =open_test_file (false);TestStruct obj = { .skip_c_e = false };vmstate_load_state (loading, &vmstate_skipping, &obj,2 );g_assert (!qemu_file_get_error (loading));
@@ -308,7 +308,7 @@ static void test_load_noskip(void)static void test_load_skip (void ) { -QEMUFile *fsave =qemu_fdopen (dup_temp_fd (true),"wb" ); +QEMUFile *fsave =open_test_file (true);uint8_t buf[] = {0 ,0 ,0 ,10 ,/* a */ 0 ,0 ,0 ,20 ,/* b */
@@ -319,7 +319,7 @@ static void test_load_skip(void)qemu_put_buffer (fsave, buf,sizeof (buf));qemu_fclose (fsave); -QEMUFile *loading =qemu_fdopen (dup_temp_fd (false),"rb" ); +QEMUFile *loading =open_test_file (false);TestStruct obj = { .skip_c_e = true, .c =300 , .e =500 };vmstate_load_state (loading, &vmstate_skipping, &obj,2 );g_assert (!qemu_file_get_error (loading));
Signature · 1 line
1.9.3
PATCH 4/6 migration: Increase default max_downtime from 30ms to 300ms
In reply to Juan QuintelaFrom: Alexey Kardashevskiy <[email protected]>
The existing timeout is 30ms which on 100MB/s (1Gbit) gives us 3MB/s rate maximum. If we put some load on the guest, it is easy to get page dirtying rate too big so live migration will never complete. In the case of libvirt that means that the guest will be stopped anyway after a timeout specified in the "virsh migrate" command and this normally generates even bigger delay.
This changes max_downtime to 300ms which seems to be more reasonable value.
--- migration.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
migration.c +1 -1
@@ -133,7 +133,7 @@ void process_incoming_migration(QEMUFile *f)* the choice of nanoseconds is because it is the maximum resolution that * get_clock() can achieve. It is an internal measure. All user-visible * units must be in seconds */ -static uint64_t max_downtime =30000000 ; +static uint64_t max_downtime =300000000 ;uint64_t migrate_max_downtime (void ) {
Signature · 1 line
1.9.3
PATCH 5/6 rdma: Fix block during rdma migration
In reply to Juan QuintelaFrom: Gonglei <[email protected]>
If the networking break or there's something wrong with rdma device(ib0 with no IP) during rdma migration, the main_loop of qemu will be blocked in rdma_destroy_id. I add rdma_ack_cm_event to fix this bug.
--- migration-rdma.c | 1 + 1 file changed, 1 insertion(+)
migration-rdma.c +1 -0
@@ -949,6 +949,7 @@ route:ERROR (errp,"result not equal to event_addr_resolved %s" ,rdma_event_str (cm_event->event));perror ("rdma_resolve_addr" ); +rdma_ack_cm_event (cm_event); ret = -EINVAL ; goto err_resolve_get_addr; }
Signature · 1 line
1.9.3
PATCH 6/6 migration: catch unknown flags in ram_load
In reply to Juan QuintelaFrom: Peter Lieven <[email protected]>
if a saved vm has unknown flags in the memory data qemu currently simply ignores this flag and continues which yields in an unpredictable result.
This patch catches all unknown flags and aborts the loading of the vm. Additionally error reports are thrown if the migration aborts abnormally.
--- arch_init.c | 42 +++++++++++++++++++++++------------------- migration.c | 2 +- 2 files changed, 24 insertions(+), 20 deletions(-)
arch_init.c +23 -19
@@ -1040,17 +1040,15 @@ static int ram_load(QEMUFile *f, void *opaque, int version_id) {ram_addr_t addr;int flags, ret =0 ; -int error;static uint64_t seq_iter; seq_iter++;if (version_id !=4 ) { ret = -EINVAL ; - goto done; } - do { +while (!ret) { addr =qemu_get_be64 (f); flags = addr & ~TARGET_PAGE_MASK ;
@@ -1078,7 +1076,6 @@ static int ram_load(QEMUFile *f, void *opaque, int version_id)" in != " RAM_ADDR_FMT , id, length, block->length); ret = -EINVAL ; - goto done; }break ; }
@@ -1088,21 +1085,22 @@ static int ram_load(QEMUFile *f, void *opaque, int version_id)error_report ("Unknown ramblock \"%s\", cannot " "accept migration" , id); ret = -EINVAL ; - goto done; + } +if (ret) { +break ; } total_ram_bytes -= length; } - } - -if (flags &RAM_SAVE_FLAG_COMPRESS ) { + }else if (flags &RAM_SAVE_FLAG_COMPRESS ) {void *host;uint8_t ch; host =host_from_stream_offset (f, addr, flags);if (!host) { +error_report ("Illegal RAM offset " RAM_ADDR_FMT , addr); ret = -EINVAL ; - goto done; +break ; } ch =qemu_get_byte (f);
@@ -1112,33 +1110,39 @@ static int ram_load(QEMUFile *f, void *opaque, int version_id) host =host_from_stream_offset (f, addr, flags);if (!host) { +error_report ("Illegal RAM offset " RAM_ADDR_FMT , addr); ret = -EINVAL ; - goto done; +break ; }qemu_get_buffer (f, host,TARGET_PAGE_SIZE ); }else if (flags &RAM_SAVE_FLAG_XBZRLE ) {void *host =host_from_stream_offset (f, addr, flags);if (!host) { +error_report ("Illegal RAM offset " RAM_ADDR_FMT , addr); ret = -EINVAL ; - goto done; +break ; }if (load_xbzrle (f, addr, host) <0 ) { +error_report ("Failed to decompress XBZRLE page at " +RAM_ADDR_FMT , addr); ret = -EINVAL ; - goto done; +break ; } }else if (flags &RAM_SAVE_FLAG_HOOK ) {ram_control_load_hook (f, flags); + }else if (flags &RAM_SAVE_FLAG_EOS ) { +/* normal exit */ +break ; + }else { +error_report ("Unknown migration flags: %#x" , flags); + ret = -EINVAL ; +break ; } - error =qemu_file_get_error (f); -if (error) { - ret = error; - goto done; - } - }while (!(flags &RAM_SAVE_FLAG_EOS )); + ret =qemu_file_get_error (f); + } -done:DPRINTF ("Completed load of VM with exit code %d seq iteration " "%" PRIu64"\n" , ret, seq_iter);return ret;
migration.c +1 -1
@@ -98,7 +98,7 @@ static void process_incoming_migration_co(void *opaque)qemu_fclose (f);free_xbzrle_decoded_buf ();if (ret <0 ) { -fprintf (stderr,"load of migration failed\n" ); +error_report ("load of migration failed: %s" ,strerror (-ret));exit (EXIT_FAILURE ); }qemu_announce_self ();
Signature · 1 line
1.9.3
Re: [Qemu-devel] [PATCH 6/6] migration: catch unknown flags in ram_load
Quoted 9 lines · Juan Quintela
From: Peter Lieven <[email protected]>
if a saved vm has unknown flags in the memory data qemu currently simply ignores this flag and continues which yields in an unpredictable result.
This patch catches all unknown flags and aborts the loading of the vm. Additionally error reports are thrown if the migration aborts abnormally.
This patch is a strict improvement, so I'm glad it went in. However, I still feel that we aren't doing a good job of silently ignoring unexpected combinations of flag bits, and had suggestions in the original thread on further followups that are worth having before the 2.1 release.
arch_init.c static int ram_load(QEMUFile *f, void *opaque, int version_id) · line 1096
Quoted 4 lines
arch_init.c +1
-2- -if (flags &RAM_SAVE_FLAG_COMPRESS ) { + }else if (flags &RAM_SAVE_FLAG_COMPRESS ) {void *host;
Among other things, switching from a chain of if-else to a switch might make it easier to document explicit supported combinations of flags and reject other values from an invalid stream.
Signature · 2 lines
Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Re: [Qemu-devel] [PATCH 6/6] migration: catch unknown flags in ram_load
Quoted 16 lines · Eric Blake
Quoted 9 lines · Juan Quintela
From: Peter Lieven <[email protected]>
if a saved vm has unknown flags in the memory data qemu currently simply ignores this flag and continues which yields in an unpredictable result.
This patch catches all unknown flags and aborts the loading of the vm. Additionally error reports are thrown if the migration aborts abnormally.
This patch is a strict improvement, so I'm glad it went in. However, I still feel that we aren't doing a good job of silently ignoring unexpected combinations of flag bits, and had suggestions in the original thread on further followups that are worth having before the 2.1 release.
Quoted 8 lines
Review
Quoted 4 lines
(quoted diff) +1
-2- - if (flags & RAM_SAVE_FLAG_COMPRESS) { + } else if (flags & RAM_SAVE_FLAG_COMPRESS) { void *host;Among other things, switching from a chain of if-else to a switch might make it easier to document explicit supported combinations of flags and reject other values from an invalid stream.
Is this what you have in mind?
arch_init.c +76 -77
@@ -1039,7 +1039,7 @@ void ram_handle_compressed(void *host, uint8_t ch, uint64_t size)static int ram_load (QEMUFile *f,void *opaque,int version_id) {ram_addr_t addr; -int flags, ret =0 ; +int flags =0 , ret =0 ;static uint64_t seq_iter; seq_iter++;
@@ -1048,97 +1048,96 @@ static int ram_load(QEMUFile *f, void *opaque, int version_id) ret = -EINVAL ; } -while (!ret) { +while (!ret && !(flags &RAM_SAVE_FLAG_EOS )) { addr =qemu_get_be64 (f); flags = addr & ~TARGET_PAGE_MASK ; addr &=TARGET_PAGE_MASK ; -if (flags &RAM_SAVE_FLAG_MEM_SIZE ) { -/* Synchronize RAM block list */ -char id[256 ]; -ram_addr_t length; -ram_addr_t total_ram_bytes = addr; - -while (total_ram_bytes) { -RAMBlock *block; -uint8_t len; - - len =qemu_get_byte (f); -qemu_get_buffer (f, (uint8_t *)id, len); - id[len] =0 ; - length =qemu_get_be64 (f); - - QTAILQ_FOREACH(block, &ram_list.blocks, next) { -if (!strncmp (id, block->idstr,sizeof (id))) { -if (block->length != length) { -error_report ("Length mismatch: %s: " RAM_ADDR_FMT -" in != " RAM_ADDR_FMT , id, length, - block->length); - ret = -EINVAL ; +if (flags &RAM_SAVE_FLAG_HOOK ) { +ram_control_load_hook (f, flags); + }else { +ram_addr_t total_ram_bytes; +void *host; +uint8_t ch; +switch (flags & ~RAM_SAVE_FLAG_CONTINUE ) { +case RAM_SAVE_FLAG_MEM_SIZE : +/* Synchronize RAM block list */ + total_ram_bytes = addr; +while (total_ram_bytes) { +RAMBlock *block; +uint8_t len; +char id[256 ]; +ram_addr_t length; + + len =qemu_get_byte (f); +qemu_get_buffer (f, (uint8_t *)id, len); + id[len] =0 ; + length =qemu_get_be64 (f); + + QTAILQ_FOREACH(block, &ram_list.blocks, next) { +if (!strncmp (id, block->idstr,sizeof (id))) { +if (block->length != length) { +error_report ("Length mismatch: %s: " RAM_ADDR_FMT +" in != " RAM_ADDR_FMT , id, length, + block->length); + ret = -EINVAL ; + } +continue ; } -break ; } +if (!block) { +error_report ("Unknown ramblock \"%s\", cannot " +"accept migration" , id); + ret = -EINVAL ; + } +if (ret) { +continue ; + } + total_ram_bytes -= length; } - -if (!block) { -error_report ("Unknown ramblock \"%s\", cannot " -"accept migration" , id); +break ; +case RAM_SAVE_FLAG_COMPRESS : + host =host_from_stream_offset (f, addr, flags); +if (!host) { +error_report ("Illegal RAM offset " RAM_ADDR_FMT , addr); ret = -EINVAL ; +continue ; } -if (ret) { -break ; - } - - total_ram_bytes -= length; - } - }else if (flags &RAM_SAVE_FLAG_COMPRESS ) { -void *host; -uint8_t ch; - - host =host_from_stream_offset (f, addr, flags); -if (!host) { -error_report ("Illegal RAM offset " RAM_ADDR_FMT , addr); - ret = -EINVAL ; + ch =qemu_get_byte (f); +ram_handle_compressed (host, ch,TARGET_PAGE_SIZE );break ; - } - - ch =qemu_get_byte (f); -ram_handle_compressed (host, ch,TARGET_PAGE_SIZE ); - }else if (flags &RAM_SAVE_FLAG_PAGE ) { -void *host; - - host =host_from_stream_offset (f, addr, flags); -if (!host) { -error_report ("Illegal RAM offset " RAM_ADDR_FMT , addr); - ret = -EINVAL ; +case RAM_SAVE_FLAG_PAGE : + host =host_from_stream_offset (f, addr, flags); +if (!host) { +error_report ("Illegal RAM offset " RAM_ADDR_FMT , addr); + ret = -EINVAL ; +continue ; + } +qemu_get_buffer (f, host,TARGET_PAGE_SIZE );break ; - } - -qemu_get_buffer (f, host,TARGET_PAGE_SIZE ); - }else if (flags &RAM_SAVE_FLAG_XBZRLE ) { -void *host =host_from_stream_offset (f, addr, flags); -if (!host) { -error_report ("Illegal RAM offset " RAM_ADDR_FMT , addr); - ret = -EINVAL ; +case RAM_SAVE_FLAG_XBZRLE : + host =host_from_stream_offset (f, addr, flags); +if (!host) { +error_report ("Illegal RAM offset " RAM_ADDR_FMT , addr); + ret = -EINVAL ; +continue ; + } +if (load_xbzrle (f, addr, host) <0 ) { +error_report ("Failed to decompress XBZRLE page at " +RAM_ADDR_FMT , addr); + ret = -EINVAL ; +continue ; + }break ; - } - -if (load_xbzrle (f, addr, host) <0 ) { -error_report ("Failed to decompress XBZRLE page at " -RAM_ADDR_FMT , addr); +case RAM_SAVE_FLAG_EOS : +/* normal exit */ +continue ; +default : +error_report ("Unknown migration flags: %#x" , flags); ret = -EINVAL ; -break ; +continue ; } - }else if (flags &RAM_SAVE_FLAG_HOOK ) { -ram_control_load_hook (f, flags); - }else if (flags &RAM_SAVE_FLAG_EOS ) { -/* normal exit */ -break ; - }else { -error_report ("Unknown migration flags: %#x" , flags); - ret = -EINVAL ; -break ; } ret =qemu_file_get_error (f); }
Re: [Qemu-devel] [PATCH 6/6] migration: catch unknown flags in ram_load
Quoted 22 lines · Peter Lieven
Quoted 4 lines
Among other things, switching from a chain of if-else to a switch might make it easier to document explicit supported combinations of flags and reject other values from an invalid stream.
Is this what you have in mind?
arch_init.c +1
-1@@ -1039,7 +1039,7 @@ void ram_handle_compressed(void *host, uint8_t ch, uint64_t size)static int ram_load (QEMUFile *f,void *opaque,int version_id) {ram_addr_t addr; -int flags, ret =0 ; +int flags =0 , ret =0 ;static uint64_t seq_iter;seq_iter++;
arch_init.c static int ram_load(QEMUFile *f, void *opaque, · line 1055
Quoted 10 lines
arch_init.c +3
-2@@ -1048,97 +1048,96 @@ static int ram_load(QEMUFile *f, void *opaque, int version_id) ret = -EINVAL ; } -while (!ret) { +while (!ret && !(flags &RAM_SAVE_FLAG_EOS )) { - ret = -EINVAL ; +if (flags &RAM_SAVE_FLAG_HOOK ) { +ram_control_load_hook (f, flags);
Can RAM_SAVE_FLAG_HOOK | RAM_SAVE_FLAG_EOS ever be true? If so, you abort the loop early. (One possibility: solve it by adding 'flags = 0;' here.)
Also, this patch was harder to read than necessary, because it reindented everything, and threw off git's diff algorithm. Use 'git diff --patience' to make it a bit more legible as a bulk delete/replace instead of dividing into hunks around common but unrelated context lines. Or even rewrite it slightly so that the bulk of the code is still at the same indentation, perhaps by rearranging this if statement to instead appear inside the default label of the switch:
while (!ret && !(flags & RAM_SAVE_FLAG_EOS)) {
flags = ...;
switch (flags & ~RAM_SAVE_FLAG_CONTINUE) {
...
default:
if (flags & RAM_SAVE_FLAG_HOOK) {
ram_control_load_hook(f, flags);
flags = 0;
} else {
report error on unknown flags
}
break;
}
ret = qemu_file_get_error(f);
}But yes, this is what I had in mind - propose it as a formal patch with S-o-B, and I'll review it.
Signature · 2 lines
Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Peter Maydell
AppliedQuoted 21 lines · Juan Quintela
Hi Peter
This is the previous pull request with:
- Added fix for RDMA
- Change default downtime
- fix the compilation error on 32bits, basically useRAM_ADDR_FMTfor the format checked that it compilesPlease, apply, Juan.
The following changes since commit
06a59afac4505f5ed942db4200e5ca16fcbba74d:Merge remote-tracking branch 'remotes/kraxel/tags/pull-usb-20140613-1' into staging (2014-06-13 18:18:55 +0100)
are available in the git repository at:
git://github.com/juanquintela/qemu.gittags/migration/20140616
Quoted 8 lines
for you to fetch changes up to
db80facefa62dff42bb50c73b0f03eda5f732b49:migration: catch unknown flags in
ram_load(2014-06-16 04:55:27 +0200)----------------------------------------------------------------
migration/next for 20140616----------------------------------------------------------------
Applied, thanks.
-- PMM