VMState simplification (massive)
Subsystems (4)
cover VMState simplification (massive)
Hi
Look at the diffstat. Almost all the additions are attest-vmstate.c. That is the reason why it is called a simplification.
What this series does:
- peter removal of version_minimum_id_old field when not needed (Peter)
- cleanup: based on the previous one, I removed all the unneeded the uses on the tree. This should make your compiles
a couple of nanoseconds faster.
- once there, fixed the indentation of the .fields line, to a canonical
.fields = (VMStateField[])
- mst simplifications for vmstate engine
And now, the big cleanup.
- Patches only do one thing, to make easy the review.
- Added test for all VMSTATE_FOO() definitions
(well, I am lying, VMSTATE_STRUCT* are still missing, will come soon)
- We had two ways to make a field optional VMSTATE_INT64_V(field, state, version)
and
VMSTATE_INT64_TEST(field, state, test)
We can do the version one with one test like:
static inline bool vmstate_5_plus(void *opaque, int version_id)
{
return version_id >= 5;
}and then change: VMSTATE_INT64_V(field, state, 5); into VMSTATE_INT64_TEST(field, state, vmstate_5_plus);
The functions until version 15 are already defined on the tree. All the users on the tree are changed to this new schema. Actually we used to have:
VMSTATE_FOO()
VMSTATE_FOO_V()
VMSTATE_FOO_TEST()
Where some of them where defined. After all the changes, only exst VMSTATE_FOO()
VMSTATE_FOO_TEST() (When needed)
- When all the changes are done, removal from version_id at the FieldLevel is removed. Notice that from the toplevel, all the versions work the same at the section level, the only thing that has changed is at the field level.
- Doing the tests, I found a bug (tests have some utility after all)
When the incoming migration stream stoped for any reason, we setup an error, but until we don't end a section, we never check for one error, so it could take a lot until we found it. Now we check after each field read.
- You can see that all the tests share a lot of the boilerplate code. If you have any good idea about how to refactor it to not repeat so much code, let me know.
- Remove all the VMSTATE_FOO* that had no users
- Create new ones for things that were opencoded
VMSTATE_SYNTHETIC(): fields that don't exist on the state struct and are generated It was already opencoded, just created a macro and used it where needed.
VMSTATE_OPENCODED_UNSAFE: There are a couple of cases where a non vmstate field is needed from vmstate. We can cheat and declare that as an struct, but that is not vmstate. There were already users on the tree, so create it.
If you ever wanted to know more about VMState, this is your opportunity. As the tests are aded one field at a time, you can see how the things on the wire change each time to add a new field.
ToDo:
- Finish the tests for the STRUCTS and ARRAYS of STRUCTS of several kinds
- synthetic fields: we can do even better/easier. We can add a hook for the cases where we want to compute the value in a different way.
This could be used for the validate stuff that Michael requested on its patches, while allowing to simplify even more tests.
- port the _vmstate fields to the new synthetic framework.
Thanks for reading until here.
Later, Juan.
The following changes since commit 466e6e9d13d56bbb6da1d2396d7d6347df483af0:
target-i386: reorder fields in cpu/msr_hyperv_hypercall subsection (2014-04-05 10:49:05 +0100)
are available in the git repository at:
git://github.com/juanquintela/qemu.git tags/vmstate-simplification-v1/20140407
for you to fetch changes up to 965f5c4b7b0f87a6c326d968ebd2b5f6022a962d:
vmstate: Test for VMSTATE_VBUFFER_UINT32 (2014-04-07 04:35:22 +0200)
----------------------------------------------------------------
vmstate-simplification-v1/next for 20140407
----------------------------------------------------------------
Juan Quintela (94):
savevm: Remove all the unneded version_minimum_id_old (Massive)
vmstate: return error in case of error
vmstate: refactor opening of files
vmstate: Refactor & increase tests for primitive types
vmstate: create test functions for versions until 15
vmstate: Remove VMSTATE_UINTL_EQUAL_V
vmstate: Change VMSTATE_INTTL_V to VMSTATE_INTTL_TEST
vmstate: Remove unused VMSTATE_UINTTL_ARRAY_V
vmstate: Test for VMSTATE_BOOL_TEST
vmstate: Test for VMSTATE_INT8_TEST
vmstate: Test for VMSTATE_INT16_TEST
vmstate: Test for VMSTATE_INT32_TEST
vmstate: test for VMSTATE_INT64_TEST
vmstate: Test for VMSTATE_UINT8_TEST
vmstate: Test for VMSTATE_UINT16_TEST
vmstate: Test for VMSTATE_UINT32_TEST
vmstate: Test for VMSTATE_UINT64_TEST
vmstate: Test for VMSTATE_FLOAT64
vmstate: Test for VMSTATE_UNUSED
vmstate: Test for VMSTATE_BITMAP
vmstate: Test for VMSTATE_UINT8_EQUAL
vmstate: Test for VMSTATE_UINT16_EQUAL
vmstate: Test for VMSTATE_UINT32_EQUAL
vmstate: Test for VMSTATE_UINT64_EQUAL
vmstate: Test for VMSTATE_INT32_EQUAL
vmstate: Test for VMSTATE_INT32_LE
vmstate: Move VMSTATE_TIMER_V to VMSTATE_TIMER_TEST
vmstate: Test for VMSTATE_ARRAY_BOOL_TEST
vmstate: Test for VMSTATE_UINT8_ARRAY
vmstate: Test for VMSTATE_UINT16_ARRAY
vmstate: Test for VMSTATE_UINT32_ARRAY{_TEST}
vmstate: Test for VMSTATE_UINT64_ARRAY{_TEST}
vmstate: Test for VMSTATE_INT16_ARRAY
vmstate: Test for VMSTATE_INT32_ARRAY{_TEST}
vmstate: Test for VMSTATE_INT64_ARRAY
vmstate: Test for VMSTATE_FLOAT64_ARRAY
vmstate: Test for VMSTATE_UINT8_2DARRAY
vmstate: Test for VMSTATE_UINT16_2DARRAY.
vmstate: Test for VMSTATE_UINT32_2DARRAY
vmstate: Remove unused VMSTATE_BUFFER_V
vmstate: Remove version from VMSTATE_BUFFER_UNSAFE
vmstate: Remove unused version fields from ARM
vmstate: All ptimers users were at least at version 1 or more
vmstate: remove version from all variants of VMSTATE_STRUCT_POINTER*
vmstate: Port last 3 users of VMSTATE_ARRAY to VMSTATE_ARRAY_TEST
vmstate: Port last user of VMSTATE_SINGLE to VMSTATE_SINGLE_TEST
vmstate: Remove unused VMSTATE_POINTER
vmstate: Rename VMSTATE_SINGLE_TEST to VMSTATE_SINGLE
vmstate: Move VMSTATE_2DARRAY to use _test
vmstate: Rename VMSTATE_POINTER_TEST without _TEST
vmstate: Rename VMSTATE_ARRAY_TEST to VMSTATE_ARRAY
vmstate: Remove version_id from VMSTATE_VBUFFER
vmstate: Remove version_id fields that were not used
vmstate: Remove version_id from VMSTATE_SUB_ARRAY
vmstate: Remove version parameter from VMSTATE_VARRAY_INT32
vmstate: Remove version_id from VMSTATE_VARRAY_UINT16_UNSAFE
vmstate: VMSTATE_ARRAY_OF_POINTER didn't used the version_id field
vmstate: remove version parameter from VMSTATE_BUFFER_POINTER_UNSAFE
vmstate: Remove version, test and start parameter from VMSTATE_VBUFFER_UINT32
vmstate: Remove version paramenter from VMSTATE_ARRAY_OF_POINTER_TO_STRUCT
vmstate: Remove VMSTATE_BUFFER_MULTIPLY
vmstate: Remove version parameter from VMSTATE_STATIC_BUFFER
vmstate: Remove version field from VMSTATE_STRUCT_VARRAY_UINT32
vmstate: Move all users of versioning of VMSTATE_STRUCT_ARRAY to _TEST
vmstate: Remove version paramenter from VMSTATE_STRUCT_ARRAY
vmstate: Remove version parameter from VMSTATE_STRUCT_ARRAY_TEST
vmstate: Remove unused version parameter from VMSTATE_STRUCT_VARRAY_INT32
vmstate: Remove unused version parameter from VMSTATE_STRUCT_VARRAY_UINT8
vmstate: Introduce VMSTATE_VARRAY_UINT32_TEST
vmstate: Remove version parameter from VMSTATE_VARRAY_UINT32
vmstate: Remove version parameter from VMSTATE_STRUCT_TEST
vmstate: Move all users of versioning to VMSTATE_STRUCT_TEST
vmstate: Remove version from all VMSTATE_STRUCT calls
vmstate: Create VMSTATE_VARRAY macro
vmstate: Create VMSTATE_POINTER_UNSAFE
vmstate: Create VMSTATE_OPENCODED_UNSAFE
vmstate: Create VMSTATE_SYNTHETIC
vmstate: version_id is gone from fields
vmstate: Test for VMSTATE_SYNTHETIC
vmstate: Test for VMSTATE_UINT8_SUB_ARRAY
vmstate: Test for VMSTATE_UINT32_SUB_ARRAY
vmstate: Test for VMSTATE_BUFFER
vmstate: Test for VMSTATE_PARTIAL_BUFFER
vmstate: Test for VMSTATE_BUFFER_START_MIDDLE
vmstate: Add tests for VMSTATE_BUFFER_TEST
vmstate: Use VMSTATE_UINT8_2DARRAY instead of VMSTATE_BUFFER_TEST
vmstate: Test for VMSTATE_BUFFER_UNSAFE
vmstate: Remove unused VMSTATE_SUB_VBUFFER
vmstate: Remove unused VMSTATE_PARTIAL_VBUFFER_UINT32
vmstate: Test for VMSTATE_PARTIAL_VBUFFER
vmstate: ename VMSTATE_PARTIAL_VBUFFER to VMSTATE_VBUFFER_INT32
vmstate: Create VMS_VBUFFER_UINT32
vmstate: Rename VMS_VBUFFER to VMST_VBUFFER_INT32 for consintency
vmstate: Test for VMSTATE_VBUFFER_UINT32
Michael S. Tsirkin (2):
vmstate: reduce code duplication
vmstate: s/VMSTATE_INT32_LE/VMSTATE_INT32_POSITIVE_LE/
Peter Maydell (1):
savevm: Ignore minimum_version_id_old if there is no load_state_old
audio/audio.c | 3 +- cpus.c | 5 +- docs/migration.txt | 20 +- exec.c | 3 +- hw/acpi/ich9.c | 12 +- hw/acpi/pcihp.c | 3 +- hw/acpi/piix4.c | 29 +- hw/arm/highbank.c | 1 - hw/arm/musicpal.c | 10 +- hw/arm/pxa2xx.c | 19 +- hw/arm/pxa2xx_gpio.c | 3 +- hw/arm/pxa2xx_pic.c | 1 - hw/arm/spitz.c | 14 +- hw/arm/stellaris.c | 14 +- hw/arm/strongarm.c | 6 - hw/arm/z2.c | 2 - hw/audio/ac97.c | 8 +- hw/audio/cs4231.c | 3 +- hw/audio/cs4231a.c | 3 +- hw/audio/es1370.c | 8 +- hw/audio/gus.c | 3 +- hw/audio/hda-codec.c | 10 +- hw/audio/intel-hda.c | 7 +- hw/audio/lm4549.c | 5 +- hw/audio/marvell_88w8618.c | 1 - hw/audio/milkymist-ac97.c | 3 +- hw/audio/pl041.c | 25 +- hw/audio/sb16.c | 3 +- hw/audio/wm8750.c | 3 +- hw/block/ecc.c | 3 +- hw/block/fdc.c | 24 +- hw/block/m25p80.c | 1 - hw/block/nand.c | 3 +- hw/block/onenand.c | 5 +- hw/char/cadence_uart.c | 1 - hw/char/digic-uart.c | 1 - hw/char/escc.c | 10 +- hw/char/exynos4210_uart.c | 6 +- hw/char/imx_serial.c | 1 - hw/char/ipoctal232.c | 13 +- hw/char/lm32_juart.c | 3 +- hw/char/lm32_uart.c | 3 +- hw/char/milkymist-uart.c | 3 +- hw/char/pl011.c | 3 +- hw/char/sclpconsole-lm.c | 3 +- hw/char/sclpconsole.c | 3 +- hw/char/serial-isa.c | 2 +- hw/char/serial-pci.c | 8 +- hw/char/serial.c | 6 +- hw/char/spapr_vty.c | 3 +- hw/core/ptimer.c | 3 +- hw/display/ads7846.c | 3 +- hw/display/cg3.c | 2 +- hw/display/cirrus_vga.c | 8 +- hw/display/exynos4210_fimd.c | 6 +- hw/display/g364fb.c | 7 +- hw/display/jazz_led.c | 1 - hw/display/milkymist-tmu2.c | 3 +- hw/display/milkymist-vgafb.c | 3 +- hw/display/pl110.c | 2 +- hw/display/pxa2xx_lcd.c | 8 +- hw/display/qxl.c | 8 +- hw/display/ssd0303.c | 3 +- hw/display/tcx.c | 3 +- hw/display/vga-pci.c | 5 +- hw/display/vga.c | 3 +- hw/display/vmware_vga.c | 10 +- hw/dma/i82374.c | 2 +- hw/dma/i8257.c | 8 +- hw/dma/pl080.c | 2 +- hw/dma/pl330.c | 25 +- hw/dma/pxa2xx_dma.c | 2 - hw/dma/sparc32_dma.c | 3 +- hw/dma/sun4m_iommu.c | 3 +- hw/gpio/max7310.c | 3 +- hw/gpio/pl061.c | 2 +- hw/gpio/zaurus.c | 3 +- hw/i2c/core.c | 6 +- hw/i2c/smbus_ich9.c | 1 - hw/i386/acpi-build.c | 3 +- hw/i386/kvm/clock.c | 1 - hw/i386/kvmvapic.c | 9 +- hw/i386/pc.c | 3 +- hw/ide/ahci.c | 6 +- hw/ide/core.c | 20 +- hw/ide/ich.c | 2 +- hw/ide/internal.h | 7 +- hw/ide/isa.c | 3 +- hw/ide/macio.c | 3 +- hw/ide/microdrive.c | 3 +- hw/ide/mmio.c | 3 +- hw/ide/pci.c | 15 +- hw/input/adb.c | 6 +- hw/input/hid.c | 2 +- hw/input/lm832x.c | 3 +- hw/input/milkymist-softusb.c | 3 +- hw/input/pckbd.c | 8 +- hw/input/ps2.c | 18 +- hw/input/pxa2xx_keypad.c | 3 +- hw/input/stellaris_input.c | 8 +- hw/input/vmmouse.c | 3 +- hw/intc/allwinner-a10-pic.c | 1 - hw/intc/arm_gic_common.c | 2 +- hw/intc/armv7m_nvic.c | 3 +- hw/intc/exynos4210_combiner.c | 4 +- hw/intc/exynos4210_gic.c | 3 +- hw/intc/heathrow_pic.c | 8 +- hw/intc/i8259_common.c | 1 - hw/intc/imx_avic.c | 1 - hw/intc/ioapic_common.c | 6 +- hw/intc/lm32_pic.c | 3 +- hw/intc/slavio_intctl.c | 8 +- hw/intc/xics.c | 9 +- hw/ipack/ipack.c | 3 +- hw/ipack/tpci200.c | 3 +- hw/isa/apm.c | 1 - hw/isa/lpc_ich9.c | 5 +- hw/isa/piix4.c | 3 +- hw/isa/vt82c686.c | 8 +- hw/misc/arm_sysctl.c | 18 +- hw/misc/eccmemctl.c | 3 +- hw/misc/exynos4210_pmu.c | 2 +- hw/misc/imx_ccm.c | 1 - hw/misc/lm32_sys.c | 3 +- hw/misc/macio/cuda.c | 8 +- hw/misc/macio/mac_dbdma.c | 8 +- hw/misc/max111x.c | 3 +- hw/misc/milkymist-hpdmc.c | 3 +- hw/misc/milkymist-pfpu.c | 3 +- hw/misc/mst_fpga.c | 11 +- hw/misc/slavio_misc.c | 3 +- hw/misc/tmp105.c | 3 +- hw/misc/zynq_slcr.c | 3 +- hw/net/allwinner_emac.c | 4 +- hw/net/cadence_gem.c | 3 +- hw/net/e1000.c | 6 +- hw/net/eepro100.c | 3 +- hw/net/lan9118.c | 20 +- hw/net/lance.c | 5 +- hw/net/milkymist-minimac2.c | 8 +- hw/net/mipsnet.c | 3 +- hw/net/ne2000-isa.c | 5 +- hw/net/ne2000.c | 10 +- hw/net/pcnet-pci.c | 5 +- hw/net/pcnet.c | 3 +- hw/net/rtl8139.c | 13 +- hw/net/smc91c111.c | 4 +- hw/net/spapr_llan.c | 3 +- hw/net/vmxnet3.c | 13 +- hw/net/xgmac.c | 4 +- hw/nvram/ds1225y.c | 3 +- hw/nvram/eeprom93xx.c | 14 +- hw/nvram/fw_cfg.c | 7 +- hw/nvram/mac_nvram.c | 5 +- hw/pci-bridge/ioh3420.c | 3 +- hw/pci-bridge/xio3130_downstream.c | 3 +- hw/pci-bridge/xio3130_upstream.c | 3 +- hw/pci-host/bonito.c | 3 +- hw/pci-host/piix.c | 11 +- hw/pci-host/ppce500.c | 13 +- hw/pci-host/q35.c | 3 +- hw/pci/msix.c | 10 +- hw/pci/pci.c | 26 +- hw/pci/pcie_aer.c | 6 +- hw/ppc/ppc4xx_pci.c | 19 +- hw/ppc/spapr.c | 3 +- hw/ppc/spapr_iommu.c | 6 +- hw/ppc/spapr_pci.c | 13 +- hw/ppc/spapr_vio.c | 3 +- hw/s390x/event-facility.c | 3 +- hw/s390x/sclpquiesce.c | 3 +- hw/scsi/esp-pci.c | 5 +- hw/scsi/esp.c | 6 +- hw/scsi/lsi53c895a.c | 7 +- hw/scsi/megasas.c | 3 +- hw/scsi/scsi-bus.c | 14 +- hw/scsi/scsi-disk.c | 1 - hw/scsi/spapr_vscsi.c | 6 +- hw/scsi/vmw_pvscsi.c | 3 +- hw/sd/milkymist-memcard.c | 3 +- hw/sd/sd.c | 4 +- hw/sd/sdhci.c | 4 +- hw/ssi/pl022.c | 3 +- hw/ssi/ssi.c | 3 +- hw/ssi/xilinx_spi.c | 1 - hw/ssi/xilinx_spips.c | 1 - hw/timer/a9gtimer.c | 2 +- hw/timer/allwinner-a10-pit.c | 1 - hw/timer/arm_mptimer.c | 2 +- hw/timer/arm_timer.c | 6 +- hw/timer/cadence_ttc.c | 5 +- hw/timer/digic-timer.c | 1 - hw/timer/ds1338.c | 3 +- hw/timer/exynos4210_mct.c | 19 +- hw/timer/exynos4210_pwm.c | 6 +- hw/timer/exynos4210_rtc.c | 1 - hw/timer/hpet.c | 13 +- hw/timer/i8254_common.c | 9 +- hw/timer/imx_epit.c | 3 +- hw/timer/imx_gpt.c | 3 +- hw/timer/lm32_timer.c | 3 +- hw/timer/m48t59.c | 5 +- hw/timer/mc146818rtc.c | 17 +- hw/timer/milkymist-sysctl.c | 3 +- hw/timer/pxa2xx_timer.c | 13 +- hw/timer/slavio_timer.c | 8 +- hw/timer/twl92230.c | 14 +- hw/usb/bus.c | 2 +- hw/usb/dev-hid.c | 4 +- hw/usb/dev-hub.c | 6 +- hw/usb/dev-smartcard-reader.c | 6 +- hw/usb/dev-storage.c | 2 +- hw/usb/hcd-ehci-pci.c | 5 +- hw/usb/hcd-ehci-sysbus.c | 5 +- hw/usb/hcd-ehci.c | 6 +- hw/usb/hcd-uhci.c | 12 +- hw/usb/hcd-xhci.c | 10 +- hw/usb/redirect.c | 40 +- hw/watchdog/wdt_i6300esb.c | 14 +- hw/watchdog/wdt_ib700.c | 3 +- hw/xen/xen_platform.c | 3 +- include/hw/acpi/pcihp.h | 2 +- include/hw/hw.h | 31 +- include/hw/ipack/ipack.h | 2 +- include/hw/pci/shpc.h | 2 +- include/hw/ppc/spapr_vio.h | 2 +- include/hw/ptimer.h | 4 +- include/migration/vmstate.h | 475 ++++++-------- target-alpha/machine.c | 20 +- target-arm/machine.c | 29 +- target-i386/machine.c | 155 ++--- target-lm32/machine.c | 8 +- target-moxie/machine.c | 3 +- target-openrisc/machine.c | 4 +- target-ppc/machine.c | 52 +- tests/test-vmstate.c | 1220 +++++++++++++++++++++++++++++++++--- util/fifo8.c | 5 +- vmstate.c | 116 ++-- 238 files changed, 2035 insertions(+), 1432 deletions(-)
PATCH 1/97 savevm: Ignore minimum_version_id_old if there is no load_state_old
From: Peter Maydell <[email protected]>
At the moment we require vmstate definitions to set minimum_version_id_old to the same value as minimum_version_id if they do not provide a load_state_old handler. Since the load_state_old functionality is required only for a handful of devices that need to retain migration compatibility with a pre-vmstate implementation, this means the bulk of devices have pointless boilerplate. Relax the definition so that minimum_version_id_old is ignored if there is no load_state_old handler.
Note that under the old scheme we would segfault if the vmstate specified a minimum_version_id_old that was less than minimum_version_id but did not provide a load_state_old function, and the incoming state specified a version number between minimum_version_id_old and minimum_version_id. Under the new scheme this will just result in our failing the migration.
--- docs/migration.txt | 12 +++++------- vmstate.c | 9 +++++---- 2 files changed, 10 insertions(+), 11 deletions(-)
docs/migration.txt +5 -7
@@ -139,7 +139,6 @@ static const VMStateDescription vmstate_kbd = { .name = "pckbd", .version_id = 3, .minimum_version_id = 3, - .minimum_version_id_old = 3, .fields = (VMStateField []) { VMSTATE_UINT8(write_cmd, KBDState), VMSTATE_UINT8(status, KBDState),
@@ -168,12 +167,13 @@ You can see that there are several version fields: - minimum_version_id: the minimum version_id that VMState is able to understand for that device. - minimum_version_id_old: For devices that were not able to port to vmstate, we can - assign a function that knows how to read this old state. + assign a function that knows how to read this old state. This field is + ignored if there is no load_state_old handler. So, VMState is able to read versions from minimum_version_id to -version_id. And the function load_state_old() is able to load state -from minimum_version_id_old to minimum_version_id. This function is -deprecated and will be removed when no more users are left. +version_id. And the function load_state_old() (if present) is able to +load state from minimum_version_id_old to minimum_version_id. This +function is deprecated and will be removed when no more users are left. === Massaging functions ===
@@ -255,7 +255,6 @@ const VMStateDescription vmstate_ide_drive_pio_state = { .name = "ide_drive/pio_state", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .pre_save = ide_drive_pio_pre_save, .post_load = ide_drive_pio_post_load, .fields = (VMStateField []) {
@@ -275,7 +274,6 @@ const VMStateDescription vmstate_ide_drive = { .name = "ide_drive", .version_id = 3, .minimum_version_id = 0, - .minimum_version_id_old = 0, .post_load = ide_drive_post_load, .fields = (VMStateField []) { .... several fields ....
vmstate.c +5 -4
@@ -19,11 +19,12 @@ int vmstate_load_state(QEMUFile *f, const VMStateDescription *vmsd,if (version_id > vmsd->version_id) {return -EINVAL ; } -if (version_id < vmsd->minimum_version_id_old) { -return -EINVAL ; - }if (version_id < vmsd->minimum_version_id) { -return vmsd->load_state_old (f, opaque, version_id); +if (vmsd->load_state_old && + version_id >= vmsd->minimum_version_id_old) { +return vmsd->load_state_old (f, opaque, version_id); + } +return -EINVAL ; }if (vmsd->pre_load) {int ret = vmsd->pre_load (opaque);
Signature · 1 line
1.9.0
PATCH 2/97 savevm: Remove all the unneded version_minimum_id_old (Massive)
In reply to Juan QuintelaAfter previous Peter patch, they are redundant. This way we don't asign 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 of aesthetics) was that checkpatch complained when we copy&pasted the code from one place to another.
--- audio/audio.c | 3 +- cpus.c | 3 +- docs/migration.txt | 6 ++-- exec.c | 3 +- hw/acpi/ich9.c | 1 - hw/acpi/pcihp.c | 3 +- hw/acpi/piix4.c | 8 ++---- hw/arm/highbank.c | 1 - hw/arm/musicpal.c | 8 ------ hw/arm/pxa2xx.c | 19 ++++--------- hw/arm/pxa2xx_gpio.c | 3 +- hw/arm/pxa2xx_pic.c | 1 - hw/arm/spitz.c | 12 +++----- hw/arm/stellaris.c | 12 +++----- hw/arm/strongarm.c | 6 ---- hw/arm/z2.c | 2 -- 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/lm4549.c | 5 ++-- hw/audio/marvell_88w8618.c | 1 - hw/audio/milkymist-ac97.c | 3 +- hw/audio/pl041.c | 9 ++---- hw/audio/sb16.c | 3 +- hw/audio/wm8750.c | 3 +- hw/block/ecc.c | 3 +- hw/block/fdc.c | 16 ++++------- hw/block/m25p80.c | 1 - hw/block/nand.c | 3 +- hw/block/onenand.c | 1 - hw/char/cadence_uart.c | 1 - hw/char/digic-uart.c | 1 - hw/char/escc.c | 6 ++-- hw/char/exynos4210_uart.c | 2 -- hw/char/imx_serial.c | 1 - hw/char/ipoctal232.c | 9 ++---- hw/char/lm32_juart.c | 3 +- hw/char/lm32_uart.c | 3 +- hw/char/milkymist-uart.c | 3 +- hw/char/pl011.c | 3 +- hw/char/sclpconsole-lm.c | 3 +- hw/char/sclpconsole.c | 3 +- hw/char/serial-pci.c | 4 +-- hw/char/serial.c | 2 +- hw/char/spapr_vty.c | 3 +- hw/core/ptimer.c | 3 +- hw/display/ads7846.c | 3 +- hw/display/cg3.c | 2 +- hw/display/cirrus_vga.c | 6 ++-- hw/display/exynos4210_fimd.c | 4 +-- hw/display/g364fb.c | 1 - hw/display/jazz_led.c | 1 - hw/display/milkymist-tmu2.c | 3 +- hw/display/milkymist-vgafb.c | 3 +- hw/display/pxa2xx_lcd.c | 6 ++-- hw/display/ssd0303.c | 3 +- hw/display/tcx.c | 3 +- hw/display/vga-pci.c | 3 +- hw/display/vga.c | 3 +- hw/display/vmware_vga.c | 6 ++-- hw/dma/i8257.c | 6 ++-- hw/dma/pl330.c | 5 ---- hw/dma/pxa2xx_dma.c | 2 -- hw/dma/sparc32_dma.c | 3 +- hw/dma/sun4m_iommu.c | 3 +- hw/gpio/max7310.c | 3 +- hw/gpio/zaurus.c | 3 +- hw/i2c/core.c | 6 ++-- hw/i2c/smbus_ich9.c | 1 - hw/i386/acpi-build.c | 3 +- hw/i386/kvm/clock.c | 1 - hw/i386/kvmvapic.c | 3 -- hw/i386/pc.c | 3 +- hw/ide/ahci.c | 6 ++-- hw/ide/core.c | 16 ++++------- hw/ide/ich.c | 2 +- hw/ide/isa.c | 3 +- hw/ide/macio.c | 3 +- hw/ide/microdrive.c | 3 +- hw/ide/mmio.c | 3 +- hw/ide/pci.c | 12 +++----- hw/input/adb.c | 6 ++-- hw/input/lm832x.c | 3 +- hw/input/milkymist-softusb.c | 3 +- hw/input/pckbd.c | 6 ++-- hw/input/ps2.c | 12 +++----- hw/input/pxa2xx_keypad.c | 3 +- hw/input/stellaris_input.c | 6 ++-- hw/input/vmmouse.c | 3 +- hw/intc/allwinner-a10-pic.c | 1 - hw/intc/armv7m_nvic.c | 3 +- hw/intc/exynos4210_combiner.c | 2 -- hw/intc/exynos4210_gic.c | 1 - hw/intc/heathrow_pic.c | 6 ++-- hw/intc/i8259_common.c | 1 - hw/intc/imx_avic.c | 1 - hw/intc/ioapic_common.c | 1 - hw/intc/lm32_pic.c | 3 +- hw/intc/slavio_intctl.c | 6 ++-- hw/intc/xics.c | 9 ++---- hw/ipack/ipack.c | 3 +- hw/ipack/tpci200.c | 3 +- hw/isa/apm.c | 1 - hw/isa/lpc_ich9.c | 1 - hw/isa/piix4.c | 3 +- hw/isa/vt82c686.c | 6 ++-- hw/misc/eccmemctl.c | 3 +- hw/misc/exynos4210_pmu.c | 2 +- hw/misc/imx_ccm.c | 1 - hw/misc/lm32_sys.c | 3 +- hw/misc/macio/cuda.c | 6 ++-- hw/misc/macio/mac_dbdma.c | 6 ++-- hw/misc/max111x.c | 3 +- hw/misc/milkymist-hpdmc.c | 3 +- hw/misc/milkymist-pfpu.c | 3 +- hw/misc/mst_fpga.c | 11 ++++---- hw/misc/slavio_misc.c | 3 +- hw/misc/tmp105.c | 3 +- hw/misc/zynq_slcr.c | 3 +- hw/net/cadence_gem.c | 3 +- hw/net/e1000.c | 6 ++-- hw/net/eepro100.c | 3 +- hw/net/lance.c | 3 +- hw/net/milkymist-minimac2.c | 6 ++-- hw/net/mipsnet.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/smc91c111.c | 2 +- hw/net/spapr_llan.c | 3 +- hw/net/vmxnet3.c | 4 +-- hw/net/xgmac.c | 2 +- hw/nvram/ds1225y.c | 1 - hw/nvram/eeprom93xx.c | 3 +- hw/nvram/fw_cfg.c | 3 +- hw/nvram/mac_nvram.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/bonito.c | 3 +- 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/s390x/event-facility.c | 3 +- hw/s390x/sclpquiesce.c | 3 +- hw/scsi/esp-pci.c | 1 - hw/scsi/esp.c | 4 +-- 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/sd/milkymist-memcard.c | 3 +- hw/sd/sdhci.c | 2 +- hw/ssi/pl022.c | 3 +- hw/ssi/ssi.c | 3 +- hw/ssi/xilinx_spi.c | 1 - hw/ssi/xilinx_spips.c | 1 - hw/timer/allwinner-a10-pit.c | 1 - hw/timer/arm_timer.c | 6 ++-- hw/timer/cadence_ttc.c | 2 -- hw/timer/digic-timer.c | 1 - hw/timer/ds1338.c | 1 - hw/timer/exynos4210_mct.c | 6 ---- hw/timer/exynos4210_pwm.c | 2 -- hw/timer/exynos4210_rtc.c | 1 - hw/timer/hpet.c | 9 ++---- hw/timer/i8254_common.c | 1 - hw/timer/imx_epit.c | 3 +- hw/timer/imx_gpt.c | 3 +- hw/timer/lm32_timer.c | 3 +- hw/timer/m48t59.c | 3 +- hw/timer/mc146818rtc.c | 3 +- hw/timer/milkymist-sysctl.c | 3 +- hw/timer/pxa2xx_timer.c | 3 -- hw/timer/slavio_timer.c | 6 ++-- hw/timer/twl92230.c | 6 ++-- hw/usb/bus.c | 2 +- hw/usb/dev-hid.c | 4 +-- hw/usb/dev-hub.c | 4 +-- hw/usb/dev-storage.c | 2 +- hw/usb/hcd-ehci-pci.c | 2 +- hw/usb/hcd-ehci-sysbus.c | 2 +- hw/usb/hcd-ehci.c | 2 +- hw/usb/hcd-uhci.c | 6 ++-- hw/watchdog/wdt_i6300esb.c | 14 +++++----- hw/watchdog/wdt_ib700.c | 3 +- hw/xen/xen_platform.c | 3 +- target-alpha/machine.c | 2 -- target-arm/machine.c | 5 ---- target-i386/machine.c | 57 +++++++++++++------------------------- target-lm32/machine.c | 6 ++-- target-moxie/machine.c | 3 +- target-openrisc/machine.c | 2 -- target-ppc/machine.c | 38 +++++++++---------------- tests/test-vmstate.c | 9 ++---- util/fifo8.c | 3 +- 211 files changed, 289 insertions(+), 621 deletions(-)
audio/audio.c +1 -2
@@ -1812,8 +1812,7 @@ static const VMStateDescription vmstate_audio = { .name = "audio", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_END_OF_LIST () } };
cpus.c +1 -2
@@ -430,8 +430,7 @@ static const VMStateDescription vmstate_timers = { .name = "timer", .version_id = 2, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_INT64 (cpu_ticks_offset, TimersState),VMSTATE_INT64 (dummy, TimersState),VMSTATE_INT64_V (cpu_clock_offset, TimersState,2 ),
docs/migration.txt +3 -3
@@ -139,7 +139,7 @@ static const VMStateDescription vmstate_kbd = { .name = "pckbd", .version_id = 3, .minimum_version_id = 3, - .fields = (VMStateField []) { + .fields = (VMStateField[]) { VMSTATE_UINT8(write_cmd, KBDState), VMSTATE_UINT8(status, KBDState), VMSTATE_UINT8(mode, KBDState),
@@ -257,7 +257,7 @@ const VMStateDescription vmstate_ide_drive_pio_state = { .minimum_version_id = 1, .pre_save = ide_drive_pio_pre_save, .post_load = ide_drive_pio_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField[]) { VMSTATE_INT32(req_nb_sectors, IDEState), VMSTATE_VARRAY_INT32(io_buffer, IDEState, io_buffer_total_len, 1, vmstate_info_uint8, uint8_t),
@@ -275,7 +275,7 @@ const VMStateDescription vmstate_ide_drive = { .version_id = 3, .minimum_version_id = 0, .post_load = ide_drive_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField[]) { .... several fields .... VMSTATE_END_OF_LIST() },
exec.c +1 -2
@@ -429,9 +429,8 @@ const VMStateDescription vmstate_cpu_common = { .name = "cpu_common", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .post_load = cpu_common_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT32 (halted, CPUState),VMSTATE_UINT32 (interrupt_request, CPUState),VMSTATE_END_OF_LIST ()
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
@@ -322,8 +322,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/arm/highbank.c +0 -1
@@ -134,7 +134,6 @@ static VMStateDescription vmstate_highbank_regs = { .name = "highbank-regs", .version_id = 0, .minimum_version_id = 0, - .minimum_version_id_old = 0, .fields = (VMStateField []) {VMSTATE_UINT32_ARRAY (regs, HighbankRegsState,NUM_REGS ),VMSTATE_END_OF_LIST (),
hw/arm/musicpal.c +0 -8
@@ -405,7 +405,6 @@ static const VMStateDescription mv88w8618_eth_vmsd = { .name = "mv88w8618_eth", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .fields = (VMStateField []) {VMSTATE_UINT32 (smir, mv88w8618_eth_state),VMSTATE_UINT32 (icr, mv88w8618_eth_state),
@@ -642,7 +641,6 @@ static const VMStateDescription musicpal_lcd_vmsd = { .name = "musicpal_lcd", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .fields = (VMStateField []) {VMSTATE_UINT32 (brightness, musicpal_lcd_state),VMSTATE_UINT32 (mode, musicpal_lcd_state),
@@ -769,7 +767,6 @@ static const VMStateDescription mv88w8618_pic_vmsd = { .name = "mv88w8618_pic", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .fields = (VMStateField []) {VMSTATE_UINT32 (level, mv88w8618_pic_state),VMSTATE_UINT32 (enabled, mv88w8618_pic_state),
@@ -940,7 +937,6 @@ static const VMStateDescription mv88w8618_timer_vmsd = { .name = "timer", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .fields = (VMStateField []) {VMSTATE_PTIMER (ptimer, mv88w8618_timer_state),VMSTATE_UINT32 (limit, mv88w8618_timer_state),
@@ -952,7 +948,6 @@ static const VMStateDescription mv88w8618_pit_vmsd = { .name = "mv88w8618_pit", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .fields = (VMStateField []) {VMSTATE_STRUCT_ARRAY (timer, mv88w8618_pit_state,4 ,1 , mv88w8618_timer_vmsd, mv88w8618_timer_state),
@@ -1041,7 +1036,6 @@ static const VMStateDescription mv88w8618_flashcfg_vmsd = { .name = "mv88w8618_flashcfg", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .fields = (VMStateField []) {VMSTATE_UINT32 (cfgr0, mv88w8618_flashcfg_state),VMSTATE_END_OF_LIST ()
@@ -1381,7 +1375,6 @@ static const VMStateDescription musicpal_gpio_vmsd = { .name = "musicpal_gpio", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .fields = (VMStateField []) {VMSTATE_UINT32 (lcd_brightness, musicpal_gpio_state),VMSTATE_UINT32 (out_state, musicpal_gpio_state),
@@ -1548,7 +1541,6 @@ static const VMStateDescription musicpal_key_vmsd = { .name = "musicpal_key", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .fields = (VMStateField []) {VMSTATE_UINT32 (kbd_extended, musicpal_key_state),VMSTATE_UINT32 (pressed_keys, musicpal_key_state),
hw/arm/pxa2xx.c +6 -13
@@ -148,8 +148,7 @@ static const VMStateDescription vmstate_pxa2xx_pm = { .name = "pxa2xx_pm", .version_id = 0, .minimum_version_id =0 , - .minimum_version_id_old =0 , - .fields = (VMStateField[]) { + .fields = (VMStateField[]) {VMSTATE_UINT32_ARRAY (pm_regs, PXA2xxState,0x40 ),VMSTATE_END_OF_LIST () }
@@ -215,8 +214,7 @@ static const VMStateDescription vmstate_pxa2xx_cm = { .name = "pxa2xx_cm", .version_id = 0, .minimum_version_id = 0, - .minimum_version_id_old = 0, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT32_ARRAY (cm_regs, PXA2xxState,4 ),VMSTATE_UINT32 (clkcfg, PXA2xxState),VMSTATE_UINT32 (pmnc, PXA2xxState),
@@ -440,8 +438,7 @@ static const VMStateDescription vmstate_pxa2xx_mm = { .name = "pxa2xx_mm", .version_id = 0, .minimum_version_id =0 , - .minimum_version_id_old =0 , - .fields = (VMStateField[]) { + .fields = (VMStateField[]) {VMSTATE_UINT32_ARRAY (mm_regs, PXA2xxState,0x1a ),VMSTATE_END_OF_LIST () }
@@ -1168,7 +1165,6 @@ static const VMStateDescription vmstate_pxa2xx_rtc_regs = { .name = "pxa2xx_rtc", .version_id = 0, .minimum_version_id = 0, - .minimum_version_id_old = 0, .pre_save = pxa2xx_rtc_pre_save, .post_load = pxa2xx_rtc_post_load, .fields = (VMStateField []) {
@@ -1432,8 +1428,7 @@ static const VMStateDescription vmstate_pxa2xx_i2c_slave = { .name = "pxa2xx_i2c_slave", .version_id = 1, .minimum_version_id =1 , - .minimum_version_id_old =1 , - .fields = (VMStateField []) { + .fields = (VMStateField[]) {VMSTATE_I2C_SLAVE (parent_obj, PXA2xxI2CSlaveState),VMSTATE_END_OF_LIST () }
@@ -1443,8 +1438,7 @@ static const VMStateDescription vmstate_pxa2xx_i2c = { .name = "pxa2xx_i2c", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT16 (control, PXA2xxI2CState),VMSTATE_UINT16 (status, PXA2xxI2CState),VMSTATE_UINT8 (ibmr, PXA2xxI2CState),
@@ -1701,8 +1695,7 @@ static const VMStateDescription vmstate_pxa2xx_i2s = { .name = "pxa2xx_i2s", .version_id = 0, .minimum_version_id = 0, - .minimum_version_id_old = 0, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT32_ARRAY (control, PXA2xxI2SState,2 ),VMSTATE_UINT32 (status, PXA2xxI2SState),VMSTATE_UINT32 (mask, PXA2xxI2SState),
hw/arm/pxa2xx_gpio.c +1 -2
@@ -313,8 +313,7 @@ static const VMStateDescription vmstate_pxa2xx_gpio_regs = { .name = "pxa2xx-gpio", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_INT32 (lines, PXA2xxGPIOInfo),VMSTATE_UINT32_ARRAY (ilevel, PXA2xxGPIOInfo,PXA2XX_GPIO_BANKS ),VMSTATE_UINT32_ARRAY (olevel, PXA2xxGPIOInfo,PXA2XX_GPIO_BANKS ),
hw/arm/pxa2xx_pic.c +0 -1
@@ -296,7 +296,6 @@ static VMStateDescription vmstate_pxa2xx_pic_regs = { .name = "pxa2xx_pic", .version_id = 0, .minimum_version_id = 0, - .minimum_version_id_old = 0, .post_load = pxa2xx_pic_post_load, .fields = (VMStateField []) {VMSTATE_UINT32_ARRAY (int_enabled, PXA2xxPICState,2 ),
hw/arm/spitz.c +4 -8
@@ -1006,8 +1006,7 @@ static VMStateDescription vmstate_sl_nand_info = { .name = "sl-nand", .version_id = 0, .minimum_version_id = 0, - .minimum_version_id_old = 0, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT8 (ctl, SLNANDState),VMSTATE_STRUCT (ecc, SLNANDState,0 , vmstate_ecc_state, ECCState),VMSTATE_END_OF_LIST (),
@@ -1041,9 +1040,8 @@ static VMStateDescription vmstate_spitz_kbd = { .name = "spitz-keyboard", .version_id = 1, .minimum_version_id = 0, - .minimum_version_id_old = 0, .post_load = spitz_keyboard_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT16 (sense_state, SpitzKeyboardState),VMSTATE_UINT16 (strobe_state, SpitzKeyboardState),VMSTATE_UNUSED_TEST (is_version_0,5 ),
@@ -1076,8 +1074,7 @@ static const VMStateDescription vmstate_corgi_ssp_regs = { .name = "corgi-ssp", .version_id = 2, .minimum_version_id = 2, - .minimum_version_id_old = 2, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_SSI_SLAVE (ssidev, CorgiSSPState),VMSTATE_UINT32_ARRAY (enable, CorgiSSPState,3 ),VMSTATE_END_OF_LIST (),
@@ -1105,8 +1102,7 @@ static const VMStateDescription vmstate_spitz_lcdtg_regs = { .name = "spitz-lcdtg", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_SSI_SLAVE (ssidev, SpitzLCDTG),VMSTATE_UINT32 (bl_intensity, SpitzLCDTG),VMSTATE_UINT32 (bl_power, SpitzLCDTG),
hw/arm/stellaris.c +4 -8
@@ -286,8 +286,7 @@ static const VMStateDescription vmstate_stellaris_gptm = { .name = "stellaris_gptm", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT32 (config, gptm_state),VMSTATE_UINT32_ARRAY (mode, gptm_state,2 ),VMSTATE_UINT32 (control, gptm_state),
@@ -643,9 +642,8 @@ static const VMStateDescription vmstate_stellaris_sys = { .name = "stellaris_sys", .version_id = 2, .minimum_version_id = 1, - .minimum_version_id_old = 1, .post_load = stellaris_sys_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT32 (pborctl, ssys_state),VMSTATE_UINT32 (ldopctl, ssys_state),VMSTATE_UINT32 (int_mask, ssys_state),
@@ -851,8 +849,7 @@ static const VMStateDescription vmstate_stellaris_i2c = { .name = "stellaris_i2c", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT32 (msa, stellaris_i2c_state),VMSTATE_UINT32 (mcs, stellaris_i2c_state),VMSTATE_UINT32 (mdr, stellaris_i2c_state),
@@ -1121,8 +1118,7 @@ static const VMStateDescription vmstate_stellaris_adc = { .name = "stellaris_adc", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT32 (actss, stellaris_adc_state),VMSTATE_UINT32 (ris, stellaris_adc_state),VMSTATE_UINT32 (im, stellaris_adc_state),
hw/arm/strongarm.c +0 -6
@@ -199,7 +199,6 @@ static VMStateDescription vmstate_strongarm_pic_regs = { .name = "strongarm_pic", .version_id = 0, .minimum_version_id = 0, - .minimum_version_id_old = 0, .post_load = strongarm_pic_post_load, .fields = (VMStateField []) {VMSTATE_UINT32 (pending, StrongARMPICState),
@@ -424,7 +423,6 @@ static const VMStateDescription vmstate_strongarm_rtc_regs = { .name = "strongarm-rtc", .version_id = 0, .minimum_version_id = 0, - .minimum_version_id_old = 0, .pre_save = strongarm_rtc_pre_save, .post_load = strongarm_rtc_post_load, .fields = (VMStateField []) {
@@ -670,7 +668,6 @@ static const VMStateDescription vmstate_strongarm_gpio_regs = { .name = "strongarm-gpio", .version_id = 0, .minimum_version_id = 0, - .minimum_version_id_old = 0, .fields = (VMStateField []) {VMSTATE_UINT32 (ilevel, StrongARMGPIOInfo),VMSTATE_UINT32 (olevel, StrongARMGPIOInfo),
@@ -842,7 +839,6 @@ static const VMStateDescription vmstate_strongarm_ppc_regs = { .name = "strongarm-ppc", .version_id = 0, .minimum_version_id = 0, - .minimum_version_id_old = 0, .fields = (VMStateField []) {VMSTATE_UINT32 (ilevel, StrongARMPPCInfo),VMSTATE_UINT32 (olevel, StrongARMPPCInfo),
@@ -1293,7 +1289,6 @@ static const VMStateDescription vmstate_strongarm_uart_regs = { .name = "strongarm-uart", .version_id = 0, .minimum_version_id = 0, - .minimum_version_id_old = 0, .post_load = strongarm_uart_post_load, .fields = (VMStateField []) {VMSTATE_UINT8 (utcr0, StrongARMUARTState),
@@ -1553,7 +1548,6 @@ static const VMStateDescription vmstate_strongarm_ssp_regs = { .name = "strongarm-ssp", .version_id = 0, .minimum_version_id = 0, - .minimum_version_id_old = 0, .post_load = strongarm_ssp_post_load, .fields = (VMStateField []) {VMSTATE_UINT16_ARRAY (sscr, StrongARMSSPState,2 ),
hw/arm/z2.c +0 -2
@@ -164,7 +164,6 @@ static VMStateDescription vmstate_zipit_lcd_state = { .name = "zipit-lcd", .version_id = 2, .minimum_version_id = 2, - .minimum_version_id_old = 2, .fields = (VMStateField []) {VMSTATE_SSI_SLAVE (ssidev, ZipitLCD),VMSTATE_INT32 (selected, ZipitLCD),
@@ -275,7 +274,6 @@ static VMStateDescription vmstate_aer915_state = { .name = "aer915", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .fields = (VMStateField []) {VMSTATE_INT32 (len, AER915State),VMSTATE_BUFFER (buf, AER915State),
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
@@ -580,7 +580,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),
@@ -598,7 +598,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
@@ -1175,7 +1175,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),
@@ -1191,7 +1191,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/lm4549.c +2 -3
@@ -324,9 +324,8 @@ const VMStateDescription vmstate_lm4549_state = { .name = "lm4549_state", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .post_load = &lm4549_post_load, - .fields = (VMStateField []) { + .post_load = lm4549_post_load, + .fields = (VMStateField []) {VMSTATE_UINT32 (voice_is_active, lm4549_state),VMSTATE_UINT16_ARRAY (regfile, lm4549_state,128 ),VMSTATE_UINT16_ARRAY (buffer, lm4549_state,LM4549_BUFFER_SIZE ),
hw/audio/marvell_88w8618.c +0 -1
@@ -259,7 +259,6 @@ static const VMStateDescription mv88w8618_audio_vmsd = { .name = "mv88w8618_audio", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .fields = (VMStateField []) {VMSTATE_UINT32 (playback_mode, mv88w8618_audio_state),VMSTATE_UINT32 (status, mv88w8618_audio_state),
hw/audio/milkymist-ac97.c +1 -2
@@ -316,9 +316,8 @@ static const VMStateDescription vmstate_milkymist_ac97 = { .name = "milkymist-ac97", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .post_load = ac97_post_load, - .fields = (VMStateField[]) { + .fields = (VMStateField[]) {VMSTATE_UINT32_ARRAY (regs, MilkymistAC97State,R_MAX ),VMSTATE_END_OF_LIST () }
hw/audio/pl041.c +3 -6
@@ -561,8 +561,7 @@ static const VMStateDescription vmstate_pl041_regfile = { .name = "pl041_regfile", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField[]) {#define REGISTER (name, offset) VMSTATE_UINT32(name, pl041_regfile),#include "pl041.hx" #undef REGISTER
@@ -574,8 +573,7 @@ static const VMStateDescription vmstate_pl041_fifo = { .name = "pl041_fifo", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT32 (level, pl041_fifo),VMSTATE_UINT32_ARRAY (data, pl041_fifo,MAX_FIFO_DEPTH ),VMSTATE_END_OF_LIST ()
@@ -586,8 +584,7 @@ static const VMStateDescription vmstate_pl041_channel = { .name = "pl041_channel", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_STRUCT (tx_fifo, pl041_channel,0 , vmstate_pl041_fifo, pl041_fifo),VMSTATE_UINT8 (tx_enabled, pl041_channel),
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/audio/wm8750.c +1 -2
@@ -583,10 +583,9 @@ static const VMStateDescription vmstate_wm8750 = { .name = CODEC, .version_id = 0, .minimum_version_id = 0, - .minimum_version_id_old = 0, .pre_save = wm8750_pre_save, .post_load = wm8750_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT8_ARRAY (i2c_data, WM8750State,2 ),VMSTATE_INT32 (i2c_len, WM8750State),VMSTATE_INT32 (enable, WM8750State),
hw/block/ecc.c +1 -2
@@ -81,8 +81,7 @@ VMStateDescription vmstate_ecc_state = { .name = "ecc-state", .version_id = 0, .minimum_version_id = 0, - .minimum_version_id_old = 0, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT8 (cp, ECCState),VMSTATE_UINT16_ARRAY (lp, ECCState,2 ),VMSTATE_UINT16 (count, ECCState),
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/block/m25p80.c +0 -1
@@ -653,7 +653,6 @@ static const VMStateDescription vmstate_m25p80 = { .name = "xilinx_spi", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .pre_save = m25p80_pre_save, .fields = (VMStateField []) {VMSTATE_UINT8 (state, Flash),
hw/block/nand.c +1 -2
@@ -346,10 +346,9 @@ static const VMStateDescription vmstate_nand = { .name = "nand", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .pre_save = nand_pre_save, .post_load = nand_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT8 (cle, NANDFlashState),VMSTATE_UINT8 (ale, NANDFlashState),VMSTATE_UINT8 (ce, NANDFlashState),
hw/block/onenand.c +0 -1
@@ -169,7 +169,6 @@ static const VMStateDescription vmstate_onenand = { .name = "onenand", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .pre_save = onenand_pre_save, .post_load = onenand_post_load, .fields = (VMStateField []) {
hw/char/cadence_uart.c +0 -1
@@ -504,7 +504,6 @@ static const VMStateDescription vmstate_cadence_uart = { .name = "cadence_uart", .version_id = 2, .minimum_version_id = 2, - .minimum_version_id_old = 2, .post_load = cadence_uart_post_load, .fields = (VMStateField []) {VMSTATE_UINT32_ARRAY (r, UartState,R_MAX ),
hw/char/digic-uart.c +0 -1
@@ -162,7 +162,6 @@ static const VMStateDescription vmstate_digic_uart = { .name = "digic-uart", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .fields = (VMStateField []) {VMSTATE_UINT32 (reg_rx, DigicUartState),VMSTATE_UINT32 (reg_st, DigicUartState),
hw/char/escc.c +2 -4
@@ -658,8 +658,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),
@@ -678,8 +677,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/exynos4210_uart.c +0 -2
@@ -560,7 +560,6 @@ static const VMStateDescription vmstate_exynos4210_uart_fifo = { .name = "exynos4210.uart.fifo", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .fields = (VMStateField []) {VMSTATE_UINT32 (sp, Exynos4210UartFIFO),VMSTATE_UINT32 (rp, Exynos4210UartFIFO),
@@ -573,7 +572,6 @@ static const VMStateDescription vmstate_exynos4210_uart = { .name = "exynos4210.uart", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .fields = (VMStateField []) {VMSTATE_STRUCT (rx, Exynos4210UartState,1 , vmstate_exynos4210_uart_fifo, Exynos4210UartFIFO),
hw/char/imx_serial.c +0 -1
@@ -76,7 +76,6 @@ static const VMStateDescription vmstate_imx_serial = { .name = "imx-serial", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .fields = (VMStateField []) {VMSTATE_INT32 (readbuff, IMXSerialState),VMSTATE_UINT32 (usr1, IMXSerialState),
hw/char/ipoctal232.c +3 -6
@@ -124,8 +124,7 @@ static const VMStateDescription vmstate_scc2698_channel = { .name = "scc2698_channel", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_BOOL (rx_enabled, SCC2698Channel),VMSTATE_UINT8_ARRAY (mr, SCC2698Channel,2 ),VMSTATE_UINT8 (mr_idx, SCC2698Channel),
@@ -141,8 +140,7 @@ static const VMStateDescription vmstate_scc2698_block = { .name = "scc2698_block", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT8 (imr, SCC2698Block),VMSTATE_UINT8 (isr, SCC2698Block),VMSTATE_END_OF_LIST ()
@@ -153,8 +151,7 @@ static const VMStateDescription vmstate_ipoctal = { .name = "ipoctal232", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_IPACK_DEVICE (parent_obj, IPOctalState),VMSTATE_STRUCT_ARRAY (ch, IPOctalState,N_CHANNELS ,1 , vmstate_scc2698_channel, SCC2698Channel),
hw/char/lm32_juart.c +1 -2
@@ -129,8 +129,7 @@ static const VMStateDescription vmstate_lm32_juart = { .name = "lm32-juart", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT32 (jtx, LM32JuartState),VMSTATE_UINT32 (jrx, LM32JuartState),VMSTATE_END_OF_LIST ()
hw/char/lm32_uart.c +1 -2
@@ -270,8 +270,7 @@ static const VMStateDescription vmstate_lm32_uart = { .name = "lm32-uart", .version_id = 1, .minimum_version_id =1 , - .minimum_version_id_old =1 , - .fields = (VMStateField[]) { + .fields = (VMStateField[]) {VMSTATE_UINT32_ARRAY (regs, LM32UartState,R_MAX ),VMSTATE_END_OF_LIST () }
hw/char/milkymist-uart.c +1 -2
@@ -221,8 +221,7 @@ static const VMStateDescription vmstate_milkymist_uart = { .name = "milkymist-uart", .version_id = 1, .minimum_version_id =1 , - .minimum_version_id_old =1 , - .fields = (VMStateField[]) { + .fields = (VMStateField[]) {VMSTATE_UINT32_ARRAY (regs, MilkymistUartState,R_MAX ),VMSTATE_END_OF_LIST () }
hw/char/pl011.c +1 -2
@@ -251,8 +251,7 @@ static const VMStateDescription vmstate_pl011 = { .name = "pl011", .version_id = 2, .minimum_version_id = 2, - .minimum_version_id_old = 2, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT32 (readbuff, PL011State),VMSTATE_UINT32 (flags, PL011State),VMSTATE_UINT32 (lcr, PL011State),
hw/char/sclpconsole-lm.c +1 -2
@@ -291,8 +291,7 @@ static const VMStateDescription vmstate_sclplmconsole = { .name = "sclplmconsole", .version_id = 0, .minimum_version_id = 0, - .minimum_version_id_old = 0, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_BOOL (event.event_pending, SCLPConsoleLM),VMSTATE_UINT32 (write_errors, SCLPConsoleLM),VMSTATE_UINT32 (length, SCLPConsoleLM),
hw/char/sclpconsole.c +1 -2
@@ -185,8 +185,7 @@ static const VMStateDescription vmstate_sclpconsole = { .name = "sclpconsole", .version_id = 0, .minimum_version_id = 0, - .minimum_version_id_old = 0, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_BOOL (event.event_pending, SCLPConsole),VMSTATE_UINT8_ARRAY (iov, SCLPConsole,SIZE_BUFFER_VT220 ),VMSTATE_UINT32 (iov_sclp, SCLPConsole),
hw/char/serial-pci.c +2 -2
@@ -155,7 +155,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 ()
@@ -166,7 +166,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
@@ -600,7 +600,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/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/core/ptimer.c +1 -2
@@ -206,8 +206,7 @@ const VMStateDescription vmstate_ptimer = { .name = "ptimer", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT8 (enabled, ptimer_state),VMSTATE_UINT64 (limit, ptimer_state),VMSTATE_UINT64 (delta, ptimer_state),
hw/display/ads7846.c +1 -2
@@ -121,9 +121,8 @@ static const VMStateDescription vmstate_ads7846 = { .name = "ads7846", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .post_load = ads7856_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_SSI_SLAVE (ssidev, ADS7846State),VMSTATE_INT32_ARRAY (input, ADS7846State,8 ),VMSTATE_INT32 (noise, ADS7846State),
hw/display/cg3.c +1 -1
@@ -324,7 +324,7 @@ static const VMStateDescription vmstate_cg3 = { .version_id = 1, .minimum_version_id = 1, .post_load = vmstate_cg3_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT16 (height, CG3State),VMSTATE_UINT16 (width, CG3State),VMSTATE_UINT16 (depth, CG3State),
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/exynos4210_fimd.c +2 -2
@@ -1845,7 +1845,7 @@ static const VMStateDescription exynos4210_fimd_window_vmstate = { .name = "exynos4210.fimd_window", .version_id = 1, .minimum_version_id = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT32 (wincon, Exynos4210fimdWindow),VMSTATE_UINT32_ARRAY (buf_start, Exynos4210fimdWindow,3 ),VMSTATE_UINT32_ARRAY (buf_end, Exynos4210fimdWindow,3 ),
@@ -1875,7 +1875,7 @@ static const VMStateDescription exynos4210_fimd_vmstate = { .version_id = 1, .minimum_version_id = 1, .post_load = exynos4210_fimd_load, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT32_ARRAY (vidcon, Exynos4210fimdState,4 ),VMSTATE_UINT32_ARRAY (vidtcon, Exynos4210fimdState,4 ),VMSTATE_UINT32 (shadowcon, Exynos4210fimdState),
hw/display/g364fb.c +0 -1
@@ -459,7 +459,6 @@ static const VMStateDescription vmstate_g364fb = { .name = "g364fb", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .post_load = g364fb_post_load, .fields = (VMStateField []) {VMSTATE_VBUFFER_UINT32 (vram, G364State,1 ,NULL ,0 , vram_size),
hw/display/jazz_led.c +0 -1
@@ -250,7 +250,6 @@ static const VMStateDescription vmstate_jazz_led = { .name = "jazz-led", .version_id = 0, .minimum_version_id = 0, - .minimum_version_id_old = 0, .post_load = jazz_led_post_load, .fields = (VMStateField []) {VMSTATE_UINT8 (segments, LedState),
hw/display/milkymist-tmu2.c +1 -2
@@ -463,8 +463,7 @@ static const VMStateDescription vmstate_milkymist_tmu2 = { .name = "milkymist-tmu2", .version_id = 1, .minimum_version_id =1 , - .minimum_version_id_old =1 , - .fields = (VMStateField[]) { + .fields = (VMStateField[]) {VMSTATE_UINT32_ARRAY (regs, MilkymistTMU2State,R_MAX ),VMSTATE_END_OF_LIST () }
hw/display/milkymist-vgafb.c +1 -2
@@ -305,9 +305,8 @@ static const VMStateDescription vmstate_milkymist_vgafb = { .name = "milkymist-vgafb", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .post_load = vgafb_post_load, - .fields = (VMStateField[]) { + .fields = (VMStateField[]) {VMSTATE_UINT32_ARRAY (regs, MilkymistVgafbState,R_MAX ),VMSTATE_END_OF_LIST () }
hw/display/pxa2xx_lcd.c +2 -4
@@ -932,8 +932,7 @@ static const VMStateDescription vmstate_dma_channel = { .name = "dma_channel", .version_id = 0, .minimum_version_id = 0, - .minimum_version_id_old = 0, - .fields = (VMStateField []) { + .fields = (VMStateField []) { VMSTATE_UINT32(branch, struct DMAChannel), VMSTATE_UINT8(up, struct DMAChannel), VMSTATE_BUFFER(pbuffer, struct DMAChannel),
@@ -959,9 +958,8 @@ static const VMStateDescription vmstate_pxa2xx_lcdc = { .name = "pxa2xx_lcdc", .version_id = 0, .minimum_version_id = 0, - .minimum_version_id_old = 0, .post_load = pxa2xx_lcdc_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_INT32 (irqlevel, PXA2xxLCDState),VMSTATE_INT32 (transp, PXA2xxLCDState),VMSTATE_UINT32_ARRAY (control, PXA2xxLCDState,6 ),
hw/display/ssd0303.c +1 -2
@@ -272,8 +272,7 @@ static const VMStateDescription vmstate_ssd0303 = { .name = "ssd0303_oled", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_INT32 (row, ssd0303_state),VMSTATE_INT32 (col, ssd0303_state),VMSTATE_INT32 (start_line, ssd0303_state),
hw/display/tcx.c +1 -2
@@ -416,9 +416,8 @@ static const VMStateDescription vmstate_tcx = { .name ="tcx", .version_id = 4, .minimum_version_id = 4, - .minimum_version_id_old = 4, .post_load = vmstate_tcx_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT16 (height, TCXState),VMSTATE_UINT16 (width, TCXState),VMSTATE_UINT16 (depth, TCXState),
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
@@ -2210,9 +2210,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/dma/pl330.c +0 -5
@@ -138,7 +138,6 @@ static const VMStateDescription vmstate_pl330_chan = { .name = "pl330_chan", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .fields = (VMStateField []) {VMSTATE_UINT32 (src, PL330Chan),VMSTATE_UINT32 (dst, PL330Chan),
@@ -170,7 +169,6 @@ static const VMStateDescription vmstate_pl330_fifo = { .name = "pl330_chan", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .fields = (VMStateField []) {VMSTATE_VBUFFER_UINT32 (buf, PL330Fifo,1 ,NULL ,0 , buf_size),VMSTATE_VBUFFER_UINT32 (tag, PL330Fifo,1 ,NULL ,0 , buf_size),
@@ -195,7 +193,6 @@ static const VMStateDescription vmstate_pl330_queue_entry = { .name = "pl330_queue_entry", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .fields = (VMStateField []) {VMSTATE_UINT32 (addr, PL330QueueEntry),VMSTATE_UINT32 (len, PL330QueueEntry),
@@ -218,7 +215,6 @@ static const VMStateDescription vmstate_pl330_queue = { .name = "pl330_queue", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .fields = (VMStateField []) {VMSTATE_STRUCT_VARRAY_UINT32 (queue, PL330Queue, queue_size,1 , vmstate_pl330_queue_entry, PL330QueueEntry),
@@ -279,7 +275,6 @@ static const VMStateDescription vmstate_pl330 = { .name = "pl330", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .fields = (VMStateField []) {VMSTATE_STRUCT (manager, PL330State,0 , vmstate_pl330_chan, PL330Chan), VMSTATE_STRUCT_VARRAY_UINT32(chan, PL330State, num_chnls, 0,
hw/dma/pxa2xx_dma.c +0 -2
@@ -514,7 +514,6 @@ static VMStateDescription vmstate_pxa2xx_dma_chan = { .name = "pxa2xx_dma_chan", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .fields = (VMStateField []) {VMSTATE_UINT32 (descr, PXA2xxDMAChannel),VMSTATE_UINT32 (src, PXA2xxDMAChannel),
@@ -530,7 +529,6 @@ static VMStateDescription vmstate_pxa2xx_dma = { .name = "pxa2xx_dma", .version_id = 1, .minimum_version_id = 0, - .minimum_version_id_old = 0, .fields = (VMStateField []) {VMSTATE_UNUSED_TEST (is_version_0,4 ),VMSTATE_UINT32 (stopintr, PXA2xxDMAState),
hw/dma/sparc32_dma.c +1 -2
@@ -263,8 +263,7 @@ static const VMStateDescription vmstate_dma = { .name ="sparc32_dma", .version_id = 2, .minimum_version_id =2 , - .minimum_version_id_old =2 , - .fields = (VMStateField []) { + .fields = (VMStateField[]) {VMSTATE_UINT32_ARRAY (dmaregs, DMAState,DMA_REGS ),VMSTATE_END_OF_LIST () }
hw/dma/sun4m_iommu.c +1 -2
@@ -327,8 +327,7 @@ static const VMStateDescription vmstate_iommu = { .name ="iommu", .version_id = 2, .minimum_version_id = 2, - .minimum_version_id_old = 2, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT32_ARRAY (regs, IOMMUState,IOMMU_NREGS ),VMSTATE_UINT64 (iostart, IOMMUState),VMSTATE_END_OF_LIST ()
hw/gpio/max7310.c +1 -2
@@ -152,8 +152,7 @@ static const VMStateDescription vmstate_max7310 = { .name = "max7310", .version_id = 0, .minimum_version_id = 0, - .minimum_version_id_old = 0, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_INT32 (i2c_command_byte, MAX7310State),VMSTATE_INT32 (len, MAX7310State),VMSTATE_UINT8 (level, MAX7310State),
hw/gpio/zaurus.c +1 -2
@@ -207,9 +207,8 @@ static const VMStateDescription vmstate_scoop_regs = { .name = "scoop", .version_id = 1, .minimum_version_id = 0, - .minimum_version_id_old = 0, .post_load = scoop_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT16 (status, ScoopInfo),VMSTATE_UINT16 (power, ScoopInfo),VMSTATE_UINT32 (gpio_level, ScoopInfo),
hw/i2c/core.c +2 -4
@@ -52,10 +52,9 @@ static const VMStateDescription vmstate_i2c_bus = { .name = "i2c_bus", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .pre_save = i2c_bus_pre_save, .post_load = i2c_bus_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField[]) {VMSTATE_UINT8 (saved_address, I2CBus),VMSTATE_END_OF_LIST () }
@@ -194,9 +193,8 @@ const VMStateDescription vmstate_i2c_slave = { .name = "I2CSlave", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .post_load = i2c_slave_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField[]) {VMSTATE_UINT8 (address, I2CSlave),VMSTATE_END_OF_LIST () }
hw/i2c/smbus_ich9.c +0 -1
@@ -48,7 +48,6 @@ static const VMStateDescription vmstate_ich9_smbus = { .name = "ich9_smb", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .fields = (VMStateField []) { VMSTATE_PCI_DEVICE(dev, struct ICH9SMBState),VMSTATE_END_OF_LIST ()
hw/i386/acpi-build.c +1 -2
@@ -1497,8 +1497,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
@@ -102,7 +102,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
@@ -773,7 +773,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),
@@ -787,7 +786,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),
@@ -807,7 +805,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
@@ -502,8 +502,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/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/core.c +5 -11
@@ -2342,8 +2342,7 @@ static const VMStateDescription vmstate_ide_atapi_gesn_state = { .name ="ide_drive/atapi/gesn_state", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_BOOL (events.new_media, IDEState),VMSTATE_BOOL (events.eject_request, IDEState),VMSTATE_END_OF_LIST ()
@@ -2354,7 +2353,6 @@ static const VMStateDescription vmstate_ide_tray_state = { .name = "ide_drive/tray_state", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .fields = (VMStateField []) {VMSTATE_BOOL (tray_open, IDEState),VMSTATE_BOOL (tray_locked, IDEState),
@@ -2366,10 +2364,9 @@ static const VMStateDescription vmstate_ide_drive_pio_state = { .name = "ide_drive/pio_state", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .pre_save = ide_drive_pio_pre_save, .post_load = ide_drive_pio_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_INT32 (req_nb_sectors, IDEState),VMSTATE_VARRAY_INT32 (io_buffer, IDEState, io_buffer_total_len,1 , vmstate_info_uint8, uint8_t),
@@ -2386,9 +2383,8 @@ const VMStateDescription vmstate_ide_drive = { .name = "ide_drive", .version_id = 3, .minimum_version_id = 0, - .minimum_version_id_old = 0, .post_load = ide_drive_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_INT32 (mult_sectors, IDEState),VMSTATE_INT32 (identify_set, IDEState),VMSTATE_BUFFER_TEST (identify_data, IDEState, is_identify_set),
@@ -2431,8 +2427,7 @@ static const VMStateDescription vmstate_ide_error_status = { .name ="ide_bus/error", .version_id = 1, .minimum_version_id =1 , - .minimum_version_id_old =1 , - .fields = (VMStateField []) { + .fields = (VMStateField[]) {VMSTATE_INT32 (error_status, IDEBus),VMSTATE_END_OF_LIST () }
@@ -2442,8 +2437,7 @@ const VMStateDescription vmstate_ide_bus = { .name = "ide_bus", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT8 (cmd, IDEBus),VMSTATE_UINT8 (unit, IDEBus),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/macio.c +1 -2
@@ -480,8 +480,7 @@ static const VMStateDescription vmstate_pmac = { .name = "ide", .version_id = 3, .minimum_version_id = 0, - .minimum_version_id_old = 0, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_IDE_BUS (bus, MACIOIDEState),VMSTATE_IDE_DRIVES (bus.ifs, MACIOIDEState),VMSTATE_END_OF_LIST ()
hw/ide/microdrive.c +1 -2
@@ -332,8 +332,7 @@ static const VMStateDescription vmstate_microdrive = { .name = "microdrive", .version_id = 3, .minimum_version_id = 0, - .minimum_version_id_old = 0, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT8 (opt, MicroDriveState),VMSTATE_UINT8 (stat, MicroDriveState),VMSTATE_UINT8 (pins, MicroDriveState),
hw/ide/mmio.c +1 -2
@@ -109,8 +109,7 @@ static const VMStateDescription vmstate_ide_mmio = { .name = "mmio-ide", .version_id = 3, .minimum_version_id = 0, - .minimum_version_id_old = 0, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_IDE_BUS (bus, MMIOState),VMSTATE_IDE_DRIVES (bus.ifs, MMIOState),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/adb.c +2 -4
@@ -303,8 +303,7 @@ static const VMStateDescription vmstate_adb_kbd = { .name = "adb_kbd", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_BUFFER (data, KBDState),VMSTATE_INT32 (rptr, KBDState),VMSTATE_INT32 (wptr, KBDState),
@@ -518,8 +517,7 @@ static const VMStateDescription vmstate_adb_mouse = { .name = "adb_mouse", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_INT32 (buttons_state, MouseState),VMSTATE_INT32 (last_buttons_state, MouseState),VMSTATE_INT32 (dx, MouseState),
hw/input/lm832x.c +1 -2
@@ -432,9 +432,8 @@ static const VMStateDescription vmstate_lm_kbd = { .name = "LM8323", .version_id = 0, .minimum_version_id = 0, - .minimum_version_id_old = 0, .post_load = lm_kbd_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_I2C_SLAVE (parent_obj, LM823KbdState),VMSTATE_UINT8 (i2c_dir, LM823KbdState),VMSTATE_UINT8 (i2c_cycle, LM823KbdState),
hw/input/milkymist-softusb.c +1 -2
@@ -295,8 +295,7 @@ static const VMStateDescription vmstate_milkymist_softusb = { .name = "milkymist-softusb", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT32_ARRAY (regs, MilkymistSoftUsbState,R_MAX ),VMSTATE_HID_KEYBOARD_DEVICE (hid_kbd, MilkymistSoftUsbState),VMSTATE_HID_POINTER_DEVICE (hid_mouse, MilkymistSoftUsbState),
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
@@ -559,8 +559,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),
@@ -589,9 +588,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 () }
@@ -610,9 +608,8 @@ 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, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_STRUCT (common, PS2KbdState,0 , vmstate_ps2_common, PS2State),VMSTATE_INT32 (scan_enabled, PS2KbdState),VMSTATE_INT32 (translate, PS2KbdState),
@@ -633,8 +630,7 @@ static const VMStateDescription vmstate_ps2_mouse = { .name = "ps2mouse", .version_id = 2, .minimum_version_id = 2, - .minimum_version_id_old = 2, - .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/pxa2xx_keypad.c +1 -2
@@ -291,8 +291,7 @@ static const VMStateDescription vmstate_pxa2xx_keypad = { .name = "pxa2xx_keypad", .version_id = 0, .minimum_version_id = 0, - .minimum_version_id_old = 0, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT32 (kpc, PXA2xxKeyPadState),VMSTATE_UINT32 (kpdk, PXA2xxKeyPadState),VMSTATE_UINT32 (kprec, PXA2xxKeyPadState),
hw/input/stellaris_input.c +2 -4
@@ -51,8 +51,7 @@ static const VMStateDescription vmstate_stellaris_button = { .name = "stellaris_button", .version_id = 0, .minimum_version_id =0 , - .minimum_version_id_old =0 , - .fields = (VMStateField[]) { + .fields = (VMStateField[]) {VMSTATE_UINT8 (pressed, gamepad_button),VMSTATE_END_OF_LIST () }
@@ -62,8 +61,7 @@ static const VMStateDescription vmstate_stellaris_gamepad = { .name = "stellaris_gamepad", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_INT32 (extension, gamepad_state),VMSTATE_STRUCT_VARRAY_INT32 (buttons, gamepad_state, num_buttons,0 , vmstate_stellaris_button, gamepad_button),
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/allwinner-a10-pic.c +0 -1
@@ -129,7 +129,6 @@ static const VMStateDescription vmstate_aw_a10_pic = { .name = "a10.pic", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .fields = (VMStateField []) {VMSTATE_UINT32 (vector, AwA10PICState),VMSTATE_UINT32 (base_addr, AwA10PICState),
hw/intc/armv7m_nvic.c +1 -2
@@ -443,8 +443,7 @@ static const VMStateDescription vmstate_nvic = { .name = "armv7m_nvic", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT32 (systick.control, nvic_state),VMSTATE_UINT32 (systick.reload, nvic_state),VMSTATE_INT64 (systick.tick, nvic_state),
hw/intc/exynos4210_combiner.c +0 -2
@@ -77,7 +77,6 @@ static const VMStateDescription vmstate_exynos4210_combiner_group_state = { .name = "exynos4210.combiner.groupstate", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .fields = (VMStateField []) {VMSTATE_UINT8 (src_mask, CombinerGroupState),VMSTATE_UINT8 (src_pending, CombinerGroupState),
@@ -89,7 +88,6 @@ static const VMStateDescription vmstate_exynos4210_combiner = { .name = "exynos4210.combiner", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .fields = (VMStateField []) {VMSTATE_STRUCT_ARRAY (group, Exynos4210CombinerState,IIC_NGRP ,0 , vmstate_exynos4210_combiner_group_state, CombinerGroupState),
hw/intc/exynos4210_gic.c +0 -1
@@ -394,7 +394,6 @@ static const VMStateDescription vmstate_exynos4210_irq_gate = { .name = "exynos4210.irq_gate", .version_id = 2, .minimum_version_id = 2, - .minimum_version_id_old = 2, .fields = (VMStateField []) {VMSTATE_VBUFFER_UINT32 (level, Exynos4210IRQGateState,1 ,NULL ,0 , n_in),VMSTATE_END_OF_LIST ()
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/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/imx_avic.c +0 -1
@@ -77,7 +77,6 @@ static const VMStateDescription vmstate_imx_avic = { .name = "imx-avic", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .fields = (VMStateField []) {VMSTATE_UINT64 (pending, IMXAVICState),VMSTATE_UINT64 (enabled, IMXAVICState),
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/intc/lm32_pic.c +1 -2
@@ -169,8 +169,7 @@ static const VMStateDescription vmstate_lm32_pic = { .name = "lm32-pic", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT32 (im, LM32PicState),VMSTATE_UINT32 (ip, LM32PicState),VMSTATE_UINT32 (irq_state, LM32PicState),
hw/intc/slavio_intctl.c +2 -4
@@ -381,8 +381,7 @@ static const VMStateDescription vmstate_intctl_cpu = { .name ="slavio_intctl_cpu", .version_id = 1, .minimum_version_id =1 , - .minimum_version_id_old =1 , - .fields = (VMStateField []) { + .fields = (VMStateField[]) {VMSTATE_UINT32 (intreg_pending, SLAVIO_CPUINTCTLState),VMSTATE_END_OF_LIST () }
@@ -392,9 +391,8 @@ static const VMStateDescription vmstate_intctl = { .name ="slavio_intctl", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .post_load = vmstate_intctl_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_STRUCT_ARRAY (slaves, SLAVIO_INTCTLState,MAX_CPUS ,1 , vmstate_intctl_cpu, SLAVIO_CPUINTCTLState),VMSTATE_UINT32 (intregm_pending, SLAVIO_INTCTLState),
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/ipack/ipack.c +1 -2
@@ -89,8 +89,7 @@ const VMStateDescription vmstate_ipack_device = { .name = "ipack_device", .version_id = 1, .minimum_version_id =1 , - .minimum_version_id_old =1 , - .fields = (VMStateField[]) { + .fields = (VMStateField[]) {VMSTATE_INT32 (slot, IPackDevice),VMSTATE_END_OF_LIST () }
hw/ipack/tpci200.c +1 -2
@@ -629,8 +629,7 @@ static const VMStateDescription vmstate_tpci200 = { .name = "tpci200", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_PCI_DEVICE (dev, TPCI200State),VMSTATE_BOOL_ARRAY (big_endian, TPCI200State,3 ),VMSTATE_UINT8_ARRAY (ctrl, TPCI200State,N_MODULES ),
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/misc/eccmemctl.c +1 -2
@@ -266,8 +266,7 @@ static const VMStateDescription vmstate_ecc = { .name ="ECC", .version_id = 3, .minimum_version_id = 3, - .minimum_version_id_old = 3, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT32_ARRAY (regs, ECCState,ECC_NREGS ),VMSTATE_BUFFER (diag, ECCState),VMSTATE_UINT32 (version, ECCState),
hw/misc/exynos4210_pmu.c +1 -1
@@ -471,7 +471,7 @@ static const VMStateDescription exynos4210_pmu_vmstate = { .name = "exynos4210.pmu", .version_id = 1, .minimum_version_id =1 , - .fields = (VMStateField[]) { + .fields = (VMStateField[]) {VMSTATE_UINT32_ARRAY (reg, Exynos4210PmuState,PMU_NUM_OF_REGISTERS ),VMSTATE_END_OF_LIST () }
hw/misc/imx_ccm.c +0 -1
@@ -57,7 +57,6 @@ static const VMStateDescription vmstate_imx_ccm = { .name = "imx-ccm", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .fields = (VMStateField []) {VMSTATE_UINT32 (ccmr, IMXCCMState),VMSTATE_UINT32 (pdr0, IMXCCMState),
hw/misc/lm32_sys.c +1 -2
@@ -141,8 +141,7 @@ static const VMStateDescription vmstate_lm32_sys = { .name = "lm32-sys", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT32_ARRAY (regs, LM32SysState,R_MAX ),VMSTATE_BUFFER (testname, LM32SysState),VMSTATE_END_OF_LIST ()
hw/misc/macio/cuda.c +2 -4
@@ -617,8 +617,7 @@ static const VMStateDescription vmstate_cuda_timer = { .name = "cuda_timer", .version_id = 0, .minimum_version_id = 0, - .minimum_version_id_old = 0, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT16 (latch, CUDATimer),VMSTATE_UINT16 (counter_value, CUDATimer),VMSTATE_INT64 (load_time, CUDATimer),
@@ -632,8 +631,7 @@ static const VMStateDescription vmstate_cuda = { .name = "cuda", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT8 (a, CUDAState),VMSTATE_UINT8 (b, CUDAState),VMSTATE_UINT8 (dira, CUDAState),
hw/misc/macio/mac_dbdma.c +2 -4
@@ -719,8 +719,7 @@ static const VMStateDescription vmstate_dbdma_channel = { .name = "dbdma_channel", .version_id = 0, .minimum_version_id =0 , - .minimum_version_id_old =0 , - .fields = (VMStateField[]) { + .fields = (VMStateField[]) { VMSTATE_UINT32_ARRAY(regs, struct DBDMA_channel, DBDMA_REGS),VMSTATE_END_OF_LIST () }
@@ -730,8 +729,7 @@ static const VMStateDescription vmstate_dbdma = { .name = "dbdma", .version_id = 2, .minimum_version_id = 2, - .minimum_version_id_old = 2, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_STRUCT_ARRAY (channels, DBDMAState,DBDMA_CHANNELS ,1 , vmstate_dbdma_channel, DBDMA_channel),VMSTATE_END_OF_LIST ()
hw/misc/max111x.c +1 -2
@@ -110,8 +110,7 @@ static const VMStateDescription vmstate_max111x = { .name = "max111x", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_SSI_SLAVE (parent_obj, MAX111xState),VMSTATE_UINT8 (tb1, MAX111xState),VMSTATE_UINT8 (rb2, MAX111xState),
hw/misc/milkymist-hpdmc.c +1 -2
@@ -143,8 +143,7 @@ static const VMStateDescription vmstate_milkymist_hpdmc = { .name = "milkymist-hpdmc", .version_id = 1, .minimum_version_id =1 , - .minimum_version_id_old =1 , - .fields = (VMStateField[]) { + .fields = (VMStateField[]) {VMSTATE_UINT32_ARRAY (regs, MilkymistHpdmcState,R_MAX ),VMSTATE_END_OF_LIST () }
hw/misc/milkymist-pfpu.c +1 -2
@@ -513,8 +513,7 @@ static const VMStateDescription vmstate_milkymist_pfpu = { .name = "milkymist-pfpu", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT32_ARRAY (regs, MilkymistPFPUState,R_MAX ),VMSTATE_UINT32_ARRAY (gp_regs, MilkymistPFPUState,128 ),VMSTATE_UINT32_ARRAY (microcode, MilkymistPFPUState,MICROCODE_WORDS ),
hw/misc/mst_fpga.c +5 -6
@@ -219,12 +219,11 @@ static int mst_fpga_init(SysBusDevice *sbd) }static VMStateDescription vmstate_mst_fpga_regs = { - .name ="mainstone_fpga" , - .version_id =0 , - .minimum_version_id =0 , - .minimum_version_id_old =0 , - .post_load = mst_fpga_post_load, - .fields = (VMStateField []) { + .name ="mainstone_fpga" , + .version_id =0 , + .minimum_version_id =0 , + .post_load = mst_fpga_post_load, + .fields = (VMStateField []) {VMSTATE_UINT32 (prev_level, mst_irq_state),VMSTATE_UINT32 (leddat1, mst_irq_state),VMSTATE_UINT32 (leddat2, mst_irq_state),
hw/misc/slavio_misc.c +1 -2
@@ -400,8 +400,7 @@ static const VMStateDescription vmstate_misc = { .name ="slavio_misc", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT32 (dummy, MiscState),VMSTATE_UINT8 (config, MiscState),VMSTATE_UINT8 (aux1, MiscState),
hw/misc/tmp105.c +1 -2
@@ -197,9 +197,8 @@ static const VMStateDescription vmstate_tmp105 = { .name = "TMP105", .version_id = 0, .minimum_version_id = 0, - .minimum_version_id_old = 0, .post_load = tmp105_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT8 (len, TMP105State),VMSTATE_UINT8_ARRAY (buf, TMP105State,2 ),VMSTATE_UINT8 (pointer, TMP105State),
hw/misc/zynq_slcr.c +1 -2
@@ -512,8 +512,7 @@ static const VMStateDescription vmstate_zynq_slcr = { .name = "zynq_slcr", .version_id = 1, .minimum_version_id =1 , - .minimum_version_id_old =1 , - .fields = (VMStateField[]) { + .fields = (VMStateField[]) {VMSTATE_UINT8_ARRAY (data, ZynqSLCRState,0x1000 ),VMSTATE_END_OF_LIST () }
hw/net/cadence_gem.c +1 -2
@@ -1257,8 +1257,7 @@ static const VMStateDescription vmstate_cadence_gem = { .name = "cadence_gem", .version_id = 2, .minimum_version_id = 2, - .minimum_version_id_old = 2, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT32_ARRAY (regs, GemState,GEM_MAXREG ),VMSTATE_UINT16_ARRAY (phy_regs, GemState,32 ),VMSTATE_UINT8 (phy_loop, GemState),
hw/net/e1000.c +2 -4
@@ -1341,8 +1341,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),
@@ -1356,10 +1355,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/lance.c +1 -2
@@ -110,8 +110,7 @@ static const VMStateDescription vmstate_lance = { .name = "pcnet", .version_id = 3, .minimum_version_id =2 , - .minimum_version_id_old =2 , - .fields = (VMStateField []) { + .fields = (VMStateField[]) {VMSTATE_STRUCT (state, SysBusPCNetState,0 , vmstate_pcnet, PCNetState),VMSTATE_END_OF_LIST () }
hw/net/milkymist-minimac2.c +2 -4
@@ -492,8 +492,7 @@ static const VMStateDescription vmstate_milkymist_minimac2_mdio = { .name = "milkymist-minimac2-mdio", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_INT32 (last_clk, MilkymistMinimac2MdioState),VMSTATE_INT32 (count, MilkymistMinimac2MdioState),VMSTATE_UINT32 (data, MilkymistMinimac2MdioState),
@@ -509,8 +508,7 @@ static const VMStateDescription vmstate_milkymist_minimac2 = { .name = "milkymist-minimac2", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT32_ARRAY (regs, MilkymistMinimac2State,R_MAX ),VMSTATE_UINT16_ARRAY (phy_regs, MilkymistMinimac2State,R_PHY_MAX ), VMSTATE_STRUCT(mdio, MilkymistMinimac2State, 0,
hw/net/mipsnet.c +1 -2
@@ -198,8 +198,7 @@ static const VMStateDescription vmstate_mipsnet = { .name = "mipsnet", .version_id = 0, .minimum_version_id = 0, - .minimum_version_id_old = 0, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT32 (busy, MIPSnetState),VMSTATE_UINT32 (rx_count, MIPSnetState),VMSTATE_UINT32 (rx_read, MIPSnetState),
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
@@ -1701,8 +1701,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/smc91c111.c +1 -1
@@ -54,7 +54,7 @@ static const VMStateDescription vmstate_smc91c111 = { .name = "smc91c111", .version_id = 1, .minimum_version_id = 1, - .fields = (VMStateField []) { + .fields = (VMStateField []) {VMSTATE_UINT16 (tcr, smc91c111_state),VMSTATE_UINT16 (rcr, smc91c111_state),VMSTATE_UINT16 (cr, smc91c111_state),
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/net/vmxnet3.c +1 -3
@@ -2174,7 +2174,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,
@@ -2381,10 +2380,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/net/xgmac.c +1 -1
@@ -156,7 +156,7 @@ const VMStateDescription vmstate_rxtx_stats = { .name = "xgmac_stats", .version_id = 1, .minimum_version_id = 1, - .fields = (VMStateField[]) { + .fields = (VMStateField[]) { VMSTATE_UINT64(rx_bytes, RxTxStats), VMSTATE_UINT64(tx_bytes, RxTxStats), VMSTATE_UINT64(rx, RxTxStats),
hw/nvram/ds1225y.c +0 -1
@@ -95,7 +95,6 @@ static const VMStateDescription vmstate_nvram = { .name = "nvram", .version_id = 0, .minimum_version_id = 0, - .minimum_version_id_old = 0, .post_load = nvram_post_load, .fields = (VMStateField[]) { VMSTATE_VARRAY_UINT32(contents, NvRamState, chip_size, 0,
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/nvram/mac_nvram.c +1 -2
@@ -96,8 +96,7 @@ static const VMStateDescription vmstate_macio_nvram = { .name = "macio_nvram", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField[]) { + .fields = (VMStateField[]) { VMSTATE_VBUFFER_UINT32(data, MacIONVRAMState, 0, NULL, 0, size), VMSTATE_END_OF_LIST() }
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/bonito.c +1 -2
@@ -687,8 +687,7 @@ static const VMStateDescription vmstate_bonito = { .name = "Bonito", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField[]) { VMSTATE_PCI_DEVICE(dev, PCIBonitoState), VMSTATE_END_OF_LIST() }
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/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/pci-host/q35.c +1 -2
@@ -330,9 +330,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_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_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),
@@ -799,8 +798,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(log_max, PCIEAERLog), VMSTATE_STRUCT_VARRAY_POINTER_UINT16(log, PCIEAERLog, log_num,
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/s390x/event-facility.c +1 -2
@@ -319,8 +319,7 @@ static const VMStateDescription vmstate_event_facility = { .name = "vmstate-event-facility", .version_id = 0, .minimum_version_id = 0, - .minimum_version_id_old = 0, - .fields = (VMStateField[]) { + .fields = (VMStateField[]) { VMSTATE_UINT32(receive_mask, SCLPEventFacility), VMSTATE_END_OF_LIST() }
hw/s390x/sclpquiesce.c +1 -2
@@ -69,8 +69,7 @@ static const VMStateDescription vmstate_sclpquiesce = { .name = "sclpquiesce", .version_id = 0, .minimum_version_id = 0, - .minimum_version_id_old = 0, - .fields = (VMStateField[]) { + .fields = (VMStateField[]) { VMSTATE_BOOL(event_pending, SCLPEvent), VMSTATE_END_OF_LIST() }
hw/scsi/esp-pci.c +0 -1
@@ -310,7 +310,6 @@ static const VMStateDescription vmstate_esp_pci_scsi = { .name = "pciespscsi", .version_id = 0, .minimum_version_id = 0, - .minimum_version_id_old = 0, .fields = (VMStateField[]) { VMSTATE_PCI_DEVICE(parent_obj, PCIESPState), VMSTATE_BUFFER_UNSAFE(dma_regs, PCIESPState, 0, 8 * sizeof(uint32_t)),
hw/scsi/esp.c +1 -3
@@ -560,8 +560,7 @@ const VMStateDescription vmstate_esp = { .name ="esp", .version_id = 3, .minimum_version_id = 3, - .minimum_version_id_old = 3, - .fields = (VMStateField []) { + .fields = (VMStateField[]) { VMSTATE_BUFFER(rregs, ESPState), VMSTATE_BUFFER(wregs, ESPState), VMSTATE_INT32(ti_size, ESPState),
@@ -706,7 +705,6 @@ static const VMStateDescription vmstate_sysbus_esp_scsi = { .name = "sysbusespscsi", .version_id = 0, .minimum_version_id = 0, - .minimum_version_id_old = 0, .fields = (VMStateField[]) { VMSTATE_STRUCT(esp, SysBusESPState, 0, vmstate_esp, ESPState), VMSTATE_END_OF_LIST()
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
@@ -2065,8 +2065,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_INT32(fw_state, MegasasState),
hw/scsi/scsi-bus.c +1 -3
@@ -1915,8 +1915,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),
@@ -1928,7 +1927,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
@@ -2571,7 +2571,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/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/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/sd/milkymist-memcard.c +1 -2
@@ -272,8 +272,7 @@ static const VMStateDescription vmstate_milkymist_memcard = { .name = "milkymist-memcard", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField[]) { + .fields = (VMStateField[]) { VMSTATE_INT32(command_write_ptr, MilkymistMemcardState), VMSTATE_INT32(response_read_ptr, MilkymistMemcardState), VMSTATE_INT32(response_len, MilkymistMemcardState),
hw/sd/sdhci.c +1 -1
@@ -1197,7 +1197,7 @@ const VMStateDescription sdhci_vmstate = { .name = "sdhci", .version_id = 1, .minimum_version_id = 1, - .fields = (VMStateField[]) { + .fields = (VMStateField[]) { VMSTATE_UINT32(sdmasysad, SDHCIState), VMSTATE_UINT16(blksize, SDHCIState), VMSTATE_UINT16(blkcnt, SDHCIState),
hw/ssi/pl022.c +1 -2
@@ -244,8 +244,7 @@ static const VMStateDescription vmstate_pl022 = { .name = "pl022_ssp", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField[]) { + .fields = (VMStateField[]) { VMSTATE_UINT32(cr0, PL022State), VMSTATE_UINT32(cr1, PL022State), VMSTATE_UINT32(bitmask, PL022State),
hw/ssi/ssi.c +1 -2
@@ -126,8 +126,7 @@ const VMStateDescription vmstate_ssi_slave = { .name = "SSISlave", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField[]) { + .fields = (VMStateField[]) { VMSTATE_BOOL(cs, SSISlave), VMSTATE_END_OF_LIST() }
hw/ssi/xilinx_spi.c +0 -1
@@ -351,7 +351,6 @@ static const VMStateDescription vmstate_xilinx_spi = { .name = "xilinx_spi", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .fields = (VMStateField[]) { VMSTATE_FIFO8(tx_fifo, XilinxSPI), VMSTATE_FIFO8(rx_fifo, XilinxSPI),
hw/ssi/xilinx_spips.c +0 -1
@@ -704,7 +704,6 @@ static const VMStateDescription vmstate_xilinx_spips = { .name = "xilinx_spips", .version_id = 2, .minimum_version_id = 2, - .minimum_version_id_old = 2, .post_load = xilinx_spips_post_load, .fields = (VMStateField[]) { VMSTATE_FIFO8(tx_fifo, XilinxSPIPS),
hw/timer/allwinner-a10-pit.c +0 -1
@@ -154,7 +154,6 @@ static const VMStateDescription vmstate_a10_pit = { .name = "a10.pit", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .fields = (VMStateField[]) { VMSTATE_UINT32(irq_enable, AwA10PITState), VMSTATE_UINT32(irq_status, AwA10PITState),
hw/timer/arm_timer.c +2 -4
@@ -150,8 +150,7 @@ static const VMStateDescription vmstate_arm_timer = { .name = "arm_timer", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField[]) { + .fields = (VMStateField[]) { VMSTATE_UINT32(control, arm_timer_state), VMSTATE_UINT32(limit, arm_timer_state), VMSTATE_INT32(int_level, arm_timer_state),
@@ -271,8 +270,7 @@ static const VMStateDescription vmstate_sp804 = { .name = "sp804", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField[]) { + .fields = (VMStateField[]) { VMSTATE_INT32_ARRAY(level, SP804State, 2), VMSTATE_END_OF_LIST() }
hw/timer/cadence_ttc.c +0 -2
@@ -441,7 +441,6 @@ static const VMStateDescription vmstate_cadence_timer = { .name = "cadence_timer", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .pre_save = cadence_timer_pre_save, .post_load = cadence_timer_post_load, .fields = (VMStateField[]) {
@@ -462,7 +461,6 @@ static const VMStateDescription vmstate_cadence_ttc = { .name = "cadence_TTC", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .fields = (VMStateField[]) { VMSTATE_STRUCT_ARRAY(timer, CadenceTTCState, 3, 0, vmstate_cadence_timer,
hw/timer/digic-timer.c +0 -1
@@ -36,7 +36,6 @@ static const VMStateDescription vmstate_digic_timer = { .name = "digic.timer", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .fields = (VMStateField[]) { VMSTATE_PTIMER(ptimer, DigicTimerState), VMSTATE_UINT32(control, DigicTimerState),
hw/timer/ds1338.c +0 -1
@@ -40,7 +40,6 @@ static const VMStateDescription vmstate_ds1338 = { .name = "ds1338", .version_id = 2, .minimum_version_id = 1, - .minimum_version_id_old = 1, .fields = (VMStateField[]) { VMSTATE_I2C_SLAVE(parent_obj, DS1338State), VMSTATE_INT64(offset, DS1338State),
hw/timer/exynos4210_mct.c +0 -6
@@ -264,7 +264,6 @@ static const VMStateDescription vmstate_tick_timer = { .name = "exynos4210.mct.tick_timer", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .fields = (VMStateField[]) { VMSTATE_UINT32(cnt_run, struct tick_timer), VMSTATE_UINT32(int_run, struct tick_timer),
@@ -284,7 +283,6 @@ static const VMStateDescription vmstate_lregs = { .name = "exynos4210.mct.lregs", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .fields = (VMStateField[]) { VMSTATE_UINT32_ARRAY(cnt, struct lregs, L_REG_CNT_AMOUNT), VMSTATE_UINT32(tcon, struct lregs),
@@ -299,7 +297,6 @@ static const VMStateDescription vmstate_exynos4210_mct_lt = { .name = "exynos4210.mct.lt", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .fields = (VMStateField[]) { VMSTATE_INT32(id, Exynos4210MCTLT), VMSTATE_STRUCT(tick_timer, Exynos4210MCTLT, 0,
@@ -317,7 +314,6 @@ static const VMStateDescription vmstate_gregs = { .name = "exynos4210.mct.lregs", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .fields = (VMStateField[]) { VMSTATE_UINT64(cnt, struct gregs), VMSTATE_UINT32(cnt_wstat, struct gregs),
@@ -336,7 +332,6 @@ static const VMStateDescription vmstate_exynos4210_mct_gt = { .name = "exynos4210.mct.lt", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .fields = (VMStateField[]) { VMSTATE_STRUCT(reg, Exynos4210MCTGT, 0, vmstate_gregs, struct gregs),
@@ -351,7 +346,6 @@ static const VMStateDescription vmstate_exynos4210_mct_state = { .name = "exynos4210.mct", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .fields = (VMStateField[]) { VMSTATE_UINT32(reg_mct_cfg, Exynos4210MCTState), VMSTATE_STRUCT_ARRAY(l_timer, Exynos4210MCTState, 2, 0,
hw/timer/exynos4210_pwm.c +0 -2
@@ -120,7 +120,6 @@ static const VMStateDescription vmstate_exynos4210_pwm = { .name = "exynos4210.pwm.pwm", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .fields = (VMStateField[]) { VMSTATE_UINT32(id, Exynos4210PWM), VMSTATE_UINT32(freq, Exynos4210PWM),
@@ -135,7 +134,6 @@ static const VMStateDescription vmstate_exynos4210_pwm_state = { .name = "exynos4210.pwm", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .fields = (VMStateField[]) { VMSTATE_UINT32_ARRAY(reg_tcfg, Exynos4210PWMState, 2), VMSTATE_UINT32(reg_tcon, Exynos4210PWMState),
hw/timer/exynos4210_rtc.c +0 -1
@@ -118,7 +118,6 @@ static const VMStateDescription vmstate_exynos4210_rtc_state = { .name = "exynos4210.rtc", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .fields = (VMStateField[]) { VMSTATE_UINT32(reg_intp, Exynos4210RTCState), VMSTATE_UINT32(reg_rtccon, Exynos4210RTCState),
hw/timer/hpet.c +3 -6
@@ -270,8 +270,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() }
@@ -281,8 +280,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),
@@ -298,11 +296,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/imx_epit.c +1 -2
@@ -353,8 +353,7 @@ static const VMStateDescription vmstate_imx_timer_epit = { .name = "imx.epit", .version_id = 2, .minimum_version_id = 2, - .minimum_version_id_old = 2, - .fields = (VMStateField[]) { + .fields = (VMStateField[]) { VMSTATE_UINT32(cr, IMXEPITState), VMSTATE_UINT32(sr, IMXEPITState), VMSTATE_UINT32(lr, IMXEPITState),
hw/timer/imx_gpt.c +1 -2
@@ -146,8 +146,7 @@ static const VMStateDescription vmstate_imx_timer_gpt = { .name = "imx.gpt", .version_id = 3, .minimum_version_id = 3, - .minimum_version_id_old = 3, - .fields = (VMStateField[]) { + .fields = (VMStateField[]) { VMSTATE_UINT32(cr, IMXGPTState), VMSTATE_UINT32(pr, IMXGPTState), VMSTATE_UINT32(sr, IMXGPTState),
hw/timer/lm32_timer.c +1 -2
@@ -196,8 +196,7 @@ static const VMStateDescription vmstate_lm32_timer = { .name = "lm32-timer", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField[]) { + .fields = (VMStateField[]) { VMSTATE_PTIMER(ptimer, LM32TimerState), VMSTATE_UINT32(freq_hz, LM32TimerState), VMSTATE_UINT32_ARRAY(regs, LM32TimerState, R_MAX),
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),
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/timer/milkymist-sysctl.c +1 -2
@@ -295,8 +295,7 @@ static const VMStateDescription vmstate_milkymist_sysctl = { .name = "milkymist-sysctl", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField[]) { + .fields = (VMStateField[]) { VMSTATE_UINT32_ARRAY(regs, MilkymistSysctlState, R_MAX), VMSTATE_PTIMER(ptimer0, MilkymistSysctlState), VMSTATE_PTIMER(ptimer1, MilkymistSysctlState),
hw/timer/pxa2xx_timer.c +0 -3
@@ -476,7 +476,6 @@ static const VMStateDescription vmstate_pxa2xx_timer0_regs = { .name = "pxa2xx_timer0", .version_id = 2, .minimum_version_id = 2, - .minimum_version_id_old = 2, .fields = (VMStateField[]) { VMSTATE_UINT32(value, PXA2xxTimer0), VMSTATE_END_OF_LIST(),
@@ -487,7 +486,6 @@ static const VMStateDescription vmstate_pxa2xx_timer4_regs = { .name = "pxa2xx_timer4", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .fields = (VMStateField[]) { VMSTATE_STRUCT(tm, PXA2xxTimer4, 1, vmstate_pxa2xx_timer0_regs, PXA2xxTimer0),
@@ -509,7 +507,6 @@ static const VMStateDescription vmstate_pxa2xx_timer_regs = { .name = "pxa2xx_timer", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .post_load = pxa25x_timer_post_load, .fields = (VMStateField[]) { VMSTATE_INT32(clock, PXA2xxTimerInfo),
hw/timer/slavio_timer.c +2 -4
@@ -329,8 +329,7 @@ static const VMStateDescription vmstate_timer = { .name ="timer", .version_id = 3, .minimum_version_id = 3, - .minimum_version_id_old = 3, - .fields = (VMStateField []) { + .fields = (VMStateField[]) { VMSTATE_UINT64(limit, CPUTimerState), VMSTATE_UINT32(count, CPUTimerState), VMSTATE_UINT32(counthigh, CPUTimerState),
@@ -345,8 +344,7 @@ static const VMStateDescription vmstate_slavio_timer = { .name ="slavio_timer", .version_id = 3, .minimum_version_id = 3, - .minimum_version_id_old = 3, - .fields = (VMStateField []) { + .fields = (VMStateField[]) { VMSTATE_STRUCT_ARRAY(cputimer, SLAVIO_TIMERState, MAX_CPUS + 1, 3, vmstate_timer, CPUTimerState), VMSTATE_END_OF_LIST()
hw/timer/twl92230.c +2 -4
@@ -772,8 +772,7 @@ static const VMStateDescription vmstate_menelaus_tm = { .name = "menelaus_tm", .version_id = 0, .minimum_version_id = 0, - .minimum_version_id_old = 0, - .fields = (VMStateField []) { + .fields = (VMStateField[]) { VMSTATE_UINT16_HACK(tm_sec, struct tm), VMSTATE_UINT16_HACK(tm_min, struct tm), VMSTATE_UINT16_HACK(tm_hour, struct tm),
@@ -811,10 +810,9 @@ static const VMStateDescription vmstate_menelaus = { .name = "menelaus", .version_id = 0, .minimum_version_id = 0, - .minimum_version_id_old = 0, .pre_save = menelaus_pre_save, .post_load = menelaus_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField[]) { VMSTATE_INT32(firstbyte, MenelausState), VMSTATE_UINT8(reg, MenelausState), VMSTATE_UINT8_ARRAY(vcore, MenelausState, 5),
hw/usb/bus.c +1 -1
@@ -61,7 +61,7 @@ const VMStateDescription vmstate_usb_device = { .version_id = 1, .minimum_version_id = 1, .post_load = usb_device_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField[]) { VMSTATE_UINT8(addr, USBDevice), VMSTATE_INT32(state, USBDevice), VMSTATE_INT32(remote_wakeup, USBDevice),
hw/usb/dev-hid.c +2 -2
@@ -622,7 +622,7 @@ static const VMStateDescription vmstate_usb_ptr = { .version_id = 1, .minimum_version_id = 1, .post_load = usb_ptr_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField[]) { VMSTATE_USB_DEVICE(dev, USBHIDState), VMSTATE_HID_POINTER_DEVICE(hid, USBHIDState), VMSTATE_END_OF_LIST()
@@ -633,7 +633,7 @@ static const VMStateDescription vmstate_usb_kbd = { .name = "usb-kbd", .version_id = 1, .minimum_version_id = 1, - .fields = (VMStateField []) { + .fields = (VMStateField[]) { VMSTATE_USB_DEVICE(dev, USBHIDState), VMSTATE_HID_KEYBOARD_DEVICE(hid, USBHIDState), VMSTATE_END_OF_LIST()
hw/usb/dev-hub.c +2 -2
@@ -540,7 +540,7 @@ static const VMStateDescription vmstate_usb_hub_port = { .name = "usb-hub-port", .version_id = 1, .minimum_version_id = 1, - .fields = (VMStateField []) { + .fields = (VMStateField[]) { VMSTATE_UINT16(wPortStatus, USBHubPort), VMSTATE_UINT16(wPortChange, USBHubPort), VMSTATE_END_OF_LIST()
@@ -551,7 +551,7 @@ static const VMStateDescription vmstate_usb_hub = { .name = "usb-hub", .version_id = 1, .minimum_version_id = 1, - .fields = (VMStateField []) { + .fields = (VMStateField[]) { VMSTATE_USB_DEVICE(dev, USBHubState), VMSTATE_STRUCT_ARRAY(ports, USBHubState, NUM_PORTS, 0, vmstate_usb_hub_port, USBHubPort),
hw/usb/dev-storage.c +1 -1
@@ -716,7 +716,7 @@ static const VMStateDescription vmstate_usb_msd = { .name = "usb-storage", .version_id = 1, .minimum_version_id = 1, - .fields = (VMStateField []) { + .fields = (VMStateField[]) { VMSTATE_USB_DEVICE(dev, MSDState), VMSTATE_UINT32(mode, MSDState), VMSTATE_UINT32(scsi_len, MSDState),
hw/usb/hcd-ehci-pci.c +1 -1
@@ -108,7 +108,7 @@ static const VMStateDescription vmstate_ehci_pci = { .name = "ehci", .version_id = 2, .minimum_version_id = 1, - .fields = (VMStateField[]) { + .fields = (VMStateField[]) { VMSTATE_PCI_DEVICE(pcidev, EHCIPCIState), VMSTATE_STRUCT(ehci, EHCIPCIState, 2, vmstate_ehci, EHCIState), VMSTATE_END_OF_LIST()
hw/usb/hcd-ehci-sysbus.c +1 -1
@@ -21,7 +21,7 @@ static const VMStateDescription vmstate_ehci_sysbus = { .name = "ehci-sysbus", .version_id = 2, .minimum_version_id = 1, - .fields = (VMStateField[]) { + .fields = (VMStateField[]) { VMSTATE_STRUCT(ehci, EHCISysBusState, 2, vmstate_ehci, EHCIState), VMSTATE_END_OF_LIST() }
hw/usb/hcd-ehci.c +1 -1
@@ -2492,7 +2492,7 @@ const VMStateDescription vmstate_ehci = { .minimum_version_id = 1, .pre_save = usb_ehci_pre_save, .post_load = usb_ehci_post_load, - .fields = (VMStateField[]) { + .fields = (VMStateField[]) { /* mmio registers */ VMSTATE_UINT32(usbcmd, EHCIState), VMSTATE_UINT32(usbsts, EHCIState),
hw/usb/hcd-uhci.c +2 -4
@@ -422,8 +422,7 @@ static const VMStateDescription vmstate_uhci_port = { .name = "uhci port", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField[]) { VMSTATE_UINT16(ctrl, UHCIPort), VMSTATE_END_OF_LIST() }
@@ -444,9 +443,8 @@ static const VMStateDescription vmstate_uhci = { .name = "uhci", .version_id = 3, .minimum_version_id = 1, - .minimum_version_id_old = 1, .post_load = uhci_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField[]) { VMSTATE_PCI_DEVICE(dev, UHCIState), VMSTATE_UINT8_EQUAL(num_ports_vmstate, UHCIState), VMSTATE_STRUCT_ARRAY(ports, UHCIState, NB_PORTS, 1,
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
@@ -90,8 +90,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() }
hw/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()
target-alpha/machine.c +0 -2
@@ -72,7 +72,6 @@ static const VMStateDescription vmstate_env = { .name = "env", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .fields = vmstate_env_fields, };
@@ -86,6 +85,5 @@ const VMStateDescription vmstate_alpha_cpu = { .name = "cpu", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .fields = vmstate_cpu_fields, };
target-arm/machine.c +0 -5
@@ -39,7 +39,6 @@ static const VMStateDescription vmstate_vfp = { .name = "cpu/vfp", .version_id = 3, .minimum_version_id = 3, - .minimum_version_id_old = 3, .fields = (VMStateField[]) { VMSTATE_FLOAT64_ARRAY(env.vfp.regs, ARMCPU, 64), /* The xregs array is a little awkward because element 1 (FPSCR)
@@ -72,7 +71,6 @@ static const VMStateDescription vmstate_iwmmxt = { .name = "cpu/iwmmxt", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .fields = (VMStateField[]) { VMSTATE_UINT64_ARRAY(env.iwmmxt.regs, ARMCPU, 16), VMSTATE_UINT32_ARRAY(env.iwmmxt.cregs, ARMCPU, 16),
@@ -92,7 +90,6 @@ static const VMStateDescription vmstate_m = { .name = "cpu/m", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .fields = (VMStateField[]) { VMSTATE_UINT32(env.v7m.other_sp, ARMCPU), VMSTATE_UINT32(env.v7m.vecbase, ARMCPU),
@@ -116,7 +113,6 @@ static const VMStateDescription vmstate_thumb2ee = { .name = "cpu/thumb2ee", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, .fields = (VMStateField[]) { VMSTATE_UINT32(env.teecr, ARMCPU), VMSTATE_UINT32(env.teehbr, ARMCPU),
@@ -224,7 +220,6 @@ const VMStateDescription vmstate_arm_cpu = { .name = "cpu", .version_id = 14, .minimum_version_id = 14, - .minimum_version_id_old = 14, .pre_save = cpu_pre_save, .post_load = cpu_post_load, .fields = (VMStateField[]) {
target-i386/machine.c +19 -38
171 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
1.9.0
Part of the diff is not shown here. View the raw message.
Re: [Qemu-devel] [PATCH 02/97] savevm: Remove all the unneded version_minimum_id_old (Massive)
Quoted 8 lines · Juan Quintela
After previous Peter patch, they are redundant. This way we don't asign them except when needed. Once there, there were lots of case where the ".fields" indentation was wrong:
.fields = (VMStateField []) { and .fields = (VMStateField []) {
Quoted 8 lines
Change all the combinations to:
.fields = (VMStateField[]){The biggest problem (appart of aesthetics) was that checkpatch complained when we copy&pasted the code from one place to another.
211 files changed, 289 insertions(+), 621 deletions(-)
I'm really not a fan of this kind of single patch that touches a huge number of files at once. They're basically impossible to review and they introduce the possibility of conflicts between submaintainer tree changes and the big patch. There's no reason to have all these changes in a single patch -- I'd much rather see one patch per subsystem sent to the relevant submaintainers, plus one for all the unmaintained stuff which can go via the migration tree.
thanks
-- PMM
Re: [Qemu-devel] [PATCH 02/97] savevm: Remove all the unneded version_minimum_id_old (Massive)
Quoted 18 lines · Peter Maydell
Quoted 8 lines · Juan Quintela
After previous Peter patch, they are redundant. This way we don't asign them except when needed. Once there, there were lots of case where the ".fields" indentation was wrong:
.fields = (VMStateField []) { and .fields = (VMStateField []) {Quoted 8 lines
Change all the combinations to:
.fields = (VMStateField[]){The biggest problem (appart of aesthetics) was that checkpatch complained when we copy&pasted the code from one place to another.
211 files changed, 289 insertions(+), 621 deletions(-)
Quoted 9 lines
I'm really not a fan of this kind of single patch that touches a huge number of files at once. They're basically impossible to review and they introduce the possibility of conflicts between submaintainer tree changes and the big patch. There's no reason to have all these changes in a single patch -- I'd much rather see one patch per subsystem sent to the relevant submaintainers, plus one for all the unmaintained stuff which can go via the migration tree.
If you say how to split, I am all for it. But remomeber that all this changes go inside VMSTateDescription descriptions, touch nothing else outside of that. And that is not something that is touched a lot to have lots of conflicts.
My problem with leaving things as are, is that people continue to copy from the ones that still use the old system/format :-(
Later, Juan.
Re: [Qemu-devel] [PATCH 02/97] savevm: Remove all the unneded version_minimum_id_old (Massive)
Quoted 11 lines · Juan Quintela
Quoted 9 lines · Peter Maydell
I'm really not a fan of this kind of single patch that touches a huge number of files at once. They're basically impossible to review and they introduce the possibility of conflicts between submaintainer tree changes and the big patch. There's no reason to have all these changes in a single patch -- I'd much rather see one patch per subsystem sent to the relevant submaintainers, plus one for all the unmaintained stuff which can go via the migration tree.
Quoted 1 line
If you say how to split, I am all for it.
Like I said, one patch per maintained subsystem,
one patch for the leftovers.
thanks
-- PMM
Re: [Qemu-devel] [PATCH 02/97] savevm: Remove all the unneded version_minimum_id_old (Massive)
Quoted 12 lines · Peter Maydell
Quoted 11 lines · Juan Quintela
Quoted 9 lines · Peter Maydell
I'm really not a fan of this kind of single patch that touches a huge number of files at once. They're basically impossible to review and they introduce the possibility of conflicts between submaintainer tree changes and the big patch. There's no reason to have all these changes in a single patch -- I'd much rather see one patch per subsystem sent to the relevant submaintainers, plus one for all the unmaintained stuff which can go via the migration tree.
Quoted 4 lines
Quoted 1 line
If you say how to split, I am all for it.
Like I said, one patch per maintained subsystem,
one patch for the leftovers.
Easier said than done. MAINTAINERS has more than 100 sections, yet it leaves more than 1200 files uncovered, roughly half of them C sources. I doubt splitting mechanically along those sections plus a catch-all patch for the "unmaintained" files would be appreciated.
Could you give some guidance on splitting?
Re: [Qemu-devel] [PATCH 02/97] savevm: Remove all the unneded version_minimum_id_old (Massive)
Quoted 7 lines · Markus Armbruster
Quoted 4 lines · Peter Maydell
Quoted 1 line · Juan Quintela
Peter Maydell <[email protected]> wrote:
Like I said, one patch per maintained subsystem,
one patch for the leftovers.
Quoted 6 lines
Easier said than done.
MAINTAINERShas more than 100 sections, yet it leaves more than 1200 files uncovered, roughly half of them C sources. I doubt splitting mechanically along those sections plus a catch-all patch for the "unmaintained" files would be appreciated.Could you give some guidance on splitting?
Well, I would just eyeball the filenames. If you had a patch with the ARM related stuff, a patch for the things that are x86 PC devices, one for the PPC devices, and a USB patch, that ought to whittle the list down a fair amount.
thanks
-- PMM
Re: [Qemu-devel] [PATCH 02/97] savevm: Remove all the unneded version_minimum_id_old (Massive)
Quoted 13 lines · Peter Maydell
Quoted 12 lines · Markus Armbruster
Quoted 4 lines · Peter Maydell
Quoted 1 line · Juan Quintela
Peter Maydell <[email protected]> wrote:
Like I said, one patch per maintained subsystem,
one patch for the leftovers.Easier said than done.
MAINTAINERShas more than 100 sections, yet it leaves more than 1200 files uncovered, roughly half of them C sources. I doubt splitting mechanically along those sections plus a catch-all patch for the "unmaintained" files would be appreciated.
Quoted 7 lines
Quoted 1 line
Could you give some guidance on splitting?
Well, I would just eyeball the filenames. If you had a patch with the ARM related stuff, a patch for the things that are x86 PC devices, one for the PPC devices, and a USB patch, that ought to whittle the list down a fair amount.
Thanks. Will do.
Later, Juan.
Re: [Qemu-devel] [PATCH 02/97] savevm: Remove all the unneded version_minimum_id_old (Massive)
In reply to Markus ArmbrusterQuoted 19 lines · Markus Armbruster
Quoted 12 lines · Peter Maydell
Quoted 11 lines · Juan Quintela
Quoted 9 lines · Peter Maydell
I'm really not a fan of this kind of single patch that touches a huge number of files at once. They're basically impossible to review and they introduce the possibility of conflicts between submaintainer tree changes and the big patch. There's no reason to have all these changes in a single patch -- I'd much rather see one patch per subsystem sent to the relevant submaintainers, plus one for all the unmaintained stuff which can go via the migration tree.
Quoted 4 lines
Quoted 1 line
If you say how to split, I am all for it.
Like I said, one patch per maintained subsystem,
one patch for the leftovers.
Quoted 6 lines
Easier said than done.
MAINTAINERShas more than 100 sections, yet it leaves more than 1200 files uncovered, roughly half of them C sources. I doubt splitting mechanically along those sections plus a catch-all patch for the "unmaintained" files would be appreciated.Could you give some guidance on splitting?
+1
PATCH 3/97 vmstate: return error in case of error
In reply to Juan QuintelaIf there is an error while loading a field, we should stop reading and not continue with the rest of fields.
--- vmstate.c | 3 +++ 1 file changed, 3 insertions(+)
vmstate.c +3 -0
@@ -74,6 +74,9 @@ int vmstate_load_state(QEMUFile *f, const VMStateDescription *vmsd, ret = field->info->get (f, addr, size); } +if (ret >=0 ) { + ret =qemu_file_get_error (f); + }if (ret <0 ) {trace_vmstate_load_field_error (field->name, ret);return ret;
Signature · 1 line
1.9.0
Re: [Qemu-devel] [PATCH 03/97] vmstate: return error in case of error
Quoted 4 lines · * Juan Quintela ([email protected]) wrote:
If there is an error while loading a field, we should stop reading and not continue with the rest of fields.
Signed-off-by Juan Quintela <[email protected]>
Quoted 22 lines
--- vmstate.c | 3 +++ 1 file changed, 3 insertions(+)vmstate.c +3
-0@@ -74,6 +74,9 @@ int vmstate_load_state(QEMUFile *f, const VMStateDescription *vmsd, ret = field->info->get (f, addr, size); } +if (ret >=0 ) { + ret =qemu_file_get_error (f); + }if (ret <0 ) {trace_vmstate_load_field_error (field->name, ret);return ret;Signature · 1 line
1.9.0
--
Dr. David Alan Gilbert / [email protected] / Manchester, UK
PATCH 4/97 vmstate: reduce code duplication
In reply to Juan QuintelaFrom: "Michael S. Tsirkin" <[email protected]>
move size offset and number of elements math out to functions, to reduce code duplication.
--- vmstate.c | 100 ++++++++++++++++++++++++++++++++------------------------------ 1 file changed, 52 insertions(+), 48 deletions(-)
vmstate.c +52 -48
@@ -10,6 +10,50 @@ static void vmstate_subsection_save(QEMUFile *f, const VMStateDescription *vmsd,static int vmstate_subsection_load (QEMUFile *f,const VMStateDescription *vmsd,void *opaque); +static int vmstate_n_elems (void *opaque,VMStateField *field) +{ +int n_elems =1 ; + +if (field->flags &VMS_ARRAY ) { + n_elems = field->num; + }else if (field->flags &VMS_VARRAY_INT32 ) { + n_elems = *(int32_t *)(opaque+field->num_offset); + }else if (field->flags &VMS_VARRAY_UINT32 ) { + n_elems = *(uint32_t *)(opaque+field->num_offset); + }else if (field->flags &VMS_VARRAY_UINT16 ) { + n_elems = *(uint16_t *)(opaque+field->num_offset); + }else if (field->flags &VMS_VARRAY_UINT8 ) { + n_elems = *(uint8_t *)(opaque+field->num_offset); + } + +return n_elems; +} + +static int vmstate_size (void *opaque,VMStateField *field) +{ +int size = field->size; + +if (field->flags &VMS_VBUFFER ) { + size = *(int32_t *)(opaque+field->size_offset); +if (field->flags &VMS_MULTIPLY ) { + size *= field->size; + } + } + +return size; +} + +static void *vmstate_base_addr (void *opaque,VMStateField *field) +{ +void *base_addr = opaque + field->offset; + +if (field->flags &VMS_POINTER ) { + base_addr = *(void **)base_addr + field->start; + } + +return base_addr; +} +int vmstate_load_state (QEMUFile *f,const VMStateDescription *vmsd,void *opaque,int version_id) {
@@ -37,30 +81,10 @@ int vmstate_load_state(QEMUFile *f, const VMStateDescription *vmsd, field->field_exists(opaque, version_id)) || (!field->field_exists && field->version_id <= version_id)) { - void *base_addr = opaque + field->offset; -int i, n_elems =1 ; -int size = field->size; - -if (field->flags &VMS_VBUFFER ) { - size = *(int32_t *)(opaque+field->size_offset); -if (field->flags &VMS_MULTIPLY ) { - size *= field->size; - } - } -if (field->flags &VMS_ARRAY ) { - n_elems = field->num; - }else if (field->flags &VMS_VARRAY_INT32 ) { - n_elems = *(int32_t *)(opaque+field->num_offset); - }else if (field->flags &VMS_VARRAY_UINT32 ) { - n_elems = *(uint32_t *)(opaque+field->num_offset); - }else if (field->flags &VMS_VARRAY_UINT16 ) { - n_elems = *(uint16_t *)(opaque+field->num_offset); - }else if (field->flags &VMS_VARRAY_UINT8 ) { - n_elems = *(uint8_t *)(opaque+field->num_offset); - } -if (field->flags &VMS_POINTER ) { - base_addr = *(void **)base_addr + field->start; - } + void *base_addr = vmstate_base_addr(opaque, field); +int i, n_elems =vmstate_n_elems (opaque, field); +int size =vmstate_size (opaque, field); +for (i =0 ; i < n_elems; i++) {void *addr = base_addr + size * i;
@@ -106,30 +130,10 @@ void vmstate_save_state(QEMUFile *f, const VMStateDescription *vmsd,while (field->name) {if (!field->field_exists || field->field_exists (opaque, vmsd->version_id)) { -void *base_addr = opaque + field->offset; -int i, n_elems =1 ; -int size = field->size; - -if (field->flags &VMS_VBUFFER ) { - size = *(int32_t *)(opaque+field->size_offset); -if (field->flags &VMS_MULTIPLY ) { - size *= field->size; - } - } -if (field->flags &VMS_ARRAY ) { - n_elems = field->num; - }else if (field->flags &VMS_VARRAY_INT32 ) { - n_elems = *(int32_t *)(opaque+field->num_offset); - }else if (field->flags &VMS_VARRAY_UINT32 ) { - n_elems = *(uint32_t *)(opaque+field->num_offset); - }else if (field->flags &VMS_VARRAY_UINT16 ) { - n_elems = *(uint16_t *)(opaque+field->num_offset); - }else if (field->flags &VMS_VARRAY_UINT8 ) { - n_elems = *(uint8_t *)(opaque+field->num_offset); - } -if (field->flags &VMS_POINTER ) { - base_addr = *(void **)base_addr + field->start; - } +void *base_addr =vmstate_base_addr (opaque, field); +int i, n_elems =vmstate_n_elems (opaque, field); +int size =vmstate_size (opaque, field); +for (i =0 ; i < n_elems; i++) {void *addr = base_addr + size * i;
Signature · 1 line
1.9.0
PATCH 5/97 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.0
Re: [Qemu-devel] [PATCH 05/97] vmstate: refactor opening of files
Quoted 1 line · Juan Quintela
Signed-off-by Juan Quintela <[email protected]>
Signature · 1 line
Eduardo
PATCH 6/97 vmstate: Refactor & increase tests for primitive types
In reply to Juan QuintelaThis commit refactor the simple tests to test all integer types. We move to hex because it is easier to read values of different types.
--- tests/test-vmstate.c | 195 +++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 150 insertions(+), 45 deletions(-)
tests/test-vmstate.c +150 -45
@@ -54,80 +54,186 @@ static QEMUFile *open_test_file(bool write)return qemu_fdopen (fd, write ?"wb" :"rb" ); } -typedef struct TestSruct { -uint32_t a, b, c, e; -uint64_t d, f; -bool skip_c_e; -}TestStruct ; +/* Test struct that we are going to use for our tests */ + +typedef struct TestSimple { +bool b_1, b_2; +uint8_t u8_1, u8_2; +uint16_t u16_1, u16_2; +uint32_t u32_1, u32_2; +uint64_t u64_1, u64_2; +int8_t i8_1, i8_2; +int16_t i16_1, i16_2; +int32_t i32_1, i32_2; +int64_t i64_1, i64_2; +}TestSimple ; + +/* Object instantiation, we are going to use it in more than one test */ + +TestSimple obj_simple = { + .b_1 = true, + .b_2 = false, + .u8_1 =129 , + .u8_1 =130 , + .u16_1 =512 , + .u16_2 =45000 , + .u32_1 =70000 , + .u32_2 =100000 , + .u64_1 =12121212 , + .u64_2 =23232323 , + .i8_1 =65 , + .i8_2 =-65 , + .i16_1 =512 , + .i16_2 =-512 , + .i32_1 =70000 , + .i32_2 =-70000 , + .i64_1 =12121212 , + .i64_2 =-12121212 , +}; +/* Description of the values. If you add a primitive type +you are expected to add a test here */ -static const VMStateDescription vmstate_simple = { - .name ="test" , +static const VMStateDescription vmstate_simple_primitive = { + .name ="simple/primitive" , .version_id =1 , .minimum_version_id =1 , .fields = (VMStateField []) { -VMSTATE_UINT32 (a, TestStruct), -VMSTATE_UINT32 (b, TestStruct), -VMSTATE_UINT32 (c, TestStruct), -VMSTATE_UINT64 (d, TestStruct), +VMSTATE_BOOL (b_1, TestSimple), +VMSTATE_BOOL (b_2, TestSimple), +VMSTATE_UINT8 (u8_1, TestSimple), +VMSTATE_UINT16 (u16_1, TestSimple), +VMSTATE_UINT32 (u32_1, TestSimple), +VMSTATE_UINT64 (u64_1, TestSimple), +VMSTATE_INT8 (i8_1, TestSimple), +VMSTATE_INT8 (i8_2, TestSimple), +VMSTATE_INT16 (i16_1, TestSimple), +VMSTATE_INT16 (i16_2, TestSimple), +VMSTATE_INT32 (i32_1, TestSimple), +VMSTATE_INT32 (i32_2, TestSimple), +VMSTATE_INT64 (i64_1, TestSimple), +VMSTATE_INT64 (i64_2, TestSimple),VMSTATE_END_OF_LIST () } }; -static void test_simple_save (void ) +/* It describes what goes through the wire. Our tests are basically: + +* save test +- save a struct a vmstate to a file +- read that file back (binary read, no vmstate) +- compare it with what we expect to be on the wire +* load test +- save to the file what we expect to be on the wire +- read struct back with vmstate in a different +- compare back with the original struct +*/ + +uint8_t wire_simple_primitive[] = { +/* b_1 */ 0x01 , +/* b_2 */ 0x00 , +/* u8_1 */ 0x82 , +/* u16_1 */ 0x02 ,0x00 , +/* u32_1 */ 0x00 ,0x01 ,0x11 ,0x70 , +/* u64_1 */ 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0xb8 ,0xf4 ,0x7c , +/* i8_1 */ 0x41 , +/* i8_2 */ 0xbf , +/* i16_1 */ 0x02 ,0x00 , +/* i16_2 */ 0xfe ,0x0 , +/* i32_1 */ 0x00 ,0x01 ,0x11 ,0x70 , +/* i32_2 */ 0xff ,0xfe ,0xee ,0x90 , +/* i64_1 */ 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0xb8 ,0xf4 ,0x7c , +/* i64_2 */ 0xff ,0xff ,0xff ,0xff ,0xff ,0x47 ,0x0b ,0x84 , +QEMU_VM_EOF ,/* just to ensure we won't get EOF reported prematurely */ +}; + +#define SUCCESS (val) \ + g_assert_cmpint((val), ==, 0) + +#define FAILURE (val) \ + g_assert_cmpint((val), !=, 0) + +static void test_simple_primitive (void ) {QEMUFile *fsave =open_test_file (true); -TestStruct obj = { .a =1 , .b =2 , .c =3 , .d =4 }; -vmstate_save_state (fsave, &vmstate_simple, &obj); + +/* Save file with vmstate */ +vmstate_save_state (fsave, &vmstate_simple_primitive, &obj_simple);g_assert (!qemu_file_get_error (fsave));qemu_fclose (fsave);QEMUFile *loading =open_test_file (false); -uint8_t expected[] = { -0 ,0 ,0 ,1 ,/* a */ -0 ,0 ,0 ,2 ,/* b */ -0 ,0 ,0 ,3 ,/* c */ -0 ,0 ,0 ,0 ,0 ,0 ,0 ,4 ,/* d */ - }; -uint8_t result[sizeof (expected)]; +/* we don't need QEMU_VM_EOF */ +uint8_t result[sizeof (wire_simple_primitive)-1 ]; + +/* read back as binary */ + g_assert_cmpint(qemu_get_buffer(loading, result, sizeof(result)), ==,sizeof (result));g_assert (!qemu_file_get_error (loading)); - g_assert_cmpint(memcmp(result, expected, sizeof(result)), ==, 0); + +/* Compare that what is on the file is the same that what we +expected to be there */ +SUCCESS (memcmp (result, wire_simple_primitive,sizeof (result)));/* Must reach EOF */ qemu_get_byte (loading); g_assert_cmpint(qemu_file_get_error(loading), ==, -EIO);qemu_fclose (loading); -} -static void test_simple_load (void ) -{ -QEMUFile *fsave =open_test_file (true); -uint8_t buf[] = { -0 ,0 ,0 ,10 ,/* a */ -0 ,0 ,0 ,20 ,/* b */ -0 ,0 ,0 ,30 ,/* c */ -0 ,0 ,0 ,0 ,0 ,0 ,0 ,40 ,/* d */ -QEMU_VM_EOF ,/* just to ensure we won't get EOF reported prematurely */ - }; -qemu_put_buffer (fsave, buf,sizeof (buf)); +/* We save the file again. We want the EOF this time */ + + fsave =open_test_file (true); +qemu_put_buffer (fsave, wire_simple_primitive, +sizeof (wire_simple_primitive));qemu_fclose (fsave); -QEMUFile *loading =open_test_file (false); -TestStruct obj; -vmstate_load_state (loading, &vmstate_simple, &obj,1 ); + loading =open_test_file (false); +TestSimple obj; +SUCCESS (vmstate_load_state (loading, &vmstate_simple_primitive, &obj,1 ));g_assert (!qemu_file_get_error (loading)); - g_assert_cmpint(obj.a, ==, 10); - g_assert_cmpint(obj.b, ==, 20); - g_assert_cmpint(obj.c, ==, 30); - g_assert_cmpint(obj.d, ==, 40); + +#define FIELD_ASSERT (name) g_assert_cmpint(obj.name, ==, obj_simple.name) +FIELD_ASSERT (b_1); +FIELD_ASSERT (b_2); +FIELD_ASSERT (u8_1); +FIELD_ASSERT (u16_1); +FIELD_ASSERT (u32_1); +FIELD_ASSERT (u64_1); +FIELD_ASSERT (i8_1); +FIELD_ASSERT (i8_2); +FIELD_ASSERT (i16_1); +FIELD_ASSERT (i16_2); +FIELD_ASSERT (i32_1); +FIELD_ASSERT (i32_2); +FIELD_ASSERT (i64_1); +FIELD_ASSERT (i64_2); +#undef FIELD_ASSERT + +/* We save the file again. We want the EOF this time */ + + fsave =open_test_file (true); +/* this time we don't write the whole file */ +qemu_put_buffer (fsave, wire_simple_primitive,10 ); +qemu_fclose (fsave); + + loading =open_test_file (false); +FAILURE (vmstate_load_state (loading, &vmstate_simple_primitive, &obj,1 )); + +/* Now it has to have an error */ +g_assert (qemu_file_get_error (loading));qemu_fclose (loading); } +typedef struct TestStruct { +uint32_t a, b, c, e; +uint64_t d, f; +bool skip_c_e; +}TestStruct ; +static const VMStateDescription vmstate_versioned = { - .name ="test" , + .name ="test/versioned" , .version_id =2 , .minimum_version_id =1 , .fields = (VMStateField []) {
@@ -202,7 +308,7 @@ static bool test_skip(void *opaque, int version_id) }static const VMStateDescription vmstate_skipping = { - .name ="test" , + .name ="test/skip" , .version_id =2 , .minimum_version_id =1 , .fields = (VMStateField []) {
@@ -337,8 +443,7 @@ int main(int argc, char **argv) temp_fd =mkstemp (temp_file);g_test_init (&argc, &argv,NULL ); -g_test_add_func ("/vmstate/simple/save" , test_simple_save); -g_test_add_func ("/vmstate/simple/load" , test_simple_load); +g_test_add_func ("/vmstate/simple/primitive" , test_simple_primitive);g_test_add_func ("/vmstate/versioned/load/v1" , test_load_v1);g_test_add_func ("/vmstate/versioned/load/v2" , test_load_v2);g_test_add_func ("/vmstate/field_exists/load/noskip" , test_load_noskip);
Signature · 1 line
1.9.0
Re: [Qemu-devel] [PATCH 06/97] vmstate: Refactor & increase tests for primitive types
Quoted 110 lines · Juan Quintela
This commit refactor the simple tests to test all integer types. We move to hex because it is easier to read values of different types.
Signed-off-by Juan Quintela <[email protected]>--- tests/test-vmstate.c | 195 +++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 150 insertions(+), 45 deletions(-)tests/test-vmstate.c +73
-12@@ -54,80 +54,186 @@ static QEMUFile *open_test_file(bool write)return qemu_fdopen (fd, write ?"wb" :"rb" ); } -typedef struct TestSruct { -uint32_t a, b, c, e; -uint64_t d, f; -bool skip_c_e; -}TestStruct ; +/* Test struct that we are going to use for our tests */ + +typedef struct TestSimple { +bool b_1, b_2; +uint8_t u8_1, u8_2; +uint16_t u16_1, u16_2; +uint32_t u32_1, u32_2; +uint64_t u64_1, u64_2; +int8_t i8_1, i8_2; +int16_t i16_1, i16_2; +int32_t i32_1, i32_2; +int64_t i64_1, i64_2; +}TestSimple ; + +/* Object instantiation, we are going to use it in more than one test */ + +TestSimple obj_simple = { + .b_1 = true, + .b_2 = false, + .u8_1 =129 , + .u8_1 =130 , + .u16_1 =512 , + .u16_2 =45000 , + .u32_1 =70000 , + .u32_2 =100000 , + .u64_1 =12121212 , + .u64_2 =23232323 , + .i8_1 =65 , + .i8_2 =-65 , + .i16_1 =512 , + .i16_2 =-512 , + .i32_1 =70000 , + .i32_2 =-70000 , + .i64_1 =12121212 , + .i64_2 =-12121212 , +}; +/* Description of the values. If you add a primitive type +you are expected to add a test here */ -static const VMStateDescription vmstate_simple = { - .name ="test" , +static const VMStateDescription vmstate_simple_primitive = { + .name ="simple/primitive" , .version_id =1 , .minimum_version_id =1 , .fields = (VMStateField []) { -VMSTATE_UINT32 (a, TestStruct), -VMSTATE_UINT32 (b, TestStruct), -VMSTATE_UINT32 (c, TestStruct), -VMSTATE_UINT64 (d, TestStruct), +VMSTATE_BOOL (b_1, TestSimple), +VMSTATE_BOOL (b_2, TestSimple), +VMSTATE_UINT8 (u8_1, TestSimple), +VMSTATE_UINT16 (u16_1, TestSimple), +VMSTATE_UINT32 (u32_1, TestSimple), +VMSTATE_UINT64 (u64_1, TestSimple), +VMSTATE_INT8 (i8_1, TestSimple), +VMSTATE_INT8 (i8_2, TestSimple), +VMSTATE_INT16 (i16_1, TestSimple), +VMSTATE_INT16 (i16_2, TestSimple), +VMSTATE_INT32 (i32_1, TestSimple), +VMSTATE_INT32 (i32_2, TestSimple), +VMSTATE_INT64 (i64_1, TestSimple), +VMSTATE_INT64 (i64_2, TestSimple),VMSTATE_END_OF_LIST () } }; -static void test_simple_save (void ) +/* It describes what goes through the wire. Our tests are basically: + +* save test +- save a struct a vmstate to a file +- read that file back (binary read, no vmstate) +- compare it with what we expect to be on the wire +* load test +- save to the file what we expect to be on the wire +- read struct back with vmstate in a different +- compare back with the original struct +*/ + +uint8_t wire_simple_primitive[] = { +/* b_1 */ 0x01 , +/* b_2 */ 0x00 , +/* u8_1 */ 0x82 , +/* u16_1 */ 0x02 ,0x00 , +/* u32_1 */ 0x00 ,0x01 ,0x11 ,0x70 , +/* u64_1 */ 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0xb8 ,0xf4 ,0x7c ,
tests/test-vmstate.c static QEMUFile *open_test_file(bool write) · line 148
Quoted 10 lines
tests/test-vmstate.c +10
-0+/* i8_1 */ 0x41 , +/* i8_2 */ 0xbf , +/* i16_1 */ 0x02 ,0x00 , +/* i16_2 */ 0xfe ,0x0 , +/* i32_1 */ 0x00 ,0x01 ,0x11 ,0x70 , +/* i32_2 */ 0xff ,0xfe ,0xee ,0x90 , +/* i64_1 */ 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0xb8 ,0xf4 ,0x7c , +/* i64_2 */ 0xff ,0xff ,0xff ,0xff ,0xff ,0x47 ,0x0b ,0x84 , + QEMU_VM_EOF, /* just to ensure we won't get EOF reported prematurely */ +};
Nice job. I was too lazy to test every single type. :-)
tests/test-vmstate.c static QEMUFile *open_test_file(bool write) · line 151
Quoted 3 lines
tests/test-vmstate.c +3
-0+ +#define SUCCESS (val) \ + g_assert_cmpint((val), ==, 0)
Isn't this the same as g_assert(!val)?
tests/test-vmstate.c static QEMUFile *open_test_file(bool write) · line 154
Quoted 3 lines
tests/test-vmstate.c +3
-0+ +#define FAILURE (val) \ + g_assert_cmpint((val), !=, 0)
Isn't this the same as g_assert(val)?
I know, it is my fault as I have written the g_assert_cmpint(..., 0) code in the first place. :)
Quoted 77 lines
tests/test-vmstate.c +29
-29+ +static void test_simple_primitive (void ) {QEMUFile *fsave =open_test_file (true); -TestStruct obj = { .a =1 , .b =2 , .c =3 , .d =4 }; -vmstate_save_state (fsave, &vmstate_simple, &obj); + +/* Save file with vmstate */ +vmstate_save_state (fsave, &vmstate_simple_primitive, &obj_simple);g_assert (!qemu_file_get_error (fsave));qemu_fclose (fsave);QEMUFile *loading =open_test_file (false); -uint8_t expected[] = { -0 ,0 ,0 ,1 ,/* a */ -0 ,0 ,0 ,2 ,/* b */ -0 ,0 ,0 ,3 ,/* c */ -0 ,0 ,0 ,0 ,0 ,0 ,0 ,4 ,/* d */ - }; -uint8_t result[sizeof (expected)]; +/* we don't need QEMU_VM_EOF */ +uint8_t result[sizeof (wire_simple_primitive)-1 ]; + +/* read back as binary */ + g_assert_cmpint(qemu_get_buffer(loading, result, sizeof(result)), ==,sizeof (result));g_assert (!qemu_file_get_error (loading)); - g_assert_cmpint(memcmp(result, expected, sizeof(result)), ==, 0); + +/* Compare that what is on the file is the same that what we +expected to be there */ +SUCCESS (memcmp (result, wire_simple_primitive,sizeof (result)));/* Must reach EOF */ qemu_get_byte (loading); g_assert_cmpint(qemu_file_get_error(loading), ==, -EIO);qemu_fclose (loading); -} -static void test_simple_load (void ) -{ -QEMUFile *fsave =open_test_file (true); -uint8_t buf[] = { -0 ,0 ,0 ,10 ,/* a */ -0 ,0 ,0 ,20 ,/* b */ -0 ,0 ,0 ,30 ,/* c */ -0 ,0 ,0 ,0 ,0 ,0 ,0 ,40 ,/* d */ -QEMU_VM_EOF ,/* just to ensure we won't get EOF reported prematurely */ - }; -qemu_put_buffer (fsave, buf,sizeof (buf)); +/* We save the file again. We want the EOF this time */ + + fsave =open_test_file (true); +qemu_put_buffer (fsave, wire_simple_primitive, +sizeof (wire_simple_primitive));qemu_fclose (fsave); -QEMUFile *loading =open_test_file (false); -TestStruct obj; -vmstate_load_state (loading, &vmstate_simple, &obj,1 ); + loading =open_test_file (false); +TestSimple obj; +SUCCESS (vmstate_load_state (loading, &vmstate_simple_primitive, &obj,1 ));g_assert (!qemu_file_get_error (loading)); - g_assert_cmpint(obj.a, ==, 10); - g_assert_cmpint(obj.b, ==, 20); - g_assert_cmpint(obj.c, ==, 30); - g_assert_cmpint(obj.d, ==, 40); + +#define FIELD_ASSERT (name) g_assert_cmpint(obj.name, ==, obj_simple.name) +FIELD_ASSERT (b_1); +FIELD_ASSERT (b_2); +FIELD_ASSERT (u8_1); +FIELD_ASSERT (u16_1); +FIELD_ASSERT (u32_1);
tests/test-vmstate.c static QEMUFile *open_test_file(bool write) · line 212
Quoted 10 lines
tests/test-vmstate.c +10
-0+FIELD_ASSERT (u64_1); +FIELD_ASSERT (i8_1); +FIELD_ASSERT (i8_2); +FIELD_ASSERT (i16_1); +FIELD_ASSERT (i16_2); +FIELD_ASSERT (i32_1); +FIELD_ASSERT (i32_2); +FIELD_ASSERT (i64_1); +FIELD_ASSERT (i64_2); +#undef FIELD_ASSERT
I wonder if we could do something to allow us to safely simplify this to use memcmp(). Looks good, anyway.
tests/test-vmstate.c static QEMUFile *open_test_file(bool write) · line 219
Quoted 7 lines
tests/test-vmstate.c +7
-0+ +/* We save the file again. We want the EOF this time */ + + fsave =open_test_file (true); +/* this time we don't write the whole file */ +qemu_put_buffer (fsave, wire_simple_primitive,10 ); +qemu_fclose (fsave);
What about not just testing if it fails with 10 bytes, but checking all possible lengths from 0 to N-1 bytes? With this check we are only testing if the u64 loader handles EOF as expected. If subtle bugs are going to be introduced in EOF checking, I find them more likely in corner cases such as length==0, length==1 and lenght==N-1.
Quoted 44 lines
tests/test-vmstate.c +15
-4+ + loading =open_test_file (false); +FAILURE (vmstate_load_state (loading, &vmstate_simple_primitive, &obj,1 )); + +/* Now it has to have an error */ +g_assert (qemu_file_get_error (loading));qemu_fclose (loading); } +typedef struct TestStruct { +uint32_t a, b, c, e; +uint64_t d, f; +bool skip_c_e; +}TestStruct ; +static const VMStateDescription vmstate_versioned = { - .name ="test" , + .name ="test/versioned" , .version_id =2 , .minimum_version_id =1 , .fields = (VMStateField []) {@@ -202,7 +308,7 @@ static bool test_skip(void *opaque, int version_id) }static const VMStateDescription vmstate_skipping = { - .name ="test" , + .name ="test/skip" , .version_id =2 , .minimum_version_id =1 , .fields = (VMStateField []) {@@ -337,8 +443,7 @@ int main(int argc, char **argv) temp_fd =mkstemp (temp_file);g_test_init (&argc, &argv,NULL ); -g_test_add_func ("/vmstate/simple/save" , test_simple_save); -g_test_add_func ("/vmstate/simple/load" , test_simple_load); +g_test_add_func ("/vmstate/simple/primitive" , test_simple_primitive);g_test_add_func ("/vmstate/versioned/load/v1" , test_load_v1);g_test_add_func ("/vmstate/versioned/load/v2" , test_load_v2);g_test_add_func ("/vmstate/field_exists/load/noskip" , test_load_noskip);Signature · 1 line
1.9.0
Signature · 1 line
Eduardo
PATCH 7/97 vmstate: create test functions for versions until 15
In reply to Juan QuintelaUsing macros, just to avoid repeating code.
--- include/migration/vmstate.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
include/migration/vmstate.h +22 -0
@@ -769,4 +769,26 @@ void vmstate_register_ram(struct MemoryRegion *memory, DeviceState *dev);void vmstate_unregister_ram (struct MemoryRegion *memory,DeviceState *dev);void vmstate_register_ram_global (struct MemoryRegion *memory); +/* version is X or bigger */ +#define VMSTATE_X_PLUS (X )\ +static inline bool vmstate_##X##_plus(void *opaque, int version_id)\ +{\ + return version_id >= X;\ +} + +VMSTATE_X_PLUS(2) +VMSTATE_X_PLUS(3) +VMSTATE_X_PLUS(4) +VMSTATE_X_PLUS(5) +VMSTATE_X_PLUS(6) +VMSTATE_X_PLUS(7) +VMSTATE_X_PLUS(8) +VMSTATE_X_PLUS(9) +VMSTATE_X_PLUS(10) +VMSTATE_X_PLUS(11) +VMSTATE_X_PLUS(12) +VMSTATE_X_PLUS(13) +VMSTATE_X_PLUS(14) +VMSTATE_X_PLUS(15) +#endif
Signature · 1 line
1.9.0
PATCH 8/97 vmstate: Remove VMSTATE_UINTL_EQUAL_V
In reply to Juan QuintelaIt was not used anywhere.
--- include/hw/hw.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
include/hw/hw.h +4 -6
@@ -51,22 +51,20 @@ int qemu_boot_set(const char *boot_order);#if TARGET_LONG_BITS ==64 #define VMSTATE_UINTTL_V (_f, _s, _v) \ VMSTATE_UINT64_V(_f, _s, _v) -#define VMSTATE_UINTTL_EQUAL_V (_f, _s, _v) \ - VMSTATE_UINT64_EQUAL_V(_f, _s, _v) +#define VMSTATE_UINTTL_EQUAL (_f, _s) \ + VMSTATE_UINT64_EQUAL(_f, _s)#define VMSTATE_UINTTL_ARRAY_V (_f, _s, _n, _v) \ VMSTATE_UINT64_ARRAY_V(_f, _s, _n, _v)#else #define VMSTATE_UINTTL_V (_f, _s, _v) \ VMSTATE_UINT32_V(_f, _s, _v) -#define VMSTATE_UINTTL_EQUAL_V (_f, _s, _v) \ - VMSTATE_UINT32_EQUAL_V(_f, _s, _v) +#define VMSTATE_UINTTL_EQUAL (_f, _s) \ + VMSTATE_UINT32_EQUAL(_f, _s)#define VMSTATE_UINTTL_ARRAY_V (_f, _s, _n, _v) \ VMSTATE_UINT32_ARRAY_V(_f, _s, _n, _v)#endif #define VMSTATE_UINTTL (_f, _s) \ VMSTATE_UINTTL_V(_f, _s, 0) -#define VMSTATE_UINTTL_EQUAL (_f, _s) \ - VMSTATE_UINTTL_EQUAL_V(_f, _s, 0)#define VMSTATE_UINTTL_ARRAY (_f, _s, _n) \ VMSTATE_UINTTL_ARRAY_V(_f, _s, _n, 0)
Signature · 1 line
1.9.0
PATCH 9/97 vmstate: Change VMSTATE_INTTL_V to VMSTATE_INTTL_TEST
In reply to Juan QuintelaAnd fix all users.VMSTATE_UINT64_TEST don't exist. Create it.
--- include/hw/hw.h | 10 +++++----- include/migration/vmstate.h | 3 +++ target-i386/machine.c | 4 ++-- 3 files changed, 10 insertions(+), 7 deletions(-)
include/hw/hw.h +5 -5
@@ -49,22 +49,22 @@ int qemu_boot_set(const char *boot_order);#ifdef NEED_CPU_H #if TARGET_LONG_BITS ==64 -#define VMSTATE_UINTTL_V (_f, _s, _v) \ - VMSTATE_UINT64_V(_f, _s, _v) +#define VMSTATE_UINTTL_TEST (_f, _s, _t) \ + VMSTATE_UINT64_TEST(_f, _s, _t)#define VMSTATE_UINTTL_EQUAL (_f, _s) \ VMSTATE_UINT64_EQUAL(_f, _s)#define VMSTATE_UINTTL_ARRAY_V (_f, _s, _n, _v) \ VMSTATE_UINT64_ARRAY_V(_f, _s, _n, _v)#else -#define VMSTATE_UINTTL_V (_f, _s, _v) \ - VMSTATE_UINT32_V(_f, _s, _v) +#define VMSTATE_UINTTL_TEST (_f, _s, _t) \ + VMSTATE_UINT32_TEST(_f, _s, _t)#define VMSTATE_UINTTL_EQUAL (_f, _s) \ VMSTATE_UINT32_EQUAL(_f, _s)#define VMSTATE_UINTTL_ARRAY_V (_f, _s, _n, _v) \ VMSTATE_UINT32_ARRAY_V(_f, _s, _n, _v)#endif #define VMSTATE_UINTTL (_f, _s) \ - VMSTATE_UINTTL_V(_f, _s, 0) + VMSTATE_UINTTL_TEST(_f, _s, NULL)#define VMSTATE_UINTTL_ARRAY (_f, _s, _n) \ VMSTATE_UINTTL_ARRAY_V(_f, _s, _n, 0)
include/migration/vmstate.h +3 -0
@@ -604,6 +604,9 @@ extern const VMStateInfo vmstate_info_bitmap;#define VMSTATE_UINT32_TEST (_f, _s, _t) \ VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_info_uint32, uint32_t) +#define VMSTATE_UINT64_TEST (_f, _s, _t) \ + VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_info_uint64, uint64_t) +#define VMSTATE_FLOAT64_V (_f, _s, _v) \ VMSTATE_SINGLE(_f, _s, _v, vmstate_info_float64, float64)
target-i386/machine.c +2 -2
@@ -624,8 +624,8 @@ const VMStateDescription vmstate_x86_cpu = {/* Hack: In v7 size changed from 32 to 64 bits on x86_64 */ VMSTATE_HACK_UINT32 (env.sysenter_esp,X86CPU , less_than_7),VMSTATE_HACK_UINT32 (env.sysenter_eip,X86CPU , less_than_7), -VMSTATE_UINTTL_V (env.sysenter_esp,X86CPU ,7 ), -VMSTATE_UINTTL_V (env.sysenter_eip,X86CPU ,7 ), +VMSTATE_UINTTL_TEST (env.sysenter_esp,X86CPU , vmstate_7_plus), +VMSTATE_UINTTL_TEST (env.sysenter_eip,X86CPU , vmstate_7_plus), #elseVMSTATE_UINTTL (env.sysenter_esp,X86CPU ), VMSTATE_UINTTL(env.sysenter_eip, X86CPU),
Signature · 1 line
1.9.0
PATCH 10/97 vmstate: Remove unused VMSTATE_UINTTL_ARRAY_V
In reply to Juan Quintela--- include/hw/hw.h | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)
include/hw/hw.h +4 -7
@@ -53,21 +53,18 @@ int qemu_boot_set(const char *boot_order); VMSTATE_UINT64_TEST(_f, _s, _t)#define VMSTATE_UINTTL_EQUAL (_f, _s) \ VMSTATE_UINT64_EQUAL(_f, _s) -#define VMSTATE_UINTTL_ARRAY_V (_f, _s, _n, _v) \ - VMSTATE_UINT64_ARRAY_V(_f, _s, _n, _v) +#define VMSTATE_UINTTL_ARRAY (_f, _s, _n) \ + VMSTATE_UINT64_ARRAY(_f, _s, _n)#else #define VMSTATE_UINTTL_TEST (_f, _s, _t) \ VMSTATE_UINT32_TEST(_f, _s, _t)#define VMSTATE_UINTTL_EQUAL (_f, _s) \ VMSTATE_UINT32_EQUAL(_f, _s) -#define VMSTATE_UINTTL_ARRAY_V (_f, _s, _n, _v) \ - VMSTATE_UINT32_ARRAY_V(_f, _s, _n, _v) +#define VMSTATE_UINTTL_ARRAY (_f, _s, _n) \ + VMSTATE_UINT32_ARRAY(_f, _s, _n)#endif #define VMSTATE_UINTTL (_f, _s) \ VMSTATE_UINTTL_TEST(_f, _s, NULL) -#define VMSTATE_UINTTL_ARRAY (_f, _s, _n) \ - VMSTATE_UINTTL_ARRAY_V(_f, _s, _n, 0) -#endif #endif
Signature · 1 line
1.9.0
PATCH 11/97 vmstate: Test for VMSTATE_BOOL_TEST
In reply to Juan QuintelaRemove VMSTATE_BOOL_V, we are removing versioning, would use only tests.
--- include/migration/vmstate.h | 6 ++-- tests/test-vmstate.c | 75 ++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 77 insertions(+), 4 deletions(-)
include/migration/vmstate.h +3 -3
@@ -526,8 +526,8 @@ extern const VMStateInfo vmstate_info_bitmap;VMSTATE_STRUCT_ARRAY_TEST (_field, _state, _num,NULL , _version, \ _vmsd, _type) -#define VMSTATE_BOOL_V (_f, _s, _v) \ - VMSTATE_SINGLE(_f, _s, _v, vmstate_info_bool, bool) +#define VMSTATE_BOOL_TEST (_f, _s, _t) \ + VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_info_bool, bool)#define VMSTATE_INT8_V (_f, _s, _v) \ VMSTATE_SINGLE(_f, _s, _v, vmstate_info_int8, int8_t)
@@ -548,7 +548,7 @@ extern const VMStateInfo vmstate_info_bitmap; VMSTATE_SINGLE(_f, _s, _v, vmstate_info_uint64, uint64_t)#define VMSTATE_BOOL (_f, _s) \ - VMSTATE_BOOL_V(_f, _s, 0) + VMSTATE_BOOL_TEST(_f, _s, NULL)#define VMSTATE_INT8 (_f, _s) \ VMSTATE_INT8_V(_f, _s, 0)
tests/test-vmstate.c +74 -1
93 lines not on this page · raw message
Signature · 1 line
1.9.0
PATCH 12/97 vmstate: Test for VMSTATE_INT8_TEST
In reply to Juan QuintelaRemove VMSTATE_INT8_V, we are removing versioning, would use only tests.
--- include/migration/vmstate.h | 6 +++--- tests/test-vmstate.c | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-)
include/migration/vmstate.h +3 -3
@@ -529,8 +529,8 @@ extern const VMStateInfo vmstate_info_bitmap;#define VMSTATE_BOOL_TEST (_f, _s, _t) \ VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_info_bool, bool) -#define VMSTATE_INT8_V (_f, _s, _v) \ - VMSTATE_SINGLE(_f, _s, _v, vmstate_info_int8, int8_t) +#define VMSTATE_INT8_TEST (_f, _s, _t) \ + VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_info_int8, int8_t)#define VMSTATE_INT16_V (_f, _s, _v) \ VMSTATE_SINGLE(_f, _s, _v, vmstate_info_int16, int16_t)#define VMSTATE_INT32_V (_f, _s, _v) \
@@ -551,7 +551,7 @@ extern const VMStateInfo vmstate_info_bitmap; VMSTATE_BOOL_TEST(_f, _s, NULL)#define VMSTATE_INT8 (_f, _s) \ - VMSTATE_INT8_V(_f, _s, 0) + VMSTATE_INT8_TEST(_f, _s, NULL)#define VMSTATE_INT16 (_f, _s) \ VMSTATE_INT16_V(_f, _s, 0)#define VMSTATE_INT32 (_f, _s) \
tests/test-vmstate.c +4 -0
@@ -243,12 +243,15 @@ static const VMStateDescription vmstate_simple_test = { .fields = (VMStateField[]) {VMSTATE_BOOL_TEST (b_1, TestSimple, test_true),VMSTATE_BOOL_TEST (b_2, TestSimple, test_false), +VMSTATE_INT8_TEST (i8_1, TestSimple, test_true), +VMSTATE_INT8_TEST (i8_2, TestSimple, test_false),VMSTATE_END_OF_LIST () } };uint8_t wire_simple_test[] = {/* b_1 */ 0x01 , +/* i8_1 */ 0x41 ,QEMU_VM_EOF ,/* just to ensure we won't get EOF reported prematurely */ };
@@ -293,6 +296,7 @@ static void test_simple_test(void)g_assert (!qemu_file_get_error (loading));FIELD_ASSERT (b_1); +FIELD_ASSERT (i8_1);qemu_fclose (loading); }
Signature · 1 line
1.9.0
PATCH 13/97 vmstate: Test for VMSTATE_INT16_TEST
In reply to Juan QuintelaRemove VMSTATES_INT16_V, we are removing versioning, would use only tests.
--- include/migration/vmstate.h | 6 +++--- tests/test-vmstate.c | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-)
include/migration/vmstate.h +3 -3
@@ -531,8 +531,8 @@ extern const VMStateInfo vmstate_info_bitmap;#define VMSTATE_INT8_TEST (_f, _s, _t) \ VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_info_int8, int8_t) -#define VMSTATE_INT16_V (_f, _s, _v) \ - VMSTATE_SINGLE(_f, _s, _v, vmstate_info_int16, int16_t) +#define VMSTATE_INT16_TEST (_f, _s, _t) \ + VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_info_int16, int16_t)#define VMSTATE_INT32_V (_f, _s, _v) \ VMSTATE_SINGLE(_f, _s, _v, vmstate_info_int32, int32_t)#define VMSTATE_INT64_V (_f, _s, _v) \
@@ -553,7 +553,7 @@ extern const VMStateInfo vmstate_info_bitmap;#define VMSTATE_INT8 (_f, _s) \ VMSTATE_INT8_TEST(_f, _s, NULL)#define VMSTATE_INT16 (_f, _s) \ - VMSTATE_INT16_V(_f, _s, 0) + VMSTATE_INT16_TEST(_f, _s, NULL)#define VMSTATE_INT32 (_f, _s) \ VMSTATE_INT32_V(_f, _s, 0)#define VMSTATE_INT64 (_f, _s) \
tests/test-vmstate.c +4 -0
@@ -245,6 +245,8 @@ static const VMStateDescription vmstate_simple_test = {VMSTATE_BOOL_TEST (b_2, TestSimple, test_false),VMSTATE_INT8_TEST (i8_1, TestSimple, test_true),VMSTATE_INT8_TEST (i8_2, TestSimple, test_false), +VMSTATE_INT16_TEST (i16_1, TestSimple, test_true), +VMSTATE_INT16_TEST (i16_2, TestSimple, test_false), VMSTATE_END_OF_LIST() } };
@@ -252,6 +254,7 @@ static const VMStateDescription vmstate_simple_test = {uint8_t wire_simple_test[] = {/* b_1 */ 0x01 ,/* i8_1 */ 0x41 , +/* i16_1 */ 0x02 ,0x00 ,QEMU_VM_EOF ,/* just to ensure we won't get EOF reported prematurely */ };
@@ -297,6 +300,7 @@ static void test_simple_test(void)FIELD_ASSERT (b_1);FIELD_ASSERT (i8_1); +FIELD_ASSERT (i16_1);qemu_fclose (loading); }
Signature · 1 line
1.9.0
PATCH 14/97 vmstate: Test for VMSTATE_INT32_TEST
In reply to Juan QuintelaRemove VMSTATE_INT32_V, we are removing versioning. Move all users to use tests.
--- hw/input/ps2.c | 2 +- include/migration/vmstate.h | 6 +++--- target-i386/machine.c | 4 ++-- tests/test-vmstate.c | 4 ++++ 4 files changed, 10 insertions(+), 6 deletions(-)
hw/input/ps2.c +1 -1
@@ -613,7 +613,7 @@ static const VMStateDescription vmstate_ps2_keyboard = {VMSTATE_STRUCT (common, PS2KbdState,0 , vmstate_ps2_common, PS2State),VMSTATE_INT32 (scan_enabled, PS2KbdState),VMSTATE_INT32 (translate, PS2KbdState), -VMSTATE_INT32_V (scancode_set, PS2KbdState,3 ), +VMSTATE_INT32_TEST (scancode_set, PS2KbdState, vmstate_3_plus),VMSTATE_END_OF_LIST () }, .subsections = (VMStateSubsection []) {
include/migration/vmstate.h +3 -3
@@ -533,8 +533,8 @@ extern const VMStateInfo vmstate_info_bitmap; VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_info_int8, int8_t)#define VMSTATE_INT16_TEST (_f, _s, _t) \ VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_info_int16, int16_t) -#define VMSTATE_INT32_V (_f, _s, _v) \ - VMSTATE_SINGLE(_f, _s, _v, vmstate_info_int32, int32_t) +#define VMSTATE_INT32_TEST (_f, _s, _t) \ + VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_info_int32, int32_t)#define VMSTATE_INT64_V (_f, _s, _v) \ VMSTATE_SINGLE(_f, _s, _v, vmstate_info_int64, int64_t)
@@ -555,7 +555,7 @@ extern const VMStateInfo vmstate_info_bitmap;#define VMSTATE_INT16 (_f, _s) \ VMSTATE_INT16_TEST(_f, _s, NULL)#define VMSTATE_INT32 (_f, _s) \ - VMSTATE_INT32_V(_f, _s, 0) + VMSTATE_INT32_TEST(_f, _s, NULL)#define VMSTATE_INT64 (_f, _s) \ VMSTATE_INT64_V(_f, _s, 0)
target-i386/machine.c +2 -2
@@ -671,10 +671,10 @@ const VMStateDescription vmstate_x86_cpu = {VMSTATE_UINT64_V (env.mtrr_deftype,X86CPU ,8 ),VMSTATE_MTRR_VARS (env.mtrr_var,X86CPU ,8 ,8 ),/* KVM-related states */ -VMSTATE_INT32_V (env.interrupt_injected,X86CPU ,9 ), +VMSTATE_INT32_TEST (env.interrupt_injected,X86CPU , vmstate_9_plus),VMSTATE_UINT32_V (env.mp_state,X86CPU ,9 ),VMSTATE_UINT64_V (env.tsc,X86CPU ,9 ), -VMSTATE_INT32_V (env.exception_injected,X86CPU ,11 ), +VMSTATE_INT32_TEST (env.exception_injected,X86CPU , vmstate_11_plus),VMSTATE_UINT8_V (env.soft_interrupt,X86CPU ,11 ),VMSTATE_UINT8_V (env.nmi_injected,X86CPU ,11 ), VMSTATE_UINT8_V(env.nmi_pending, X86CPU, 11),
tests/test-vmstate.c +4 -0
@@ -247,6 +247,8 @@ static const VMStateDescription vmstate_simple_test = {VMSTATE_INT8_TEST (i8_2, TestSimple, test_false),VMSTATE_INT16_TEST (i16_1, TestSimple, test_true),VMSTATE_INT16_TEST (i16_2, TestSimple, test_false), +VMSTATE_INT32_TEST (i32_1, TestSimple, test_true), +VMSTATE_INT32_TEST (i32_2, TestSimple, test_false), VMSTATE_END_OF_LIST() } };
@@ -255,6 +257,7 @@ uint8_t wire_simple_test[] = {/* b_1 */ 0x01 ,/* i8_1 */ 0x41 ,/* i16_1 */ 0x02 ,0x00 , +/* i32_1 */ 0x00 ,0x01 ,0x11 ,0x70 , QEMU_VM_EOF, /* just to ensure we won't get EOF reported prematurely */ };
@@ -301,6 +304,7 @@ static void test_simple_test(void)FIELD_ASSERT (b_1);FIELD_ASSERT (i8_1);FIELD_ASSERT (i16_1); +FIELD_ASSERT (i32_1);qemu_fclose (loading); }
Signature · 1 line
1.9.0
PATCH 15/97 vmstate: test for VMSTATE_INT64_TEST
In reply to Juan QuintelaRemove VMSTATE_INT64_V, we are removing versioning. Move all users to VMSTATE_INT64_TEST.
--- cpus.c | 2 +- hw/timer/mc146818rtc.c | 2 +- hw/usb/hcd-uhci.c | 2 +- include/migration/vmstate.h | 6 +++--- tests/test-vmstate.c | 4 ++++ 5 files changed, 10 insertions(+), 6 deletions(-)
cpus.c +1 -1
@@ -433,7 +433,7 @@ static const VMStateDescription vmstate_timers = { .fields = (VMStateField[]) {VMSTATE_INT64 (cpu_ticks_offset, TimersState),VMSTATE_INT64 (dummy, TimersState), -VMSTATE_INT64_V (cpu_clock_offset, TimersState,2 ), +VMSTATE_INT64_TEST (cpu_clock_offset, TimersState, vmstate_2_plus),VMSTATE_END_OF_LIST () } };
hw/timer/mc146818rtc.c +1 -1
@@ -732,7 +732,7 @@ static const VMStateDescription vmstate_rtc = {VMSTATE_UINT32_V (period, RTCState,2 ),VMSTATE_UINT64_V (base_rtc, RTCState,3 ),VMSTATE_UINT64_V (last_update, RTCState,3 ), -VMSTATE_INT64_V (offset, RTCState,3 ), +VMSTATE_INT64_TEST (offset, RTCState, vmstate_3_plus),VMSTATE_TIMER_V (update_timer, RTCState,3 ),VMSTATE_UINT64_V (next_alarm_time, RTCState,3 ),VMSTATE_END_OF_LIST ()
hw/usb/hcd-uhci.c +1 -1
@@ -457,7 +457,7 @@ static const VMStateDescription vmstate_uhci = {VMSTATE_UINT8 (sof_timing, UHCIState),VMSTATE_UINT8 (status2, UHCIState),VMSTATE_TIMER (frame_timer, UHCIState), -VMSTATE_INT64_V (expire_time, UHCIState,2 ), +VMSTATE_INT64_TEST (expire_time, UHCIState, vmstate_3_plus),VMSTATE_UINT32_V (pending_int_mask, UHCIState,3 ), VMSTATE_END_OF_LIST() }
include/migration/vmstate.h +3 -3
@@ -535,8 +535,8 @@ extern const VMStateInfo vmstate_info_bitmap; VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_info_int16, int16_t)#define VMSTATE_INT32_TEST (_f, _s, _t) \ VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_info_int32, int32_t) -#define VMSTATE_INT64_V (_f, _s, _v) \ - VMSTATE_SINGLE(_f, _s, _v, vmstate_info_int64, int64_t) +#define VMSTATE_INT64_TEST (_f, _s, _t) \ + VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_info_int64, int64_t)#define VMSTATE_UINT8_V (_f, _s, _v) \ VMSTATE_SINGLE(_f, _s, _v, vmstate_info_uint8, uint8_t)
@@ -557,7 +557,7 @@ extern const VMStateInfo vmstate_info_bitmap;#define VMSTATE_INT32 (_f, _s) \ VMSTATE_INT32_TEST(_f, _s, NULL)#define VMSTATE_INT64 (_f, _s) \ - VMSTATE_INT64_V(_f, _s, 0) + VMSTATE_INT64_TEST(_f, _s, NULL)#define VMSTATE_UINT8 (_f, _s) \ VMSTATE_UINT8_V(_f, _s, 0)
tests/test-vmstate.c +4 -0
@@ -249,6 +249,8 @@ static const VMStateDescription vmstate_simple_test = {VMSTATE_INT16_TEST (i16_2, TestSimple, test_false),VMSTATE_INT32_TEST (i32_1, TestSimple, test_true),VMSTATE_INT32_TEST (i32_2, TestSimple, test_false), +VMSTATE_INT64_TEST (i64_1, TestSimple, test_true), +VMSTATE_INT64_TEST (i64_2, TestSimple, test_false), VMSTATE_END_OF_LIST() } };
@@ -258,6 +260,7 @@ uint8_t wire_simple_test[] = {/* i8_1 */ 0x41 ,/* i16_1 */ 0x02 ,0x00 ,/* i32_1 */ 0x00 ,0x01 ,0x11 ,0x70 , +/* i64_1 */ 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0xb8 ,0xf4 ,0x7c , QEMU_VM_EOF, /* just to ensure we won't get EOF reported prematurely */ };
@@ -305,6 +308,7 @@ static void test_simple_test(void)FIELD_ASSERT (i8_1);FIELD_ASSERT (i16_1);FIELD_ASSERT (i32_1); +FIELD_ASSERT (i64_1);qemu_fclose (loading); }
Signature · 1 line
1.9.0
PATCH 16/97 vmstate: Test for VMSTATE_UINT8_TEST
In reply to Juan QuintelaRemove VMSTATE_UINT8_V, we are removing versioning. Move all users to VMSTATE_UINT8_TEST.
--- hw/char/serial.c | 2 +- hw/ide/core.c | 2 +- hw/net/ne2000.c | 2 +- hw/timer/ds1338.c | 2 +- hw/timer/hpet.c | 2 +- include/migration/vmstate.h | 9 +++------ target-i386/machine.c | 10 +++++----- tests/test-vmstate.c | 4 ++++ 8 files changed, 17 insertions(+), 16 deletions(-)
hw/char/serial.c +1 -1
@@ -610,7 +610,7 @@ const VMStateDescription vmstate_serial = {VMSTATE_UINT8 (lsr, SerialState),VMSTATE_UINT8 (msr, SerialState),VMSTATE_UINT8 (scr, SerialState), -VMSTATE_UINT8_V (fcr_vmstate, SerialState,3 ), +VMSTATE_UINT8_TEST (fcr_vmstate, SerialState, vmstate_3_plus), VMSTATE_END_OF_LIST() } };
hw/ide/core.c +1 -1
@@ -2404,7 +2404,7 @@ const VMStateDescription vmstate_ide_drive = {VMSTATE_UINT8 (lba48, IDEState),VMSTATE_UINT8 (sense_key, IDEState),VMSTATE_UINT8 (asc, IDEState), -VMSTATE_UINT8_V (cdrom_changed, IDEState,3 ), +VMSTATE_UINT8_TEST (cdrom_changed, IDEState, vmstate_3_plus),VMSTATE_END_OF_LIST () }, .subsections = (VMStateSubsection []) {
hw/net/ne2000.c +1 -1
@@ -617,7 +617,7 @@ const VMStateDescription vmstate_ne2000 = { .minimum_version_id = 0, .post_load = ne2000_post_load, .fields = (VMStateField []) { -VMSTATE_UINT8_V (rxcr, NE2000State,2 ), +VMSTATE_UINT8_TEST (rxcr, NE2000State, vmstate_2_plus),VMSTATE_UINT8 (cmd, NE2000State),VMSTATE_UINT32 (start, NE2000State),VMSTATE_UINT32 (stop, NE2000State),
hw/timer/ds1338.c +1 -1
@@ -43,7 +43,7 @@ static const VMStateDescription vmstate_ds1338 = { .fields = (VMStateField[]) {VMSTATE_I2C_SLAVE (parent_obj, DS1338State),VMSTATE_INT64 (offset, DS1338State), -VMSTATE_UINT8_V (wday_offset, DS1338State,2 ), +VMSTATE_UINT8_TEST (wday_offset, DS1338State, vmstate_2_plus),VMSTATE_UINT8_ARRAY (nvram, DS1338State,NVRAM_SIZE ),VMSTATE_INT32 (ptr, DS1338State),VMSTATE_BOOL (addr_byte, DS1338State),
hw/timer/hpet.c +1 -1
@@ -303,7 +303,7 @@ static const VMStateDescription vmstate_hpet = {VMSTATE_UINT64 (config, HPETState),VMSTATE_UINT64 (isr, HPETState),VMSTATE_UINT64 (hpet_counter, HPETState), -VMSTATE_UINT8_V (num_timers, HPETState,2 ), +VMSTATE_UINT8_TEST (num_timers, HPETState, vmstate_2_plus),VMSTATE_STRUCT_VARRAY_UINT8 (timer, HPETState, num_timers,0 , vmstate_hpet_timer, HPETTimer),VMSTATE_END_OF_LIST ()
include/migration/vmstate.h +3 -6
@@ -538,8 +538,8 @@ extern const VMStateInfo vmstate_info_bitmap;#define VMSTATE_INT64_TEST (_f, _s, _t) \ VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_info_int64, int64_t) -#define VMSTATE_UINT8_V (_f, _s, _v) \ - VMSTATE_SINGLE(_f, _s, _v, vmstate_info_uint8, uint8_t) +#define VMSTATE_UINT8_TEST (_f, _s, _t) \ + VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_info_uint8, uint8_t)#define VMSTATE_UINT16_V (_f, _s, _v) \ VMSTATE_SINGLE(_f, _s, _v, vmstate_info_uint16, uint16_t)#define VMSTATE_UINT32_V (_f, _s, _v) \
@@ -560,7 +560,7 @@ extern const VMStateInfo vmstate_info_bitmap; VMSTATE_INT64_TEST(_f, _s, NULL)#define VMSTATE_UINT8 (_f, _s) \ - VMSTATE_UINT8_V(_f, _s, 0) + VMSTATE_UINT8_TEST(_f, _s, NULL)#define VMSTATE_UINT16 (_f, _s) \ VMSTATE_UINT16_V(_f, _s, 0)#define VMSTATE_UINT32 (_f, _s) \
@@ -595,9 +595,6 @@ extern const VMStateInfo vmstate_info_bitmap;#define VMSTATE_INT32_LE (_f, _s) \ VMSTATE_SINGLE(_f, _s, 0, vmstate_info_int32_le, int32_t) -#define VMSTATE_UINT8_TEST (_f, _s, _t) \ - VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_info_uint8, uint8_t) -#define VMSTATE_UINT16_TEST (_f, _s, _t) \ VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_info_uint16, uint16_t)
target-i386/machine.c +5 -5
@@ -665,7 +665,7 @@ const VMStateDescription vmstate_x86_cpu = {VMSTATE_UINT16_V (env.intercept_dr_read,X86CPU ,5 ),VMSTATE_UINT16_V (env.intercept_dr_write,X86CPU ,5 ),VMSTATE_UINT32_V (env.intercept_exceptions,X86CPU ,5 ), -VMSTATE_UINT8_V (env.v_tpr,X86CPU ,5 ), +VMSTATE_UINT8_TEST (env.v_tpr,X86CPU , vmstate_5_plus),/* MTRRs */ VMSTATE_UINT64_ARRAY_V (env.mtrr_fixed,X86CPU ,11 ,8 ), VMSTATE_UINT64_V(env.mtrr_deftype, X86CPU, 8),
@@ -675,10 +675,10 @@ const VMStateDescription vmstate_x86_cpu = {VMSTATE_UINT32_V (env.mp_state,X86CPU ,9 ),VMSTATE_UINT64_V (env.tsc,X86CPU ,9 ),VMSTATE_INT32_TEST (env.exception_injected,X86CPU , vmstate_11_plus), -VMSTATE_UINT8_V (env.soft_interrupt,X86CPU ,11 ), -VMSTATE_UINT8_V (env.nmi_injected,X86CPU ,11 ), -VMSTATE_UINT8_V (env.nmi_pending,X86CPU ,11 ), -VMSTATE_UINT8_V (env.has_error_code,X86CPU ,11 ), +VMSTATE_UINT8_TEST (env.soft_interrupt,X86CPU , vmstate_11_plus), +VMSTATE_UINT8_TEST (env.nmi_injected,X86CPU , vmstate_11_plus), +VMSTATE_UINT8_TEST (env.nmi_pending,X86CPU , vmstate_11_plus), +VMSTATE_UINT8_TEST (env.has_error_code,X86CPU , vmstate_11_plus),VMSTATE_UINT32_V (env.sipi_vector,X86CPU ,11 ),/* MCE */ VMSTATE_UINT64_V(env.mcg_cap, X86CPU, 10),
tests/test-vmstate.c +4 -0
@@ -251,6 +251,8 @@ static const VMStateDescription vmstate_simple_test = {VMSTATE_INT32_TEST (i32_2, TestSimple, test_false),VMSTATE_INT64_TEST (i64_1, TestSimple, test_true),VMSTATE_INT64_TEST (i64_2, TestSimple, test_false), +VMSTATE_UINT8_TEST (u8_1, TestSimple, test_true), +VMSTATE_UINT8_TEST (u8_2, TestSimple, test_false), VMSTATE_END_OF_LIST() } };
@@ -261,6 +263,7 @@ uint8_t wire_simple_test[] = {/* i16_1 */ 0x02 ,0x00 ,/* i32_1 */ 0x00 ,0x01 ,0x11 ,0x70 ,/* i64_1 */ 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0xb8 ,0xf4 ,0x7c , +/* u8_1 */ 0x82 , QEMU_VM_EOF, /* just to ensure we won't get EOF reported prematurely */ };
@@ -309,6 +312,7 @@ static void test_simple_test(void)FIELD_ASSERT (i16_1);FIELD_ASSERT (i32_1);FIELD_ASSERT (i64_1); +FIELD_ASSERT (u8_1);qemu_fclose (loading); }
Signature · 1 line
1.9.0
PATCH 17/97 vmstate: Test for VMSTATE_UINT16_TEST
In reply to Juan QuintelaRemove VMSTATE_UINT16_V, we are removing versioning. Move all users to VMSTATE_UINT16_TEST.
--- hw/char/serial.c | 2 +- hw/net/lan9118.c | 4 ++-- include/migration/vmstate.h | 9 +++------ target-i386/machine.c | 8 ++++---- tests/test-vmstate.c | 4 ++++ 5 files changed, 14 insertions(+), 13 deletions(-)
hw/char/serial.c +1 -1
@@ -601,7 +601,7 @@ const VMStateDescription vmstate_serial = { .pre_save = serial_pre_save, .post_load = serial_post_load, .fields = (VMStateField []) { -VMSTATE_UINT16_V (divider, SerialState,2 ), +VMSTATE_UINT16_TEST (divider, SerialState, vmstate_2_plus),VMSTATE_UINT8 (rbr, SerialState),VMSTATE_UINT8 (ier, SerialState),VMSTATE_UINT8 (iir, SerialState),
hw/net/lan9118.c +2 -2
@@ -310,8 +310,8 @@ static const VMStateDescription vmstate_lan9118 = {VMSTATE_INT32 (rxp_pad, lan9118_state),VMSTATE_UINT32_V (write_word_prev_offset, lan9118_state,2 ),VMSTATE_UINT32_V (write_word_n, lan9118_state,2 ), -VMSTATE_UINT16_V (write_word_l, lan9118_state,2 ), -VMSTATE_UINT16_V (write_word_h, lan9118_state,2 ), +VMSTATE_UINT16_TEST (write_word_l, lan9118_state, vmstate_2_plus), +VMSTATE_UINT16_TEST (write_word_h, lan9118_state, vmstate_2_plus),VMSTATE_UINT32_V (read_word_prev_offset, lan9118_state,2 ),VMSTATE_UINT32_V (read_word_n, lan9118_state,2 ), VMSTATE_UINT32_V(read_long, lan9118_state, 2),
include/migration/vmstate.h +3 -6
@@ -540,8 +540,8 @@ extern const VMStateInfo vmstate_info_bitmap;#define VMSTATE_UINT8_TEST (_f, _s, _t) \ VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_info_uint8, uint8_t) -#define VMSTATE_UINT16_V (_f, _s, _v) \ - VMSTATE_SINGLE(_f, _s, _v, vmstate_info_uint16, uint16_t) +#define VMSTATE_UINT16_TEST (_f, _s, _t) \ + VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_info_uint16, uint16_t)#define VMSTATE_UINT32_V (_f, _s, _v) \ VMSTATE_SINGLE(_f, _s, _v, vmstate_info_uint32, uint32_t)#define VMSTATE_UINT64_V (_f, _s, _v) \
@@ -562,7 +562,7 @@ extern const VMStateInfo vmstate_info_bitmap;#define VMSTATE_UINT8 (_f, _s) \ VMSTATE_UINT8_TEST(_f, _s, NULL)#define VMSTATE_UINT16 (_f, _s) \ - VMSTATE_UINT16_V(_f, _s, 0) + VMSTATE_UINT16_TEST(_f, _s, NULL)#define VMSTATE_UINT32 (_f, _s) \ VMSTATE_UINT32_V(_f, _s, 0)#define VMSTATE_UINT64 (_f, _s) \
@@ -595,9 +595,6 @@ extern const VMStateInfo vmstate_info_bitmap;#define VMSTATE_INT32_LE (_f, _s) \ VMSTATE_SINGLE(_f, _s, 0, vmstate_info_int32_le, int32_t) -#define VMSTATE_UINT16_TEST (_f, _s, _t) \ - VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_info_uint16, uint16_t) -#define VMSTATE_UINT32_TEST (_f, _s, _t) \ VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_info_uint32, uint32_t)
target-i386/machine.c +4 -4
@@ -660,10 +660,10 @@ const VMStateDescription vmstate_x86_cpu = {VMSTATE_UINT64_V (env.vm_vmcb,X86CPU ,5 ),VMSTATE_UINT64_V (env.tsc_offset,X86CPU ,5 ),VMSTATE_UINT64_V (env.intercept,X86CPU ,5 ), -VMSTATE_UINT16_V (env.intercept_cr_read,X86CPU ,5 ), -VMSTATE_UINT16_V (env.intercept_cr_write,X86CPU ,5 ), -VMSTATE_UINT16_V (env.intercept_dr_read,X86CPU ,5 ), -VMSTATE_UINT16_V (env.intercept_dr_write,X86CPU ,5 ), +VMSTATE_UINT16_TEST (env.intercept_cr_read,X86CPU , vmstate_5_plus), +VMSTATE_UINT16_TEST (env.intercept_cr_write,X86CPU , vmstate_5_plus), +VMSTATE_UINT16_TEST (env.intercept_dr_read,X86CPU , vmstate_5_plus), +VMSTATE_UINT16_TEST (env.intercept_dr_write,X86CPU , vmstate_5_plus),VMSTATE_UINT32_V (env.intercept_exceptions,X86CPU ,5 ), VMSTATE_UINT8_TEST(env.v_tpr, X86CPU, vmstate_5_plus),/* MTRRs */
tests/test-vmstate.c +4 -0
@@ -253,6 +253,8 @@ static const VMStateDescription vmstate_simple_test = {VMSTATE_INT64_TEST (i64_2, TestSimple, test_false),VMSTATE_UINT8_TEST (u8_1, TestSimple, test_true),VMSTATE_UINT8_TEST (u8_2, TestSimple, test_false), +VMSTATE_UINT16_TEST (u16_1, TestSimple, test_true), +VMSTATE_UINT16_TEST (u16_2, TestSimple, test_false), VMSTATE_END_OF_LIST() } };
@@ -264,6 +266,7 @@ uint8_t wire_simple_test[] = {/* i32_1 */ 0x00 ,0x01 ,0x11 ,0x70 ,/* i64_1 */ 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0xb8 ,0xf4 ,0x7c ,/* u8_1 */ 0x82 , +/* u16_1 */ 0x02 ,0x00 , QEMU_VM_EOF, /* just to ensure we won't get EOF reported prematurely */ };
@@ -313,6 +316,7 @@ static void test_simple_test(void)FIELD_ASSERT (i32_1);FIELD_ASSERT (i64_1);FIELD_ASSERT (u8_1); +FIELD_ASSERT (u16_1);qemu_fclose (loading); }
Signature · 1 line
1.9.0
PATCH 18/97 vmstate: Test for VMSTATE_UINT32_TEST
In reply to Juan QuintelaRemove VMSTATE_UINT32_V, we are removing versioning. Move all users to VMSTATE_UINT32_TEST.
--- hw/arm/stellaris.c | 2 +- hw/display/pl110.c | 2 +- hw/gpio/pl061.c | 2 +- hw/intc/ioapic_common.c | 2 +- hw/misc/arm_sysctl.c | 10 +++++----- hw/net/lan9118.c | 14 ++++++++------ hw/net/rtl8139.c | 2 +- hw/nvram/fw_cfg.c | 2 +- hw/timer/i8254_common.c | 3 ++- hw/timer/mc146818rtc.c | 4 ++-- hw/usb/hcd-ehci.c | 4 ++-- hw/usb/hcd-uhci.c | 2 +- include/migration/vmstate.h | 9 +++------ target-i386/machine.c | 10 +++++----- tests/test-vmstate.c | 12 ++++++++---- 15 files changed, 42 insertions(+), 38 deletions(-)
hw/arm/stellaris.c +1 -1
@@ -650,7 +650,7 @@ static const VMStateDescription vmstate_stellaris_sys = {VMSTATE_UINT32 (int_status, ssys_state),VMSTATE_UINT32 (resc, ssys_state),VMSTATE_UINT32 (rcc, ssys_state), -VMSTATE_UINT32_V (rcc2, ssys_state,2 ), +VMSTATE_UINT32_TEST (rcc2, ssys_state, vmstate_2_plus),VMSTATE_UINT32_ARRAY (rcgc, ssys_state,3 ),VMSTATE_UINT32_ARRAY (scgc, ssys_state,3 ), VMSTATE_UINT32_ARRAY(dcgc, ssys_state, 3),
hw/display/pl110.c +1 -1
@@ -86,7 +86,7 @@ static const VMStateDescription vmstate_pl110 = {VMSTATE_INT32 (invalidate, PL110State),VMSTATE_UINT32_ARRAY (palette, PL110State,256 ),VMSTATE_UINT32_ARRAY (raw_palette, PL110State,128 ), -VMSTATE_UINT32_V (mux_ctrl, PL110State,2 ), +VMSTATE_UINT32_TEST (mux_ctrl, PL110State, vmstate_2_plus), VMSTATE_END_OF_LIST() } };
hw/gpio/pl061.c +1 -1
@@ -86,7 +86,7 @@ static const VMStateDescription vmstate_pl061 = {VMSTATE_UINT32 (den, PL061State),VMSTATE_UINT32 (cr, PL061State),VMSTATE_UINT32 (float_high, PL061State), -VMSTATE_UINT32_V (amsel, PL061State,2 ), +VMSTATE_UINT32_TEST (amsel, PL061State, vmstate_2_plus), VMSTATE_END_OF_LIST() } };
hw/intc/ioapic_common.c +1 -1
@@ -92,7 +92,7 @@ static const VMStateDescription vmstate_ioapic_common = {VMSTATE_UINT8 (id, IOAPICCommonState),VMSTATE_UINT8 (ioregsel, IOAPICCommonState),VMSTATE_UNUSED_V (2 ,8 ),/* to account for qemu-kvm's v2 format */ -VMSTATE_UINT32_V (irr, IOAPICCommonState,2 ), +VMSTATE_UINT32_TEST (irr, IOAPICCommonState, vmstate_2_plus),VMSTATE_UINT64_ARRAY (ioredtbl, IOAPICCommonState,IOAPIC_NUM_PINS ), VMSTATE_END_OF_LIST() }
hw/misc/arm_sysctl.c +5 -5
@@ -60,11 +60,11 @@ static const VMStateDescription vmstate_arm_sysctl = {VMSTATE_UINT32 (flags, arm_sysctl_state),VMSTATE_UINT32 (nvflags, arm_sysctl_state),VMSTATE_UINT32 (resetlevel, arm_sysctl_state), -VMSTATE_UINT32_V (sys_mci, arm_sysctl_state,2 ), -VMSTATE_UINT32_V (sys_cfgdata, arm_sysctl_state,2 ), -VMSTATE_UINT32_V (sys_cfgctrl, arm_sysctl_state,2 ), -VMSTATE_UINT32_V (sys_cfgstat, arm_sysctl_state,2 ), -VMSTATE_UINT32_V (sys_clcd, arm_sysctl_state,3 ), +VMSTATE_UINT32_TEST (sys_mci, arm_sysctl_state, vmstate_2_plus), +VMSTATE_UINT32_TEST (sys_cfgdata, arm_sysctl_state, vmstate_2_plus), +VMSTATE_UINT32_TEST (sys_cfgctrl, arm_sysctl_state, vmstate_2_plus), +VMSTATE_UINT32_TEST (sys_cfgstat, arm_sysctl_state, vmstate_2_plus), +VMSTATE_UINT32_TEST (sys_clcd, arm_sysctl_state, vmstate_3_plus),VMSTATE_UINT32_ARRAY_V (mb_clock, arm_sysctl_state,6 ,4 ),VMSTATE_VARRAY_UINT32 (db_clock, arm_sysctl_state, db_num_clocks, 4, vmstate_info_uint32, uint32_t),
hw/net/lan9118.c +8 -6
@@ -308,14 +308,16 @@ static const VMStateDescription vmstate_lan9118 = { VMSTATE_INT32(rxp_offset, lan9118_state), VMSTATE_INT32(rxp_size, lan9118_state), VMSTATE_INT32(rxp_pad, lan9118_state), - VMSTATE_UINT32_V(write_word_prev_offset, lan9118_state, 2), - VMSTATE_UINT32_V(write_word_n, lan9118_state, 2), + VMSTATE_UINT32_TEST(write_word_prev_offset, lan9118_state, + vmstate_2_plus), + VMSTATE_UINT32_TEST(write_word_n, lan9118_state, vmstate_2_plus), VMSTATE_UINT16_TEST(write_word_l, lan9118_state, vmstate_2_plus), VMSTATE_UINT16_TEST(write_word_h, lan9118_state, vmstate_2_plus), - VMSTATE_UINT32_V(read_word_prev_offset, lan9118_state, 2), - VMSTATE_UINT32_V(read_word_n, lan9118_state, 2), - VMSTATE_UINT32_V(read_long, lan9118_state, 2), - VMSTATE_UINT32_V(mode_16bit, lan9118_state, 2), + VMSTATE_UINT32_TEST(read_word_prev_offset, lan9118_state, + vmstate_2_plus), + VMSTATE_UINT32_TEST(read_word_n, lan9118_state, vmstate_2_plus), + VMSTATE_UINT32_TEST(read_long, lan9118_state, vmstate_2_plus), + VMSTATE_UINT32_TEST(mode_16bit, lan9118_state, vmstate_2_plus),VMSTATE_END_OF_LIST () } };
hw/net/rtl8139.c +1 -1
@@ -3363,7 +3363,7 @@ static const VMStateDescription vmstate_rtl8139 = {VMSTATE_STRUCT (tally_counters, RTL8139State,0 , vmstate_tally_counters, RTL8139TallyCounters), -VMSTATE_UINT32_V (cplus_enabled, RTL8139State,4 ), +VMSTATE_UINT32_TEST (cplus_enabled, RTL8139State, vmstate_4_plus),VMSTATE_END_OF_LIST () }, .subsections = (VMStateSubsection []) {
hw/nvram/fw_cfg.c +1 -1
@@ -380,7 +380,7 @@ static const VMStateDescription vmstate_fw_cfg = { .fields = (VMStateField[]) {VMSTATE_UINT16 (cur_entry, FWCfgState),VMSTATE_UINT16_HACK (cur_offset, FWCfgState, is_version_1), -VMSTATE_UINT32_V (cur_offset, FWCfgState,2 ), +VMSTATE_UINT32_TEST (cur_offset, FWCfgState, vmstate_2_plus),VMSTATE_END_OF_LIST () } };
hw/timer/i8254_common.c +2 -1
@@ -266,7 +266,8 @@ static const VMStateDescription vmstate_pit_common = { .pre_save = pit_dispatch_pre_save, .post_load = pit_dispatch_post_load, .fields = (VMStateField []) { -VMSTATE_UINT32_V (channels[0 ].irq_disabled, PITCommonState,3 ), +VMSTATE_UINT32_TEST (channels[0 ].irq_disabled, PITCommonState, + vmstate_3_plus),VMSTATE_STRUCT_ARRAY (channels, PITCommonState,3 ,2 , vmstate_pit_channel, PITChannelState), VMSTATE_INT64(channels[0].next_transition_time,
hw/timer/mc146818rtc.c +2 -2
@@ -728,8 +728,8 @@ static const VMStateDescription vmstate_rtc = {VMSTATE_TIMER (periodic_timer, RTCState),VMSTATE_INT64 (next_periodic_time, RTCState),VMSTATE_UNUSED (3 *8 ), -VMSTATE_UINT32_V (irq_coalesced, RTCState,2 ), -VMSTATE_UINT32_V (period, RTCState,2 ), +VMSTATE_UINT32_TEST (irq_coalesced, RTCState, vmstate_2_plus), +VMSTATE_UINT32_TEST (period, RTCState, vmstate_2_plus),VMSTATE_UINT64_V (base_rtc, RTCState,3 ),VMSTATE_UINT64_V (last_update, RTCState,3 ), VMSTATE_INT64_TEST(offset, RTCState, vmstate_3_plus),
hw/usb/hcd-ehci.c +2 -2
@@ -2496,8 +2496,8 @@ const VMStateDescription vmstate_ehci = {/* mmio registers */ VMSTATE_UINT32 (usbcmd, EHCIState),VMSTATE_UINT32 (usbsts, EHCIState), -VMSTATE_UINT32_V (usbsts_pending, EHCIState,2 ), -VMSTATE_UINT32_V (usbsts_frindex, EHCIState,2 ), +VMSTATE_UINT32_TEST (usbsts_pending, EHCIState, vmstate_2_plus), +VMSTATE_UINT32_TEST (usbsts_frindex, EHCIState, vmstate_2_plus),VMSTATE_UINT32 (usbintr, EHCIState),VMSTATE_UINT32 (frindex, EHCIState), VMSTATE_UINT32(ctrldssegment, EHCIState),
hw/usb/hcd-uhci.c +1 -1
@@ -458,7 +458,7 @@ static const VMStateDescription vmstate_uhci = {VMSTATE_UINT8 (status2, UHCIState),VMSTATE_TIMER (frame_timer, UHCIState),VMSTATE_INT64_TEST (expire_time, UHCIState, vmstate_3_plus), -VMSTATE_UINT32_V (pending_int_mask, UHCIState,3 ), +VMSTATE_UINT32_TEST (pending_int_mask, UHCIState, vmstate_3_plus), VMSTATE_END_OF_LIST() } };
include/migration/vmstate.h +3 -6
@@ -542,8 +542,8 @@ extern const VMStateInfo vmstate_info_bitmap; VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_info_uint8, uint8_t)#define VMSTATE_UINT16_TEST (_f, _s, _t) \ VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_info_uint16, uint16_t) -#define VMSTATE_UINT32_V (_f, _s, _v) \ - VMSTATE_SINGLE(_f, _s, _v, vmstate_info_uint32, uint32_t) +#define VMSTATE_UINT32_TEST (_f, _s, _t) \ + VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_info_uint32, uint32_t)#define VMSTATE_UINT64_V (_f, _s, _v) \ VMSTATE_SINGLE(_f, _s, _v, vmstate_info_uint64, uint64_t)
@@ -564,7 +564,7 @@ extern const VMStateInfo vmstate_info_bitmap;#define VMSTATE_UINT16 (_f, _s) \ VMSTATE_UINT16_TEST(_f, _s, NULL)#define VMSTATE_UINT32 (_f, _s) \ - VMSTATE_UINT32_V(_f, _s, 0) + VMSTATE_UINT32_TEST(_f, _s, NULL)#define VMSTATE_UINT64 (_f, _s) \ VMSTATE_UINT64_V(_f, _s, 0)
@@ -595,9 +595,6 @@ extern const VMStateInfo vmstate_info_bitmap;#define VMSTATE_INT32_LE (_f, _s) \ VMSTATE_SINGLE(_f, _s, 0, vmstate_info_int32_le, int32_t) -#define VMSTATE_UINT32_TEST (_f, _s, _t) \ - VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_info_uint32, uint32_t) -#define VMSTATE_UINT64_TEST (_f, _s, _t) \ VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_info_uint64, uint64_t)
target-i386/machine.c +5 -5
@@ -650,10 +650,10 @@ const VMStateDescription vmstate_x86_cpu = {VMSTATE_UINT64 (env.fmask,X86CPU ),VMSTATE_UINT64 (env.kernelgsbase,X86CPU ), #endif -VMSTATE_UINT32_V (env.smbase,X86CPU ,4 ), +VMSTATE_UINT32_TEST (env.smbase,X86CPU , vmstate_4_plus),VMSTATE_UINT64_V (env.pat,X86CPU ,5 ), -VMSTATE_UINT32_V (env.hflags2,X86CPU ,5 ), +VMSTATE_UINT32_TEST (env.hflags2,X86CPU , vmstate_5_plus),VMSTATE_UINT32_TEST (parent_obj.halted,X86CPU , version_is_5), VMSTATE_UINT64_V(env.vm_hsave, X86CPU, 5),
@@ -664,7 +664,7 @@ const VMStateDescription vmstate_x86_cpu = {VMSTATE_UINT16_TEST (env.intercept_cr_write,X86CPU , vmstate_5_plus),VMSTATE_UINT16_TEST (env.intercept_dr_read,X86CPU , vmstate_5_plus),VMSTATE_UINT16_TEST (env.intercept_dr_write,X86CPU , vmstate_5_plus), -VMSTATE_UINT32_V (env.intercept_exceptions,X86CPU ,5 ), +VMSTATE_UINT32_TEST (env.intercept_exceptions,X86CPU , vmstate_5_plus),VMSTATE_UINT8_TEST (env.v_tpr,X86CPU , vmstate_5_plus),/* MTRRs */ VMSTATE_UINT64_ARRAY_V(env.mtrr_fixed, X86CPU, 11, 8),
@@ -672,14 +672,14 @@ const VMStateDescription vmstate_x86_cpu = {VMSTATE_MTRR_VARS (env.mtrr_var,X86CPU ,8 ,8 ),/* KVM-related states */ VMSTATE_INT32_TEST (env.interrupt_injected,X86CPU , vmstate_9_plus), -VMSTATE_UINT32_V (env.mp_state,X86CPU ,9 ), +VMSTATE_UINT32_TEST (env.mp_state,X86CPU , vmstate_9_plus),VMSTATE_UINT64_V (env.tsc,X86CPU ,9 ),VMSTATE_INT32_TEST (env.exception_injected,X86CPU , vmstate_11_plus),VMSTATE_UINT8_TEST (env.soft_interrupt,X86CPU , vmstate_11_plus),VMSTATE_UINT8_TEST (env.nmi_injected,X86CPU , vmstate_11_plus),VMSTATE_UINT8_TEST (env.nmi_pending,X86CPU , vmstate_11_plus),VMSTATE_UINT8_TEST (env.has_error_code,X86CPU , vmstate_11_plus), -VMSTATE_UINT32_V (env.sipi_vector,X86CPU ,11 ), +VMSTATE_UINT32_TEST (env.sipi_vector,X86CPU , vmstate_11_plus),/* MCE */ VMSTATE_UINT64_V (env.mcg_cap,X86CPU ,10 ), VMSTATE_UINT64_V(env.mcg_status, X86CPU, 10),
tests/test-vmstate.c +8 -4
@@ -255,6 +255,8 @@ static const VMStateDescription vmstate_simple_test = {VMSTATE_UINT8_TEST (u8_2, TestSimple, test_false),VMSTATE_UINT16_TEST (u16_1, TestSimple, test_true),VMSTATE_UINT16_TEST (u16_2, TestSimple, test_false), +VMSTATE_UINT32_TEST (u32_1, TestSimple, test_true), +VMSTATE_UINT32_TEST (u32_2, TestSimple, test_false), VMSTATE_END_OF_LIST() } };
@@ -267,6 +269,7 @@ uint8_t wire_simple_test[] = {/* i64_1 */ 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0xb8 ,0xf4 ,0x7c ,/* u8_1 */ 0x82 ,/* u16_1 */ 0x02 ,0x00 , +/* u32_1 */ 0x00 ,0x01 ,0x11 ,0x70 , QEMU_VM_EOF, /* just to ensure we won't get EOF reported prematurely */ };
@@ -317,6 +320,7 @@ static void test_simple_test(void)FIELD_ASSERT (i64_1);FIELD_ASSERT (u8_1);FIELD_ASSERT (u16_1); +FIELD_ASSERT (u32_1);qemu_fclose (loading); }
@@ -334,12 +338,12 @@ static const VMStateDescription vmstate_versioned = { .minimum_version_id = 1, .fields = (VMStateField []) {VMSTATE_UINT32 (a, TestStruct), -VMSTATE_UINT32_V (b, TestStruct,2 ),/* Versioned field in the middle, so -* we catch bugs more easily. -*/ +/* Versioned field in the middle, so we catch bugs more easily. */ +VMSTATE_UINT32_TEST (b, TestStruct, vmstate_2_plus), +VMSTATE_UINT32 (c, TestStruct),VMSTATE_UINT64 (d, TestStruct), -VMSTATE_UINT32_V (e, TestStruct,2 ), +VMSTATE_UINT32_TEST (e, TestStruct, vmstate_2_plus),VMSTATE_UINT64_V (f, TestStruct,2 ),VMSTATE_END_OF_LIST () }
Signature · 1 line
1.9.0
PATCH 19/97 vmstate: Test for VMSTATE_UINT64_TEST
In reply to Juan QuintelaRemove VMSTATE_UINT64_V, we are removing versioning. Move all users to VMSTATE_UINT64_TEST.
--- hw/timer/mc146818rtc.c | 6 +++--- include/migration/vmstate.h | 9 +++------ target-i386/machine.c | 30 +++++++++++++++--------------- tests/test-vmstate.c | 8 ++++++-- 4 files changed, 27 insertions(+), 26 deletions(-)
hw/timer/mc146818rtc.c +3 -3
@@ -730,11 +730,11 @@ static const VMStateDescription vmstate_rtc = { VMSTATE_UNUSED(3*8), VMSTATE_UINT32_TEST(irq_coalesced, RTCState, vmstate_2_plus), VMSTATE_UINT32_TEST(period, RTCState, vmstate_2_plus), - VMSTATE_UINT64_V(base_rtc, RTCState, 3), - VMSTATE_UINT64_V(last_update, RTCState, 3), + VMSTATE_UINT64_TEST(base_rtc, RTCState, vmstate_3_plus), + VMSTATE_UINT64_TEST(last_update, RTCState, vmstate_3_plus), VMSTATE_INT64_TEST(offset, RTCState, vmstate_3_plus), VMSTATE_TIMER_V(update_timer, RTCState, 3), - VMSTATE_UINT64_V(next_alarm_time, RTCState, 3), + VMSTATE_UINT64_TEST(next_alarm_time, RTCState, vmstate_3_plus),VMSTATE_END_OF_LIST () } };
include/migration/vmstate.h +3 -6
@@ -544,8 +544,8 @@ extern const VMStateInfo vmstate_info_bitmap; VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_info_uint16, uint16_t)#define VMSTATE_UINT32_TEST (_f, _s, _t) \ VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_info_uint32, uint32_t) -#define VMSTATE_UINT64_V (_f, _s, _v) \ - VMSTATE_SINGLE(_f, _s, _v, vmstate_info_uint64, uint64_t) +#define VMSTATE_UINT64_TEST (_f, _s, _t) \ + VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_info_uint64, uint64_t)#define VMSTATE_BOOL (_f, _s) \ VMSTATE_BOOL_TEST(_f, _s, NULL)
@@ -566,7 +566,7 @@ extern const VMStateInfo vmstate_info_bitmap;#define VMSTATE_UINT32 (_f, _s) \ VMSTATE_UINT32_TEST(_f, _s, NULL)#define VMSTATE_UINT64 (_f, _s) \ - VMSTATE_UINT64_V(_f, _s, 0) + VMSTATE_UINT64_TEST(_f, _s, NULL)#define VMSTATE_UINT8_EQUAL (_f, _s) \ VMSTATE_SINGLE(_f, _s, 0, vmstate_info_uint8_equal, uint8_t)
@@ -595,9 +595,6 @@ extern const VMStateInfo vmstate_info_bitmap;#define VMSTATE_INT32_LE (_f, _s) \ VMSTATE_SINGLE(_f, _s, 0, vmstate_info_int32_le, int32_t) -#define VMSTATE_UINT64_TEST (_f, _s, _t) \ - VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_info_uint64, uint64_t) -#define VMSTATE_FLOAT64_V (_f, _s, _v) \ VMSTATE_SINGLE(_f, _s, _v, vmstate_info_float64, float64)
target-i386/machine.c +15 -15
@@ -652,14 +652,14 @@ const VMStateDescription vmstate_x86_cpu = {#endif VMSTATE_UINT32_TEST (env.smbase,X86CPU , vmstate_4_plus), -VMSTATE_UINT64_V (env.pat,X86CPU ,5 ), +VMSTATE_UINT64_TEST (env.pat,X86CPU , vmstate_5_plus),VMSTATE_UINT32_TEST (env.hflags2,X86CPU , vmstate_5_plus),VMSTATE_UINT32_TEST (parent_obj.halted,X86CPU , version_is_5), -VMSTATE_UINT64_V (env.vm_hsave,X86CPU ,5 ), -VMSTATE_UINT64_V (env.vm_vmcb,X86CPU ,5 ), -VMSTATE_UINT64_V (env.tsc_offset,X86CPU ,5 ), -VMSTATE_UINT64_V (env.intercept,X86CPU ,5 ), +VMSTATE_UINT64_TEST (env.vm_hsave,X86CPU , vmstate_5_plus), +VMSTATE_UINT64_TEST (env.vm_vmcb,X86CPU , vmstate_5_plus), +VMSTATE_UINT64_TEST (env.tsc_offset,X86CPU , vmstate_5_plus), +VMSTATE_UINT64_TEST (env.intercept,X86CPU , vmstate_5_plus),VMSTATE_UINT16_TEST (env.intercept_cr_read,X86CPU , vmstate_5_plus),VMSTATE_UINT16_TEST (env.intercept_cr_write,X86CPU , vmstate_5_plus), VMSTATE_UINT16_TEST(env.intercept_dr_read, X86CPU, vmstate_5_plus),
@@ -668,12 +668,12 @@ const VMStateDescription vmstate_x86_cpu = {VMSTATE_UINT8_TEST (env.v_tpr,X86CPU , vmstate_5_plus),/* MTRRs */ VMSTATE_UINT64_ARRAY_V (env.mtrr_fixed,X86CPU ,11 ,8 ), -VMSTATE_UINT64_V (env.mtrr_deftype,X86CPU ,8 ), +VMSTATE_UINT64_TEST (env.mtrr_deftype,X86CPU , vmstate_8_plus),VMSTATE_MTRR_VARS (env.mtrr_var,X86CPU ,8 ,8 ),/* KVM-related states */ VMSTATE_INT32_TEST (env.interrupt_injected,X86CPU , vmstate_9_plus),VMSTATE_UINT32_TEST (env.mp_state,X86CPU , vmstate_9_plus), -VMSTATE_UINT64_V (env.tsc,X86CPU ,9 ), +VMSTATE_UINT64_TEST (env.tsc,X86CPU , vmstate_9_plus),VMSTATE_INT32_TEST (env.exception_injected,X86CPU , vmstate_11_plus),VMSTATE_UINT8_TEST (env.soft_interrupt,X86CPU , vmstate_11_plus), VMSTATE_UINT8_TEST(env.nmi_injected, X86CPU, vmstate_11_plus),
@@ -681,18 +681,18 @@ const VMStateDescription vmstate_x86_cpu = {VMSTATE_UINT8_TEST (env.has_error_code,X86CPU , vmstate_11_plus),VMSTATE_UINT32_TEST (env.sipi_vector,X86CPU , vmstate_11_plus),/* MCE */ -VMSTATE_UINT64_V (env.mcg_cap,X86CPU ,10 ), -VMSTATE_UINT64_V (env.mcg_status,X86CPU ,10 ), -VMSTATE_UINT64_V (env.mcg_ctl,X86CPU ,10 ), +VMSTATE_UINT64_TEST (env.mcg_cap,X86CPU , vmstate_10_plus), +VMSTATE_UINT64_TEST (env.mcg_status,X86CPU , vmstate_10_plus), +VMSTATE_UINT64_TEST (env.mcg_ctl,X86CPU , vmstate_10_plus),VMSTATE_UINT64_ARRAY_V (env.mce_banks,X86CPU ,MCE_BANKS_DEF *4 ,10 ),/* rdtscp */ -VMSTATE_UINT64_V (env.tsc_aux,X86CPU ,11 ), +VMSTATE_UINT64_TEST (env.tsc_aux,X86CPU , vmstate_11_plus),/* KVM pvclock msr */ -VMSTATE_UINT64_V (env.system_time_msr,X86CPU ,11 ), -VMSTATE_UINT64_V (env.wall_clock_msr,X86CPU ,11 ), +VMSTATE_UINT64_TEST (env.system_time_msr,X86CPU , vmstate_11_plus), +VMSTATE_UINT64_TEST (env.wall_clock_msr,X86CPU , vmstate_11_plus),/* XSAVE related fields */ -VMSTATE_UINT64_V (env.xcr0,X86CPU ,12 ), -VMSTATE_UINT64_V (env.xstate_bv,X86CPU ,12 ), +VMSTATE_UINT64_TEST (env.xcr0,X86CPU , vmstate_12_plus), +VMSTATE_UINT64_TEST (env.xstate_bv,X86CPU , vmstate_12_plus),VMSTATE_YMMH_REGS_VARS (env.ymmh_regs,X86CPU ,CPU_NB_REGS ,12 ),VMSTATE_END_OF_LIST ()/* The above list is not sorted /wrt version numbers, watch out! */
tests/test-vmstate.c +6 -2
@@ -257,6 +257,8 @@ static const VMStateDescription vmstate_simple_test = {VMSTATE_UINT16_TEST (u16_2, TestSimple, test_false),VMSTATE_UINT32_TEST (u32_1, TestSimple, test_true),VMSTATE_UINT32_TEST (u32_2, TestSimple, test_false), +VMSTATE_UINT64_TEST (u64_1, TestSimple, test_true), +VMSTATE_UINT64_TEST (u64_2, TestSimple, test_false), VMSTATE_END_OF_LIST() } };
@@ -270,6 +272,7 @@ uint8_t wire_simple_test[] = {/* u8_1 */ 0x82 ,/* u16_1 */ 0x02 ,0x00 ,/* u32_1 */ 0x00 ,0x01 ,0x11 ,0x70 , +/* u64_1 */ 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0xb8 ,0xf4 ,0x7c , QEMU_VM_EOF, /* just to ensure we won't get EOF reported prematurely */ };
@@ -321,6 +324,7 @@ static void test_simple_test(void)FIELD_ASSERT (u8_1);FIELD_ASSERT (u16_1);FIELD_ASSERT (u32_1); +FIELD_ASSERT (u64_1);qemu_fclose (loading); }
@@ -344,7 +348,7 @@ static const VMStateDescription vmstate_versioned = {VMSTATE_UINT32 (c, TestStruct),VMSTATE_UINT64 (d, TestStruct),VMSTATE_UINT32_TEST (e, TestStruct, vmstate_2_plus), -VMSTATE_UINT64_V (f, TestStruct,2 ), +VMSTATE_UINT64_TEST (f, TestStruct, vmstate_2_plus), VMSTATE_END_OF_LIST() } };
@@ -417,7 +421,7 @@ static const VMStateDescription vmstate_skipping = {VMSTATE_UINT32_TEST (c, TestStruct, test_skip),VMSTATE_UINT64 (d, TestStruct),VMSTATE_UINT32_TEST (e, TestStruct, test_skip), -VMSTATE_UINT64_V (f, TestStruct,2 ), +VMSTATE_UINT64_TEST (f, TestStruct, vmstate_2_plus), VMSTATE_END_OF_LIST() } };
Signature · 1 line
1.9.0
PATCH 20/97 vmstate: Test for VMSTATE_FLOAT64
In reply to Juan QuintelaRemove unused VMSTATE_FLOAT64_V.
--- include/migration/vmstate.h | 5 +---- tests/test-vmstate.c | 5 +++++ 2 files changed, 6 insertions(+), 4 deletions(-)
include/migration/vmstate.h +1 -4
@@ -596,11 +596,8 @@ extern const VMStateInfo vmstate_info_bitmap; VMSTATE_SINGLE(_f, _s, 0, vmstate_info_int32_le, int32_t) -#define VMSTATE_FLOAT64_V (_f, _s, _v) \ - VMSTATE_SINGLE(_f, _s, _v, vmstate_info_float64, float64) -#define VMSTATE_FLOAT64 (_f, _s) \ - VMSTATE_FLOAT64_V(_f, _s, 0) + VMSTATE_SINGLE_TEST(_f, _s, NULL, 0, vmstate_info_float64, float64)#define VMSTATE_TIMER_TEST (_f, _s, _test) \ VMSTATE_POINTER_TEST(_f, _s, _test, vmstate_info_timer, QEMUTimer *)
tests/test-vmstate.c +5 -0
@@ -66,6 +66,7 @@ typedef struct TestSimple {int16_t i16_1, i16_2;int32_t i32_1, i32_2;int64_t i64_1, i64_2; +float64 f64; } TestSimple;/* Object instantiation, we are going to use it in more than one test */
@@ -89,6 +90,7 @@ TestSimple obj_simple = { .i32_2 = -70000, .i64_1 = 12121212, .i64_2 = -12121212, + .f64 = float64_pi, };/* Description of the values. If you add a primitive type
@@ -113,6 +115,7 @@ static const VMStateDescription vmstate_simple_primitive = {VMSTATE_INT32 (i32_2, TestSimple),VMSTATE_INT64 (i64_1, TestSimple),VMSTATE_INT64 (i64_2, TestSimple), +VMSTATE_FLOAT64 (f64, TestSimple), VMSTATE_END_OF_LIST() } };
@@ -144,6 +147,7 @@ uint8_t wire_simple_primitive[] = {/* i32_2 */ 0xff ,0xfe ,0xee ,0x90 ,/* i64_1 */ 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0xb8 ,0xf4 ,0x7c ,/* i64_2 */ 0xff ,0xff ,0xff ,0xff ,0xff ,0x47 ,0x0b ,0x84 , +/* f64 */ 0x40 ,0x09 ,0x21 ,0xfb ,0x54 ,0x44 ,0x2d ,0x18 , QEMU_VM_EOF, /* just to ensure we won't get EOF reported prematurely */ };
@@ -209,6 +213,7 @@ static void test_simple_primitive(void)FIELD_ASSERT (i32_2);FIELD_ASSERT (i64_1);FIELD_ASSERT (i64_2); +FIELD_ASSERT (f64);/* We save the file again. We want the EOF this time */
Signature · 1 line
1.9.0
PATCH 21/97 vmstate: Test for VMSTATE_UNUSED
In reply to Juan QuintelaRemove VMSTATE_UNUSED_V and fix only user.
--- hw/intc/ioapic_common.c | 3 ++- include/migration/vmstate.h | 11 ++--------- tests/test-vmstate.c | 5 +++++ 3 files changed, 9 insertions(+), 10 deletions(-)
hw/intc/ioapic_common.c +2 -1
@@ -91,7 +91,8 @@ static const VMStateDescription vmstate_ioapic_common = { .fields = (VMStateField[]) {VMSTATE_UINT8 (id, IOAPICCommonState),VMSTATE_UINT8 (ioregsel, IOAPICCommonState), -VMSTATE_UNUSED_V (2 ,8 ),/* to account for qemu-kvm's v2 format */ +/* to account for qemu-kvm's v2 format */ +VMSTATE_UNUSED_TEST (vmstate_2_plus,8 ),VMSTATE_UINT32_TEST (irr, IOAPICCommonState, vmstate_2_plus),VMSTATE_UINT64_ARRAY (ioredtbl, IOAPICCommonState,IOAPIC_NUM_PINS ),VMSTATE_END_OF_LIST ()
include/migration/vmstate.h +2 -9
@@ -482,10 +482,9 @@ extern const VMStateInfo vmstate_info_bitmap; .offset = offsetof(_state, _field), \ } -#define VMSTATE_UNUSED_BUFFER (_test, _version, _size) { \ +#define VMSTATE_UNUSED_TEST (_test, _size) { \ .name = "unused", \ .field_exists = (_test), \ - .version_id = (_version), \ .size = (_size), \ .info = &vmstate_info_unused_buffer, \ .flags = VMS_BUFFER, \
@@ -719,14 +718,8 @@ extern const VMStateInfo vmstate_info_bitmap;#define VMSTATE_BUFFER_UNSAFE (_field, _state, _version, _size) \ VMSTATE_BUFFER_UNSAFE_INFO(_field, _state, _version, vmstate_info_buffer, _size) -#define VMSTATE_UNUSED_V (_v, _size) \ - VMSTATE_UNUSED_BUFFER(NULL, _v, _size) -#define VMSTATE_UNUSED (_size) \ - VMSTATE_UNUSED_V(0, _size) - -#define VMSTATE_UNUSED_TEST (_test, _size) \ - VMSTATE_UNUSED_BUFFER(_test, 0, _size) + VMSTATE_UNUSED_TEST(NULL, _size)#define VMSTATE_END_OF_LIST () \ {}
tests/test-vmstate.c +5 -0
@@ -116,6 +116,7 @@ static const VMStateDescription vmstate_simple_primitive = {VMSTATE_INT64 (i64_1, TestSimple),VMSTATE_INT64 (i64_2, TestSimple),VMSTATE_FLOAT64 (f64, TestSimple), +VMSTATE_UNUSED (5 ), VMSTATE_END_OF_LIST() } };
@@ -148,6 +149,7 @@ uint8_t wire_simple_primitive[] = {/* i64_1 */ 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0xb8 ,0xf4 ,0x7c ,/* i64_2 */ 0xff ,0xff ,0xff ,0xff ,0xff ,0x47 ,0x0b ,0x84 ,/* f64 */ 0x40 ,0x09 ,0x21 ,0xfb ,0x54 ,0x44 ,0x2d ,0x18 , +/* unused */ 0x00 ,0x00 ,0x00 ,0x00 ,0x00 , QEMU_VM_EOF, /* just to ensure we won't get EOF reported prematurely */ };
@@ -264,6 +266,8 @@ static const VMStateDescription vmstate_simple_test = {VMSTATE_UINT32_TEST (u32_2, TestSimple, test_false),VMSTATE_UINT64_TEST (u64_1, TestSimple, test_true),VMSTATE_UINT64_TEST (u64_2, TestSimple, test_false), +VMSTATE_UNUSED_TEST (test_true,5 ), +VMSTATE_UNUSED_TEST (test_false,5 ), VMSTATE_END_OF_LIST() } };
@@ -278,6 +282,7 @@ uint8_t wire_simple_test[] = {/* u16_1 */ 0x02 ,0x00 ,/* u32_1 */ 0x00 ,0x01 ,0x11 ,0x70 ,/* u64_1 */ 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0xb8 ,0xf4 ,0x7c , +/* unused */ 0x00 ,0x00 ,0x00 ,0x00 ,0x00 , QEMU_VM_EOF, /* just to ensure we won't get EOF reported prematurely */ };
Signature · 1 line
1.9.0
PATCH 22/97 vmstate: Test for VMSTATE_BITMAP
In reply to Juan QuintelaRemove the unused version field (was unused).
--- hw/sd/sd.c | 2 +- include/migration/vmstate.h | 4 +- tests/test-vmstate.c | 90 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 93 insertions(+), 3 deletions(-)
hw/sd/sd.c +1 -1
@@ -467,7 +467,7 @@ static const VMStateDescription sd_vmstate = {VMSTATE_UINT32 (card_status, SDState),VMSTATE_PARTIAL_BUFFER (sd_status, SDState,1 ),VMSTATE_UINT32 (vhs, SDState), -VMSTATE_BITMAP (wp_groups, SDState,0 , wpgrps_size), +VMSTATE_BITMAP (wp_groups, SDState, wpgrps_size),VMSTATE_UINT32 (blk_len, SDState),VMSTATE_UINT32 (erase_start, SDState), VMSTATE_UINT32(erase_end, SDState),
include/migration/vmstate.h +2 -2
@@ -493,9 +493,9 @@ extern const VMStateInfo vmstate_info_bitmap;/* _field_size should be a int32_t field in the _state struct giving the * size of the bitmap _field in bits. */ -#define VMSTATE_BITMAP (_field, _state, _version, _field_size) { \ +#define VMSTATE_BITMAP (_field, _state, _field_size) { \ .name = (stringify(_field)), \ - .version_id = (_version), \ + .version_id = 0, \ .size_offset = vmstate_offset_value(_state, _field_size, int32_t),\ .info = &vmstate_info_bitmap, \ .flags = VMS_VBUFFER|VMS_POINTER, \
tests/test-vmstate.c +90 -0
108 lines not on this page · raw message
Signature · 1 line
1.9.0
PATCH 23/97 vmstate: Test for VMSTATE_UINT8_EQUAL
In reply to Juan QuintelaWe intruduce another full test.
--- include/migration/vmstate.h | 2 +- tests/test-vmstate.c | 71 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+), 1 deletion(-)
include/migration/vmstate.h +1 -1
@@ -568,7 +568,7 @@ extern const VMStateInfo vmstate_info_bitmap; VMSTATE_UINT64_TEST(_f, _s, NULL)#define VMSTATE_UINT8_EQUAL (_f, _s) \ - VMSTATE_SINGLE(_f, _s, 0, vmstate_info_uint8_equal, uint8_t) + VMSTATE_SINGLE_TEST(_f, _s, NULL, 0, vmstate_info_uint8_equal, uint8_t)#define VMSTATE_UINT16_EQUAL (_f, _s) \ VMSTATE_SINGLE(_f, _s, 0, vmstate_info_uint16_equal, uint16_t)
tests/test-vmstate.c +71 -0
89 lines not on this page · raw message
Signature · 1 line
1.9.0
PATCH 24/97 vmstate: Test for VMSTATE_UINT16_EQUAL
In reply to Juan QuintelaWe change only user of VMSTATE_UINT16_EQUAL_V to VMSTATE_UINT16_EQUAL_TEST.
--- hw/nvram/eeprom93xx.c | 7 ++++++- include/migration/vmstate.h | 8 ++++---- tests/test-vmstate.c | 8 +++++++- 3 files changed, 17 insertions(+), 6 deletions(-)
hw/nvram/eeprom93xx.c +6 -1
@@ -121,6 +121,11 @@ static bool is_old_eeprom_version(void *opaque, int version_id)return version_id ==OLD_EEPROM_VERSION ; } +static bool is_eeprom_version (void *opaque,int version_id) +{ +return version_id ==EEPROM_VERSION ; +} +static const VMStateDescription vmstate_eeprom = { .name ="eeprom" , .version_id =EEPROM_VERSION ,
@@ -138,7 +143,7 @@ static const VMStateDescription vmstate_eeprom = {VMSTATE_UINT8 (addrbits, eeprom_t),VMSTATE_UINT16_HACK_TEST (size, eeprom_t, is_old_eeprom_version),VMSTATE_UNUSED_TEST (is_old_eeprom_version,1 ), -VMSTATE_UINT16_EQUAL_V (size, eeprom_t,EEPROM_VERSION ), +VMSTATE_UINT16_EQUAL_TEST (size, eeprom_t, is_eeprom_version),VMSTATE_UINT16 (data, eeprom_t),VMSTATE_VARRAY_UINT16_UNSAFE (contents, eeprom_t, size,0 , vmstate_info_uint16, uint16_t),
include/migration/vmstate.h +4 -4
@@ -570,11 +570,11 @@ extern const VMStateInfo vmstate_info_bitmap;#define VMSTATE_UINT8_EQUAL (_f, _s) \ VMSTATE_SINGLE_TEST(_f, _s, NULL, 0, vmstate_info_uint8_equal, uint8_t) -#define VMSTATE_UINT16_EQUAL (_f, _s) \ - VMSTATE_SINGLE(_f, _s, 0, vmstate_info_uint16_equal, uint16_t) +#define VMSTATE_UINT16_EQUAL_TEST (_f, _s, _t) \ + VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_info_uint16_equal, uint16_t) -#define VMSTATE_UINT16_EQUAL_V (_f, _s, _v) \ - VMSTATE_SINGLE(_f, _s, _v, vmstate_info_uint16_equal, uint16_t) +#define VMSTATE_UINT16_EQUAL (_f, _s) \ + VMSTATE_UINT16_EQUAL_TEST(_f, _s, NULL)#define VMSTATE_INT32_EQUAL (_f, _s) \ VMSTATE_SINGLE(_f, _s, 0, vmstate_info_int32_equal, int32_t)
tests/test-vmstate.c +7 -1
@@ -60,7 +60,7 @@ static QEMUFile *open_test_file(bool write) typedef struct TestSimple { bool b_1, b_2; uint8_t u8_1, u8_2; - uint16_t u16_1, u16_2; + uint16_t u16_1, u16_2, u16_3; uint32_t u32_1, u32_2; uint64_t u64_1, u64_2; int8_t i8_1, i8_2;
@@ -79,6 +79,7 @@ TestSimple obj_simple = { .u8_1 = 130, .u16_1 = 512, .u16_2 = 45000, + .u16_3 = 512, .u32_1 = 70000, .u32_2 = 100000, .u64_1 = 12121212,
@@ -347,12 +348,17 @@ static const VMStateDescription vmstate_simple_compare = { .minimum_version_id_old = 1, .fields = (VMStateField []) {VMSTATE_UINT8_EQUAL (u8_1, TestSimple), +VMSTATE_UINT16_EQUAL (u16_1, TestSimple), +VMSTATE_UINT16_EQUAL_TEST (u16_2, TestSimple, test_false), +VMSTATE_UINT16_EQUAL_TEST (u16_3, TestSimple, test_true),VMSTATE_END_OF_LIST () } };uint8_t wire_simple_compare[] = {/* u8_1 */ 0x82 , +/* u16_1 */ 0x02 ,0x00 , +/* u16_3 */ 0x02 ,0x00 ,QEMU_VM_EOF ,/* just to ensure we won't get EOF reported prematurely */ };
Signature · 1 line
1.9.0
PATCH 25/97 vmstate: Test for VMSTATE_UINT32_EQUAL
In reply to Juan QuintelaRemove unused VMSTATE_UINT32_EQUAL_V.
--- include/migration/vmstate.h | 9 +++------ tests/test-vmstate.c | 2 ++ 2 files changed, 5 insertions(+), 6 deletions(-)
include/migration/vmstate.h +3 -6
@@ -576,15 +576,12 @@ extern const VMStateInfo vmstate_info_bitmap;#define VMSTATE_UINT16_EQUAL (_f, _s) \ VMSTATE_UINT16_EQUAL_TEST(_f, _s, NULL) +#define VMSTATE_UINT32_EQUAL (_f, _s) \ + VMSTATE_SINGLE_TEST(_f, _s, NULL, 0, vmstate_info_uint32_equal, uint32_t) +#define VMSTATE_INT32_EQUAL (_f, _s) \ VMSTATE_SINGLE(_f, _s, 0, vmstate_info_int32_equal, int32_t) -#define VMSTATE_UINT32_EQUAL_V (_f, _s, _v) \ - VMSTATE_SINGLE(_f, _s, _v, vmstate_info_uint32_equal, uint32_t) - -#define VMSTATE_UINT32_EQUAL (_f, _s) \ - VMSTATE_UINT32_EQUAL_V(_f, _s, 0) -#define VMSTATE_UINT64_EQUAL_V (_f, _s, _v) \ VMSTATE_SINGLE(_f, _s, _v, vmstate_info_uint64_equal, uint64_t)
tests/test-vmstate.c +2 -0
@@ -351,6 +351,7 @@ static const VMStateDescription vmstate_simple_compare = {VMSTATE_UINT16_EQUAL (u16_1, TestSimple),VMSTATE_UINT16_EQUAL_TEST (u16_2, TestSimple, test_false),VMSTATE_UINT16_EQUAL_TEST (u16_3, TestSimple, test_true), +VMSTATE_UINT32_EQUAL (u32_1, TestSimple), VMSTATE_END_OF_LIST() } };
@@ -359,6 +360,7 @@ uint8_t wire_simple_compare[] = {/* u8_1 */ 0x82 ,/* u16_1 */ 0x02 ,0x00 ,/* u16_3 */ 0x02 ,0x00 , +/* u32_1 */ 0x00 ,0x01 ,0x11 ,0x70 , QEMU_VM_EOF, /* just to ensure we won't get EOF reported prematurely */ };
Signature · 1 line
1.9.0
PATCH 26/97 vmstate: Test for VMSTATE_UINT64_EQUAL
In reply to Juan QuintelaRemove unused VMSTATE_UINT64_EQUAL_V.
--- include/migration/vmstate.h | 9 +++------ tests/test-vmstate.c | 2 ++ 2 files changed, 5 insertions(+), 6 deletions(-)
include/migration/vmstate.h +3 -6
@@ -579,15 +579,12 @@ extern const VMStateInfo vmstate_info_bitmap;#define VMSTATE_UINT32_EQUAL (_f, _s) \ VMSTATE_SINGLE_TEST(_f, _s, NULL, 0, vmstate_info_uint32_equal, uint32_t) +#define VMSTATE_UINT64_EQUAL (_f, _s) \ + VMSTATE_SINGLE_TEST(_f, _s, NULL, 0, vmstate_info_uint64_equal, uint64_t) +#define VMSTATE_INT32_EQUAL (_f, _s) \ VMSTATE_SINGLE(_f, _s, 0, vmstate_info_int32_equal, int32_t) -#define VMSTATE_UINT64_EQUAL_V (_f, _s, _v) \ - VMSTATE_SINGLE(_f, _s, _v, vmstate_info_uint64_equal, uint64_t) - -#define VMSTATE_UINT64_EQUAL (_f, _s) \ - VMSTATE_UINT64_EQUAL_V(_f, _s, 0) -#define VMSTATE_INT32_LE (_f, _s) \ VMSTATE_SINGLE(_f, _s, 0, vmstate_info_int32_le, int32_t)
tests/test-vmstate.c +2 -0
@@ -352,6 +352,7 @@ static const VMStateDescription vmstate_simple_compare = {VMSTATE_UINT16_EQUAL_TEST (u16_2, TestSimple, test_false),VMSTATE_UINT16_EQUAL_TEST (u16_3, TestSimple, test_true),VMSTATE_UINT32_EQUAL (u32_1, TestSimple), +VMSTATE_UINT64_EQUAL (u64_1, TestSimple), VMSTATE_END_OF_LIST() } };
@@ -361,6 +362,7 @@ uint8_t wire_simple_compare[] = {/* u16_1 */ 0x02 ,0x00 ,/* u16_3 */ 0x02 ,0x00 ,/* u32_1 */ 0x00 ,0x01 ,0x11 ,0x70 , +/* u64_1 */ 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0xb8 ,0xf4 ,0x7c , QEMU_VM_EOF, /* just to ensure we won't get EOF reported prematurely */ };
Signature · 1 line
1.9.0
PATCH 27/97 vmstate: Test for VMSTATE_INT32_EQUAL
In reply to Juan Quintela--- include/migration/vmstate.h | 2 +- tests/test-vmstate.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-)
include/migration/vmstate.h +1 -1
@@ -583,7 +583,7 @@ extern const VMStateInfo vmstate_info_bitmap; VMSTATE_SINGLE_TEST(_f, _s, NULL, 0, vmstate_info_uint64_equal, uint64_t)#define VMSTATE_INT32_EQUAL (_f, _s) \ - VMSTATE_SINGLE(_f, _s, 0, vmstate_info_int32_equal, int32_t) + VMSTATE_SINGLE_TEST(_f, _s, NULL, 0, vmstate_info_int32_equal, int32_t)#define VMSTATE_INT32_LE (_f, _s) \ VMSTATE_SINGLE(_f, _s, 0, vmstate_info_int32_le, int32_t)
tests/test-vmstate.c +2 -0
@@ -353,6 +353,7 @@ static const VMStateDescription vmstate_simple_compare = {VMSTATE_UINT16_EQUAL_TEST (u16_3, TestSimple, test_true),VMSTATE_UINT32_EQUAL (u32_1, TestSimple),VMSTATE_UINT64_EQUAL (u64_1, TestSimple), +VMSTATE_INT32_EQUAL (i32_1, TestSimple), VMSTATE_END_OF_LIST() } };
@@ -363,6 +364,7 @@ uint8_t wire_simple_compare[] = {/* u16_3 */ 0x02 ,0x00 ,/* u32_1 */ 0x00 ,0x01 ,0x11 ,0x70 ,/* u64_1 */ 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0xb8 ,0xf4 ,0x7c , +/* i32_1 */ 0x00 ,0x01 ,0x11 ,0x70 , QEMU_VM_EOF, /* just to ensure we won't get EOF reported prematurely */ };
Signature · 1 line
1.9.0
PATCH 28/97 vmstate: Test for VMSTATE_INT32_LE
In reply to Juan QuintelaAdd tests for less/more than the value on destination.
--- include/migration/vmstate.h | 4 ++-- tests/test-vmstate.c | 25 ++++++++++++++++++++++++- 2 files changed, 26 insertions(+), 3 deletions(-)
include/migration/vmstate.h +2 -2
@@ -585,8 +585,8 @@ extern const VMStateInfo vmstate_info_bitmap;#define VMSTATE_INT32_EQUAL (_f, _s) \ VMSTATE_SINGLE_TEST(_f, _s, NULL, 0, vmstate_info_int32_equal, int32_t) -#define VMSTATE_INT32_LE (_f, _s) \ - VMSTATE_SINGLE(_f, _s, 0, vmstate_info_int32_le, int32_t) +#define VMSTATE_INT32_LE (_f, _s) \ + VMSTATE_SINGLE_TEST(_f, _s, NULL, 0, vmstate_info_int32_le, int32_t)#define VMSTATE_FLOAT64 (_f, _s) \
tests/test-vmstate.c +24 -1
@@ -353,7 +353,8 @@ static const VMStateDescription vmstate_simple_compare = {VMSTATE_UINT16_EQUAL_TEST (u16_3, TestSimple, test_true),VMSTATE_UINT32_EQUAL (u32_1, TestSimple),VMSTATE_UINT64_EQUAL (u64_1, TestSimple), -VMSTATE_INT32_EQUAL (i32_1, TestSimple), +VMSTATE_INT32_EQUAL (i32_2, TestSimple), +VMSTATE_INT32_LE (i32_1, TestSimple), VMSTATE_END_OF_LIST() } };
@@ -364,6 +365,7 @@ uint8_t wire_simple_compare[] = {/* u16_3 */ 0x02 ,0x00 ,/* u32_1 */ 0x00 ,0x01 ,0x11 ,0x70 ,/* u64_1 */ 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0xb8 ,0xf4 ,0x7c , +/* i32_2 */ 0xff ,0xfe ,0xee ,0x90 ,/* i32_1 */ 0x00 ,0x01 ,0x11 ,0x70 , QEMU_VM_EOF, /* just to ensure we won't get EOF reported prematurely */ };
@@ -419,6 +421,27 @@ static void test_simple_compare(void)FAILURE (vmstate_load_state (loading, &vmstate_simple_compare, &obj,1 ));g_assert (!qemu_file_get_error (loading));qemu_fclose (loading); + +/* testing less equal */ + + loading =open_test_file (false); +memcpy (&obj, &obj_simple,sizeof (obj)); +/* value on the wire is bigger, so fail */ + obj.i32_1 =8000 ; + +FAILURE (vmstate_load_state (loading, &vmstate_simple_compare, &obj,1 )); +g_assert (!qemu_file_get_error (loading)); +qemu_fclose (loading); + + loading =open_test_file (false); +memcpy (&obj, &obj_simple,sizeof (obj)); +/* value on the wire is lower, so success */ + obj.i32_1 =80000 ; + +SUCCESS (vmstate_load_state (loading, &vmstate_simple_compare, &obj,1 )); +g_assert (!qemu_file_get_error (loading)); +qemu_fclose (loading); + }#undef FIELD_ASSERT
Signature · 1 line
1.9.0
PATCH 29/97 vmstate: s/VMSTATE_INT32_LE/VMSTATE_INT32_POSITIVE_LE/
In reply to Juan QuintelaFrom: "Michael S. Tsirkin" <[email protected]>
As the macro verifies the value is positive, rename it to make the function clearer.
--- hw/pci/pci.c | 4 ++-- include/migration/vmstate.h | 3 +-- target-arm/machine.c | 2 +- tests/test-vmstate.c | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-)
hw/pci/pci.c +2 -2
@@ -473,7 +473,7 @@ const VMStateDescription vmstate_pci_device = { .version_id = 2, .minimum_version_id = 1, .fields = (VMStateField []) { -VMSTATE_INT32_LE (version_id, PCIDevice), +VMSTATE_INT32_POSITIVE_LE (version_id, PCIDevice),VMSTATE_BUFFER_UNSAFE_INFO (config, PCIDevice,0 , vmstate_info_pci_config,PCI_CONFIG_SPACE_SIZE ),
@@ -489,7 +489,7 @@ const VMStateDescription vmstate_pcie_device = { .version_id = 2, .minimum_version_id = 1, .fields = (VMStateField []) { -VMSTATE_INT32_LE (version_id, PCIDevice), +VMSTATE_INT32_POSITIVE_LE (version_id, PCIDevice),VMSTATE_BUFFER_UNSAFE_INFO (config, PCIDevice,0 , vmstate_info_pci_config,PCIE_CONFIG_SPACE_SIZE ),
include/migration/vmstate.h +1 -2
@@ -585,10 +585,9 @@ extern const VMStateInfo vmstate_info_bitmap;#define VMSTATE_INT32_EQUAL (_f, _s) \ VMSTATE_SINGLE_TEST(_f, _s, NULL, 0, vmstate_info_int32_equal, int32_t) -#define VMSTATE_INT32_LE (_f, _s) \ +#define VMSTATE_INT32_POSITIVE_LE (_f, _s) \ VMSTATE_SINGLE_TEST(_f, _s, NULL, 0, vmstate_info_int32_le, int32_t) -#define VMSTATE_FLOAT64 (_f, _s) \ VMSTATE_SINGLE_TEST(_f, _s, NULL, 0, vmstate_info_float64, float64)
target-arm/machine.c +1 -1
@@ -241,7 +241,7 @@ const VMStateDescription vmstate_arm_cpu = {/* The length-check must come before the arrays to avoid * incoming data possibly overflowing the array. */ -VMSTATE_INT32_LE (cpreg_vmstate_array_len,ARMCPU ), +VMSTATE_INT32_POSITIVE_LE (cpreg_vmstate_array_len,ARMCPU ),VMSTATE_VARRAY_INT32 (cpreg_vmstate_indexes,ARMCPU , cpreg_vmstate_array_len, 0, vmstate_info_uint64, uint64_t),
tests/test-vmstate.c +1 -1
@@ -354,7 +354,7 @@ static const VMStateDescription vmstate_simple_compare = {VMSTATE_UINT32_EQUAL (u32_1, TestSimple),VMSTATE_UINT64_EQUAL (u64_1, TestSimple),VMSTATE_INT32_EQUAL (i32_2, TestSimple), -VMSTATE_INT32_LE (i32_1, TestSimple), +VMSTATE_INT32_POSITIVE_LE (i32_1, TestSimple), VMSTATE_END_OF_LIST() } };
Signature · 1 line
1.9.0
PATCH 30/97 vmstate: Move VMSTATE_TIMER_V to VMSTATE_TIMER_TEST
In reply to Juan QuintelaNo test created, because it is basically imposible to create a timer by hand :-(
--- hw/timer/mc146818rtc.c | 2 +- include/migration/vmstate.h | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-)
hw/timer/mc146818rtc.c +1 -1
@@ -733,7 +733,7 @@ static const VMStateDescription vmstate_rtc = {VMSTATE_UINT64_TEST (base_rtc, RTCState, vmstate_3_plus),VMSTATE_UINT64_TEST (last_update, RTCState, vmstate_3_plus),VMSTATE_INT64_TEST (offset, RTCState, vmstate_3_plus), -VMSTATE_TIMER_V (update_timer, RTCState,3 ), +VMSTATE_TIMER_TEST (update_timer, RTCState, vmstate_3_plus),VMSTATE_UINT64_TEST (next_alarm_time, RTCState, vmstate_3_plus), VMSTATE_END_OF_LIST() }
include/migration/vmstate.h +2 -5
@@ -594,13 +594,10 @@ extern const VMStateInfo vmstate_info_bitmap;#define VMSTATE_TIMER_TEST (_f, _s, _test) \ VMSTATE_POINTER_TEST(_f, _s, _test, vmstate_info_timer, QEMUTimer *) -#define VMSTATE_TIMER_V (_f, _s, _v) \ - VMSTATE_POINTER(_f, _s, _v, vmstate_info_timer, QEMUTimer *) -#define VMSTATE_TIMER (_f, _s) \ - VMSTATE_TIMER_V(_f, _s, 0) + VMSTATE_TIMER_TEST(_f, _s, NULL) -#define VMSTATE_TIMER_ARRAY (_f, _s, _n) \ +#define VMSTATE_TIMER_ARRAY (_f, _s, _n) \ VMSTATE_ARRAY_OF_POINTER(_f, _s, _n, 0, vmstate_info_timer, QEMUTimer *)#define VMSTATE_BOOL_ARRAY_V (_f, _s, _n, _v) \
Signature · 1 line
1.9.0
PATCH 31/97 vmstate: Test for VMSTATE_ARRAY_BOOL_TEST
In reply to Juan QuintelaWe add all the boilerplate code for testing arrays.
We change only user of VMSTATE_ARRAY_BOOL_V to VMSTATE_ARRAY_BOOL_TEST.
--- hw/audio/hda-codec.c | 3 +- include/migration/vmstate.h | 8 +-- tests/test-vmstate.c | 171 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 177 insertions(+), 5 deletions(-)
hw/audio/hda-codec.c +2 -1
@@ -603,7 +603,8 @@ static const VMStateDescription vmstate_hda_audio = { vmstate_hda_audio_stream, HDAAudioStream),VMSTATE_BOOL_ARRAY (running_compat, HDAAudioState,16 ), - VMSTATE_BOOL_ARRAY_V(running_real, HDAAudioState, 2 * 16, 2), +VMSTATE_BOOL_ARRAY_TEST (running_real, HDAAudioState,2 *16 , + vmstate_2_plus), VMSTATE_END_OF_LIST() } };
include/migration/vmstate.h +4 -4
@@ -600,11 +600,11 @@ extern const VMStateInfo vmstate_info_bitmap;#define VMSTATE_TIMER_ARRAY (_f, _s, _n) \ VMSTATE_ARRAY_OF_POINTER(_f, _s, _n, 0, vmstate_info_timer, QEMUTimer *) -#define VMSTATE_BOOL_ARRAY_V (_f, _s, _n, _v) \ - VMSTATE_ARRAY(_f, _s, _n, _v, vmstate_info_bool, bool) +#define VMSTATE_BOOL_ARRAY_TEST (_f, _s, _n, _t) \ + VMSTATE_ARRAY_TEST(_f, _s, _n, _t, vmstate_info_bool, bool) -#define VMSTATE_BOOL_ARRAY (_f, _s, _n) \ - VMSTATE_BOOL_ARRAY_V(_f, _s, _n, 0) +#define VMSTATE_BOOL_ARRAY (_f, _s, _n) \ + VMSTATE_BOOL_ARRAY_TEST(_f, _s, _n, NULL)#define VMSTATE_UINT16_ARRAY_V (_f, _s, _n, _v) \ VMSTATE_ARRAY(_f, _s, _n, _v, vmstate_info_uint16, uint16_t)
tests/test-vmstate.c +171 -0
183 lines not on this page · raw message
Signature · 1 line
1.9.0
PATCH 32/97 vmstate: Test for VMSTATE_UINT8_ARRAY
In reply to Juan QuintelaRemove VMSTATE_UINT8_ARRAY_V that was unused.
--- include/migration/vmstate.h | 9 +++------ tests/test-vmstate.c | 11 +++++++++++ 2 files changed, 14 insertions(+), 6 deletions(-)
include/migration/vmstate.h +3 -6
@@ -606,6 +606,9 @@ extern const VMStateInfo vmstate_info_bitmap;#define VMSTATE_BOOL_ARRAY (_f, _s, _n) \ VMSTATE_BOOL_ARRAY_TEST(_f, _s, _n, NULL) +#define VMSTATE_UINT8_ARRAY (_f, _s, _n) \ + VMSTATE_ARRAY_TEST(_f, _s, _n, NULL, vmstate_info_uint8, uint8_t) +#define VMSTATE_UINT16_ARRAY_V (_f, _s, _n, _v) \ VMSTATE_ARRAY(_f, _s, _n, _v, vmstate_info_uint16, uint16_t)
@@ -621,12 +624,6 @@ extern const VMStateInfo vmstate_info_bitmap;#define VMSTATE_UINT8_2DARRAY_V (_f, _s, _n1, _n2, _v) \ VMSTATE_2DARRAY(_f, _s, _n1, _n2, _v, vmstate_info_uint8, uint8_t) -#define VMSTATE_UINT8_ARRAY_V (_f, _s, _n, _v) \ - VMSTATE_ARRAY(_f, _s, _n, _v, vmstate_info_uint8, uint8_t) - -#define VMSTATE_UINT8_ARRAY (_f, _s, _n) \ - VMSTATE_UINT8_ARRAY_V(_f, _s, _n, 0) -#define VMSTATE_UINT8_SUB_ARRAY (_f, _s, _start, _num) \ VMSTATE_SUB_ARRAY(_f, _s, _start, _num, 0, vmstate_info_uint8, uint8_t)
tests/test-vmstate.c +11 -0
@@ -540,12 +540,16 @@ typedef struct TestArray {int32_t size;bool b_1[VMSTATE_ARRAY_SIZE ];bool b_2[VMSTATE_ARRAY_SIZE ]; +uint8_t u8_1[VMSTATE_ARRAY_SIZE ]; +uint8_t u8_2[VMSTATE_ARRAY_SIZE ]; } TestArray;TestArray obj_array = { .size =VMSTATE_ARRAY_SIZE , .b_1 = { false, true, false, true, false}, .b_2 = { true, false, true, false, true}, + .u8_1 = {1 ,2 ,3 ,4 ,5 }, + .u8_2 = {5 ,4 ,3 ,2 ,1 }, };static const VMStateDescription vmstate_array_primitive = {
@@ -556,6 +560,7 @@ static const VMStateDescription vmstate_array_primitive = { .fields = (VMStateField[]) {VMSTATE_INT32 (size, TestArray),VMSTATE_BOOL_ARRAY (b_1, TestArray,VMSTATE_ARRAY_SIZE ), +VMSTATE_UINT8_ARRAY (u8_1, TestArray,VMSTATE_ARRAY_SIZE ),VMSTATE_END_OF_LIST () } };
@@ -563,6 +568,7 @@ static const VMStateDescription vmstate_array_primitive = {uint8_t wire_array_primitive[] = {/* size */ 0x00 ,0x00 ,0x00 ,0x05 ,/* b_1 */ 0x00 ,0x01 ,0x00 ,0x01 ,0x00 , +/* u8_1 */ 0x01 ,0x02 ,0x03 ,0x04 ,0x05 ,QEMU_VM_EOF ,/* just to ensure we won't get EOF reported prematurely */ };
@@ -611,10 +617,14 @@ static void test_array_primitive(void)#define FIELD_ASSERT (name) g_assert_cmpint(obj.name, ==, obj_array.name)#define ELEM_ASSERT (name, i) \ g_assert_cmpint(obj.name[i], ==, obj_array.name[i]) +#define ELEM_NOT_ASSERT (name, i) \ + g_assert_cmpint(obj.name[i], !=, obj_array.name[i])FIELD_ASSERT (size);for (i =0 ; i <VMSTATE_ARRAY_SIZE ; i++) {ELEM_ASSERT (b_1, i); +ELEM_ASSERT (u8_1, i); +ELEM_NOT_ASSERT (u8_2, i); }/* We save the file again. We want the EOF this time */
@@ -701,6 +711,7 @@ static void test_array_test(void) }#undef FIELD_ASSERT#undef ELEM_ASSERT +#undef ELEM_NOT_ASSERT typedef struct TestStruct {
Signature · 1 line
1.9.0
PATCH 33/97 vmstate: Test for VMSTATE_UINT16_ARRAY
In reply to Juan QuintelaRemove unused VMSTATE_UINT16_ARRAY_V.
--- include/migration/vmstate.h | 7 ++----- tests/test-vmstate.c | 5 +++++ 2 files changed, 7 insertions(+), 5 deletions(-)
include/migration/vmstate.h +2 -5
@@ -609,15 +609,12 @@ extern const VMStateInfo vmstate_info_bitmap;#define VMSTATE_UINT8_ARRAY (_f, _s, _n) \ VMSTATE_ARRAY_TEST(_f, _s, _n, NULL, vmstate_info_uint8, uint8_t) -#define VMSTATE_UINT16_ARRAY_V (_f, _s, _n, _v) \ - VMSTATE_ARRAY(_f, _s, _n, _v, vmstate_info_uint16, uint16_t) +#define VMSTATE_UINT16_ARRAY (_f, _s, _n) \ + VMSTATE_ARRAY_TEST(_f, _s, _n, NULL, vmstate_info_uint16, uint16_t)#define VMSTATE_UINT16_2DARRAY_V (_f, _s, _n1, _n2, _v) \ VMSTATE_2DARRAY(_f, _s, _n1, _n2, _v, vmstate_info_uint16, uint16_t) -#define VMSTATE_UINT16_ARRAY (_f, _s, _n) \ - VMSTATE_UINT16_ARRAY_V(_f, _s, _n, 0) -#define VMSTATE_UINT16_2DARRAY (_f, _s, _n1, _n2) \ VMSTATE_UINT16_2DARRAY_V(_f, _s, _n1, _n2, 0)
tests/test-vmstate.c +5 -0
@@ -542,6 +542,7 @@ typedef struct TestArray {bool b_2[VMSTATE_ARRAY_SIZE ];uint8_t u8_1[VMSTATE_ARRAY_SIZE ];uint8_t u8_2[VMSTATE_ARRAY_SIZE ]; +uint16_t u16_1[VMSTATE_ARRAY_SIZE ]; } TestArray;TestArray obj_array = {
@@ -550,6 +551,7 @@ TestArray obj_array = { .b_2 = { true, false, true, false, true}, .u8_1 = { 1, 2, 3, 4, 5}, .u8_2 = { 5, 4, 3, 2, 1}, + .u16_1 = {11, 12, 13, 14, 15}, }; static const VMStateDescription vmstate_array_primitive = {
@@ -561,6 +563,7 @@ static const VMStateDescription vmstate_array_primitive = {VMSTATE_INT32 (size, TestArray),VMSTATE_BOOL_ARRAY (b_1, TestArray,VMSTATE_ARRAY_SIZE ),VMSTATE_UINT8_ARRAY (u8_1, TestArray,VMSTATE_ARRAY_SIZE ), +VMSTATE_UINT16_ARRAY (u16_1, TestArray,VMSTATE_ARRAY_SIZE ), VMSTATE_END_OF_LIST() } };
@@ -569,6 +572,7 @@ uint8_t wire_array_primitive[] = {/* size */ 0x00 ,0x00 ,0x00 ,0x05 ,/* b_1 */ 0x00 ,0x01 ,0x00 ,0x01 ,0x00 ,/* u8_1 */ 0x01 ,0x02 ,0x03 ,0x04 ,0x05 , +/* u16_1 */ 0x00 ,0x0b ,0x00 ,0x0c ,0x00 ,0x0d ,0x00 ,0x0e ,0x00 ,0x0f , QEMU_VM_EOF, /* just to ensure we won't get EOF reported prematurely */ };
@@ -625,6 +629,7 @@ static void test_array_primitive(void)ELEM_ASSERT (b_1, i);ELEM_ASSERT (u8_1, i);ELEM_NOT_ASSERT (u8_2, i); +ELEM_ASSERT (u16_1, i); }/* We save the file again. We want the EOF this time */
Signature · 1 line
1.9.0
PATCH 34/97 vmstate: Test for VMSTATE_UINT32_ARRAY{_TEST}
In reply to Juan QuintelaOnce there, change only user of VMSTATE_UInT32_ARRAY_V.
--- hw/misc/arm_sysctl.c | 3 ++- include/migration/vmstate.h | 15 ++++++--------- tests/test-vmstate.c | 18 ++++++++++++++++++ 3 files changed, 26 insertions(+), 10 deletions(-)
hw/misc/arm_sysctl.c +2 -1
@@ -65,7 +65,8 @@ static const VMStateDescription vmstate_arm_sysctl = {VMSTATE_UINT32_TEST (sys_cfgctrl, arm_sysctl_state, vmstate_2_plus),VMSTATE_UINT32_TEST (sys_cfgstat, arm_sysctl_state, vmstate_2_plus),VMSTATE_UINT32_TEST (sys_clcd, arm_sysctl_state, vmstate_3_plus), -VMSTATE_UINT32_ARRAY_V (mb_clock, arm_sysctl_state,6 ,4 ), +VMSTATE_UINT32_ARRAY_TEST (mb_clock, arm_sysctl_state,6 , + vmstate_4_plus),VMSTATE_VARRAY_UINT32 (db_clock, arm_sysctl_state, db_num_clocks,4 , vmstate_info_uint32, uint32_t),VMSTATE_END_OF_LIST ()
include/migration/vmstate.h +6 -9
@@ -612,6 +612,12 @@ extern const VMStateInfo vmstate_info_bitmap;#define VMSTATE_UINT16_ARRAY (_f, _s, _n) \ VMSTATE_ARRAY_TEST(_f, _s, _n, NULL, vmstate_info_uint16, uint16_t) +#define VMSTATE_UINT32_ARRAY_TEST (_f, _s, _n, _t) \ + VMSTATE_ARRAY_TEST(_f, _s, _n, _t, vmstate_info_uint32, uint32_t) + +#define VMSTATE_UINT32_ARRAY (_f, _s, _n) \ + VMSTATE_UINT32_ARRAY_TEST(_f, _s, _n, NULL) +#define VMSTATE_UINT16_2DARRAY_V (_f, _s, _n1, _n2, _v) \ VMSTATE_2DARRAY(_f, _s, _n1, _n2, _v, vmstate_info_uint16, uint16_t)
@@ -627,15 +633,9 @@ extern const VMStateInfo vmstate_info_bitmap;#define VMSTATE_UINT8_2DARRAY (_f, _s, _n1, _n2) \ VMSTATE_UINT8_2DARRAY_V(_f, _s, _n1, _n2, 0) -#define VMSTATE_UINT32_ARRAY_V (_f, _s, _n, _v) \ - VMSTATE_ARRAY(_f, _s, _n, _v, vmstate_info_uint32, uint32_t) -#define VMSTATE_UINT32_2DARRAY_V (_f, _s, _n1, _n2, _v) \ VMSTATE_2DARRAY(_f, _s, _n1, _n2, _v, vmstate_info_uint32, uint32_t) -#define VMSTATE_UINT32_ARRAY (_f, _s, _n) \ - VMSTATE_UINT32_ARRAY_V(_f, _s, _n, 0) -#define VMSTATE_UINT32_2DARRAY (_f, _s, _n1, _n2) \ VMSTATE_UINT32_2DARRAY_V(_f, _s, _n1, _n2, 0)
@@ -660,9 +660,6 @@ extern const VMStateInfo vmstate_info_bitmap;#define VMSTATE_UINT32_SUB_ARRAY (_f, _s, _start, _num) \ VMSTATE_SUB_ARRAY(_f, _s, _start, _num, 0, vmstate_info_uint32, uint32_t) -#define VMSTATE_UINT32_ARRAY (_f, _s, _n) \ - VMSTATE_UINT32_ARRAY_V(_f, _s, _n, 0) -#define VMSTATE_INT64_ARRAY_V (_f, _s, _n, _v) \ VMSTATE_ARRAY(_f, _s, _n, _v, vmstate_info_int64, int64_t)
tests/test-vmstate.c +18 -0
@@ -543,6 +543,8 @@ typedef struct TestArray {uint8_t u8_1[VMSTATE_ARRAY_SIZE ];uint8_t u8_2[VMSTATE_ARRAY_SIZE ];uint16_t u16_1[VMSTATE_ARRAY_SIZE ]; +uint32_t u32_1[VMSTATE_ARRAY_SIZE ]; +uint32_t u32_2[VMSTATE_ARRAY_SIZE ]; } TestArray;TestArray obj_array = {
@@ -552,6 +554,8 @@ TestArray obj_array = { .u8_1 = { 1, 2, 3, 4, 5}, .u8_2 = { 5, 4, 3, 2, 1}, .u16_1 = {11, 12, 13, 14, 15}, + .u32_1 = {21, 22, 23, 24, 25}, + .u32_2 = {25, 24, 23, 22, 21}, }; static const VMStateDescription vmstate_array_primitive = {
@@ -564,6 +568,7 @@ static const VMStateDescription vmstate_array_primitive = {VMSTATE_BOOL_ARRAY (b_1, TestArray,VMSTATE_ARRAY_SIZE ),VMSTATE_UINT8_ARRAY (u8_1, TestArray,VMSTATE_ARRAY_SIZE ),VMSTATE_UINT16_ARRAY (u16_1, TestArray,VMSTATE_ARRAY_SIZE ), +VMSTATE_UINT32_ARRAY (u32_1, TestArray,VMSTATE_ARRAY_SIZE ), VMSTATE_END_OF_LIST() } };
@@ -573,6 +578,9 @@ uint8_t wire_array_primitive[] = {/* b_1 */ 0x00 ,0x01 ,0x00 ,0x01 ,0x00 ,/* u8_1 */ 0x01 ,0x02 ,0x03 ,0x04 ,0x05 ,/* u16_1 */ 0x00 ,0x0b ,0x00 ,0x0c ,0x00 ,0x0d ,0x00 ,0x0e ,0x00 ,0x0f , +/* u32_1 */ 0x00 ,0x00 ,0x00 ,0x15 ,0x00 ,0x00 ,0x00 ,0x16 , +0x00 ,0x00 ,0x00 ,0x17 ,0x00 ,0x00 ,0x00 ,0x18 , +0x00 ,0x00 ,0x00 ,0x19 , QEMU_VM_EOF, /* just to ensure we won't get EOF reported prematurely */ };
@@ -630,6 +638,7 @@ static void test_array_primitive(void)ELEM_ASSERT (u8_1, i);ELEM_NOT_ASSERT (u8_2, i);ELEM_ASSERT (u16_1, i); +ELEM_ASSERT (u32_1, i); }/* We save the file again. We want the EOF this time */
@@ -656,6 +665,10 @@ static const VMStateDescription vmstate_array_test = {VMSTATE_INT32 (size, TestArray),VMSTATE_BOOL_ARRAY_TEST (b_1, TestArray,VMSTATE_ARRAY_SIZE , test_true),VMSTATE_BOOL_ARRAY_TEST (b_2, TestArray,VMSTATE_ARRAY_SIZE , test_false), +VMSTATE_UINT32_ARRAY_TEST (u32_1, TestArray,VMSTATE_ARRAY_SIZE , + test_true), +VMSTATE_UINT32_ARRAY_TEST (u32_2, TestArray,VMSTATE_ARRAY_SIZE , + test_false), VMSTATE_END_OF_LIST() } };
@@ -663,6 +676,9 @@ static const VMStateDescription vmstate_array_test = {uint8_t wire_array_test[] = {/* size */ 0x00 ,0x00 ,0x00 ,0x05 ,/* b_1 */ 0x00 ,0x01 ,0x00 ,0x01 ,0x00 , +/* u32_1 */ 0x00 ,0x00 ,0x00 ,0x15 ,0x00 ,0x00 ,0x00 ,0x16 , +0x00 ,0x00 ,0x00 ,0x17 ,0x00 ,0x00 ,0x00 ,0x18 , +0x00 ,0x00 ,0x00 ,0x19 ,QEMU_VM_EOF ,/* just to ensure we won't get EOF reported prematurely */ };
@@ -712,6 +728,8 @@ static void test_array_test(void)FIELD_ASSERT (size);for (i =0 ; i <VMSTATE_ARRAY_SIZE ; i++) {ELEM_ASSERT (b_1, i); +ELEM_ASSERT (u32_1, i); +ELEM_NOT_ASSERT (u32_2, i); } }#undef FIELD_ASSERT
Signature · 1 line
1.9.0
PATCH 35/97 vmstate: Test for VMSTATE_UINT64_ARRAY{_TEST}
In reply to Juan QuintelaCHange users of _V to _TEST.
--- include/migration/vmstate.h | 12 ++++++------ target-i386/machine.c | 5 +++-- tests/test-vmstate.c | 22 ++++++++++++++++++++++ 3 files changed, 31 insertions(+), 8 deletions(-)
include/migration/vmstate.h +6 -6
@@ -618,6 +618,12 @@ extern const VMStateInfo vmstate_info_bitmap;#define VMSTATE_UINT32_ARRAY (_f, _s, _n) \ VMSTATE_UINT32_ARRAY_TEST(_f, _s, _n, NULL) +#define VMSTATE_UINT64_ARRAY_TEST (_f, _s, _n, _t) \ + VMSTATE_ARRAY_TEST(_f, _s, _n, _t, vmstate_info_uint64, uint64_t) + +#define VMSTATE_UINT64_ARRAY (_f, _s, _n) \ + VMSTATE_UINT64_ARRAY_TEST(_f, _s, _n, NULL) +#define VMSTATE_UINT16_2DARRAY_V (_f, _s, _n1, _n2, _v) \ VMSTATE_2DARRAY(_f, _s, _n1, _n2, _v, vmstate_info_uint16, uint16_t)
@@ -639,12 +645,6 @@ extern const VMStateInfo vmstate_info_bitmap;#define VMSTATE_UINT32_2DARRAY (_f, _s, _n1, _n2) \ VMSTATE_UINT32_2DARRAY_V(_f, _s, _n1, _n2, 0) -#define VMSTATE_UINT64_ARRAY_V (_f, _s, _n, _v) \ - VMSTATE_ARRAY(_f, _s, _n, _v, vmstate_info_uint64, uint64_t) - -#define VMSTATE_UINT64_ARRAY (_f, _s, _n) \ - VMSTATE_UINT64_ARRAY_V(_f, _s, _n, 0) -#define VMSTATE_INT16_ARRAY_V (_f, _s, _n, _v) \ VMSTATE_ARRAY(_f, _s, _n, _v, vmstate_info_int16, int16_t)
target-i386/machine.c +3 -2
@@ -667,7 +667,7 @@ const VMStateDescription vmstate_x86_cpu = {VMSTATE_UINT32_TEST (env.intercept_exceptions,X86CPU , vmstate_5_plus),VMSTATE_UINT8_TEST (env.v_tpr,X86CPU , vmstate_5_plus),/* MTRRs */ -VMSTATE_UINT64_ARRAY_V (env.mtrr_fixed,X86CPU ,11 ,8 ), +VMSTATE_UINT64_ARRAY_TEST (env.mtrr_fixed,X86CPU ,11 , vmstate_8_plus),VMSTATE_UINT64_TEST (env.mtrr_deftype,X86CPU , vmstate_8_plus), VMSTATE_MTRR_VARS(env.mtrr_var, X86CPU, 8, 8),/* KVM-related states */
@@ -684,7 +684,8 @@ const VMStateDescription vmstate_x86_cpu = {VMSTATE_UINT64_TEST (env.mcg_cap,X86CPU , vmstate_10_plus),VMSTATE_UINT64_TEST (env.mcg_status,X86CPU , vmstate_10_plus),VMSTATE_UINT64_TEST (env.mcg_ctl,X86CPU , vmstate_10_plus), -VMSTATE_UINT64_ARRAY_V (env.mce_banks,X86CPU ,MCE_BANKS_DEF *4 ,10 ), +VMSTATE_UINT64_ARRAY_TEST (env.mce_banks,X86CPU ,MCE_BANKS_DEF *4 , + vmstate_10_plus),/* rdtscp */ VMSTATE_UINT64_TEST(env.tsc_aux, X86CPU, vmstate_11_plus),/* KVM pvclock msr */
tests/test-vmstate.c +22 -0
@@ -545,6 +545,8 @@ typedef struct TestArray {uint16_t u16_1[VMSTATE_ARRAY_SIZE ];uint32_t u32_1[VMSTATE_ARRAY_SIZE ];uint32_t u32_2[VMSTATE_ARRAY_SIZE ]; +uint64_t u64_1[VMSTATE_ARRAY_SIZE ]; +uint64_t u64_2[VMSTATE_ARRAY_SIZE ]; } TestArray;TestArray obj_array = {
@@ -556,6 +558,8 @@ TestArray obj_array = { .u16_1 = {11, 12, 13, 14, 15}, .u32_1 = {21, 22, 23, 24, 25}, .u32_2 = {25, 24, 23, 22, 21}, + .u64_1 = {31, 32, 33, 34, 35}, + .u64_2 = {35, 34, 33, 32, 31}, }; static const VMStateDescription vmstate_array_primitive = {
@@ -569,6 +573,7 @@ static const VMStateDescription vmstate_array_primitive = {VMSTATE_UINT8_ARRAY (u8_1, TestArray,VMSTATE_ARRAY_SIZE ),VMSTATE_UINT16_ARRAY (u16_1, TestArray,VMSTATE_ARRAY_SIZE ),VMSTATE_UINT32_ARRAY (u32_1, TestArray,VMSTATE_ARRAY_SIZE ), +VMSTATE_UINT64_ARRAY (u64_1, TestArray,VMSTATE_ARRAY_SIZE ), VMSTATE_END_OF_LIST() } };
@@ -581,6 +586,11 @@ uint8_t wire_array_primitive[] = {/* u32_1 */ 0x00 ,0x00 ,0x00 ,0x15 ,0x00 ,0x00 ,0x00 ,0x16 ,0x00 ,0x00 ,0x00 ,0x17 ,0x00 ,0x00 ,0x00 ,0x18 ,0x00 ,0x00 ,0x00 ,0x19 , +/* u64_1 */ 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x1f , +0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x20 , +0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x21 , +0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x22 , +0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x23 , QEMU_VM_EOF, /* just to ensure we won't get EOF reported prematurely */ };
@@ -639,6 +649,7 @@ static void test_array_primitive(void)ELEM_NOT_ASSERT (u8_2, i);ELEM_ASSERT (u16_1, i);ELEM_ASSERT (u32_1, i); +ELEM_ASSERT (u64_1, i); }/* We save the file again. We want the EOF this time */
@@ -669,6 +680,10 @@ static const VMStateDescription vmstate_array_test = { test_true),VMSTATE_UINT32_ARRAY_TEST (u32_2, TestArray,VMSTATE_ARRAY_SIZE , test_false), +VMSTATE_UINT64_ARRAY_TEST (u64_1, TestArray,VMSTATE_ARRAY_SIZE , + test_true), +VMSTATE_UINT64_ARRAY_TEST (u64_2, TestArray,VMSTATE_ARRAY_SIZE , + test_false), VMSTATE_END_OF_LIST() } };
@@ -679,6 +694,11 @@ uint8_t wire_array_test[] = {/* u32_1 */ 0x00 ,0x00 ,0x00 ,0x15 ,0x00 ,0x00 ,0x00 ,0x16 ,0x00 ,0x00 ,0x00 ,0x17 ,0x00 ,0x00 ,0x00 ,0x18 ,0x00 ,0x00 ,0x00 ,0x19 , +/* u64_1 */ 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x1f , +0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x20 , +0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x21 , +0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x22 , +0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x23 , QEMU_VM_EOF, /* just to ensure we won't get EOF reported prematurely */ };
@@ -730,6 +750,8 @@ static void test_array_test(void)ELEM_ASSERT (b_1, i);ELEM_ASSERT (u32_1, i);ELEM_NOT_ASSERT (u32_2, i); +ELEM_ASSERT (u64_1, i); +ELEM_NOT_ASSERT (u64_2, i); } }#undef FIELD_ASSERT
Signature · 1 line
1.9.0
PATCH 36/97 vmstate: Test for VMSTATE_INT16_ARRAY
In reply to Juan QuintelaRemove unused VMSTATE_INT16_ARRAY_V
--- include/migration/vmstate.h | 9 +++------ tests/test-vmstate.c | 5 +++++ 2 files changed, 8 insertions(+), 6 deletions(-)
include/migration/vmstate.h +3 -6
@@ -624,6 +624,9 @@ extern const VMStateInfo vmstate_info_bitmap;#define VMSTATE_UINT64_ARRAY (_f, _s, _n) \ VMSTATE_UINT64_ARRAY_TEST(_f, _s, _n, NULL) +#define VMSTATE_INT16_ARRAY (_f, _s, _n) \ + VMSTATE_ARRAY_TEST(_f, _s, _n, NULL, vmstate_info_int16, int16_t) +#define VMSTATE_UINT16_2DARRAY_V (_f, _s, _n1, _n2, _v) \ VMSTATE_2DARRAY(_f, _s, _n1, _n2, _v, vmstate_info_uint16, uint16_t)
@@ -645,12 +648,6 @@ extern const VMStateInfo vmstate_info_bitmap;#define VMSTATE_UINT32_2DARRAY (_f, _s, _n1, _n2) \ VMSTATE_UINT32_2DARRAY_V(_f, _s, _n1, _n2, 0) -#define VMSTATE_INT16_ARRAY_V (_f, _s, _n, _v) \ - VMSTATE_ARRAY(_f, _s, _n, _v, vmstate_info_int16, int16_t) - -#define VMSTATE_INT16_ARRAY (_f, _s, _n) \ - VMSTATE_INT16_ARRAY_V(_f, _s, _n, 0) -#define VMSTATE_INT32_ARRAY_V (_f, _s, _n, _v) \ VMSTATE_ARRAY(_f, _s, _n, _v, vmstate_info_int32, int32_t)
tests/test-vmstate.c +5 -0
@@ -547,6 +547,7 @@ typedef struct TestArray {uint32_t u32_2[VMSTATE_ARRAY_SIZE ];uint64_t u64_1[VMSTATE_ARRAY_SIZE ];uint64_t u64_2[VMSTATE_ARRAY_SIZE ]; +int16_t i16_1[VMSTATE_ARRAY_SIZE ]; } TestArray;TestArray obj_array = {
@@ -560,6 +561,7 @@ TestArray obj_array = { .u32_2 = {25, 24, 23, 22, 21}, .u64_1 = {31, 32, 33, 34, 35}, .u64_2 = {35, 34, 33, 32, 31}, + .i16_1 = {41, 42, 43, 44, 45}, }; static const VMStateDescription vmstate_array_primitive = {
@@ -574,6 +576,7 @@ static const VMStateDescription vmstate_array_primitive = {VMSTATE_UINT16_ARRAY (u16_1, TestArray,VMSTATE_ARRAY_SIZE ),VMSTATE_UINT32_ARRAY (u32_1, TestArray,VMSTATE_ARRAY_SIZE ),VMSTATE_UINT64_ARRAY (u64_1, TestArray,VMSTATE_ARRAY_SIZE ), +VMSTATE_INT16_ARRAY (i16_1, TestArray,VMSTATE_ARRAY_SIZE ), VMSTATE_END_OF_LIST() } };
@@ -591,6 +594,7 @@ uint8_t wire_array_primitive[] = {0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x21 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x22 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x23 , +/* i16_1 */ 0x00 ,0x29 ,0x00 ,0x2a ,0x00 ,0x2b ,0x00 ,0x2c ,0x00 ,0x2d , QEMU_VM_EOF, /* just to ensure we won't get EOF reported prematurely */ };
@@ -650,6 +654,7 @@ static void test_array_primitive(void)ELEM_ASSERT (u16_1, i);ELEM_ASSERT (u32_1, i);ELEM_ASSERT (u64_1, i); +ELEM_ASSERT (i16_1, i); }/* We save the file again. We want the EOF this time */
Signature · 1 line
1.9.0
PATCH 37/97 vmstate: Test for VMSTATE_INT32_ARRAY{_TEST}
In reply to Juan QuintelaChange only user of _V to _TEST.
--- hw/pci-host/piix.c | 4 ++-- include/migration/vmstate.h | 12 ++++++------ tests/test-vmstate.c | 18 ++++++++++++++++++ 3 files changed, 26 insertions(+), 8 deletions(-)
hw/pci-host/piix.c +2 -2
@@ -567,8 +567,8 @@ static const VMStateDescription vmstate_piix3 = { .pre_save = piix3_pre_save, .fields = (VMStateField []) {VMSTATE_PCI_DEVICE (dev, PIIX3State), -VMSTATE_INT32_ARRAY_V (pci_irq_levels_vmstate, PIIX3State, -PIIX_NUM_PIRQS ,3 ), +VMSTATE_INT32_ARRAY_TEST (pci_irq_levels_vmstate, PIIX3State, +PIIX_NUM_PIRQS , vmstate_3_plus),VMSTATE_END_OF_LIST () }, .subsections = (VMStateSubsection []) {
include/migration/vmstate.h +6 -6
@@ -627,6 +627,12 @@ extern const VMStateInfo vmstate_info_bitmap;#define VMSTATE_INT16_ARRAY (_f, _s, _n) \ VMSTATE_ARRAY_TEST(_f, _s, _n, NULL, vmstate_info_int16, int16_t) +#define VMSTATE_INT32_ARRAY_TEST (_f, _s, _n, _t) \ + VMSTATE_ARRAY_TEST(_f, _s, _n, _t, vmstate_info_int32, int32_t) + +#define VMSTATE_INT32_ARRAY (_f, _s, _n) \ + VMSTATE_INT32_ARRAY_TEST(_f, _s, _n, NULL) +#define VMSTATE_UINT16_2DARRAY_V (_f, _s, _n1, _n2, _v) \ VMSTATE_2DARRAY(_f, _s, _n1, _n2, _v, vmstate_info_uint16, uint16_t)
@@ -648,12 +654,6 @@ extern const VMStateInfo vmstate_info_bitmap;#define VMSTATE_UINT32_2DARRAY (_f, _s, _n1, _n2) \ VMSTATE_UINT32_2DARRAY_V(_f, _s, _n1, _n2, 0) -#define VMSTATE_INT32_ARRAY_V (_f, _s, _n, _v) \ - VMSTATE_ARRAY(_f, _s, _n, _v, vmstate_info_int32, int32_t) - -#define VMSTATE_INT32_ARRAY (_f, _s, _n) \ - VMSTATE_INT32_ARRAY_V(_f, _s, _n, 0) -#define VMSTATE_UINT32_SUB_ARRAY (_f, _s, _start, _num) \ VMSTATE_SUB_ARRAY(_f, _s, _start, _num, 0, vmstate_info_uint32, uint32_t)
tests/test-vmstate.c +18 -0
@@ -548,6 +548,8 @@ typedef struct TestArray {uint64_t u64_1[VMSTATE_ARRAY_SIZE ];uint64_t u64_2[VMSTATE_ARRAY_SIZE ];int16_t i16_1[VMSTATE_ARRAY_SIZE ]; +int32_t i32_1[VMSTATE_ARRAY_SIZE ]; +int32_t i32_2[VMSTATE_ARRAY_SIZE ]; } TestArray;TestArray obj_array = {
@@ -562,6 +564,8 @@ TestArray obj_array = { .u64_1 = {31, 32, 33, 34, 35}, .u64_2 = {35, 34, 33, 32, 31}, .i16_1 = {41, 42, 43, 44, 45}, + .i32_1 = {51, 52, 53, 54, 55}, + .i32_2 = {55, 54, 53, 52, 51}, }; static const VMStateDescription vmstate_array_primitive = {
@@ -577,6 +581,7 @@ static const VMStateDescription vmstate_array_primitive = {VMSTATE_UINT32_ARRAY (u32_1, TestArray,VMSTATE_ARRAY_SIZE ),VMSTATE_UINT64_ARRAY (u64_1, TestArray,VMSTATE_ARRAY_SIZE ),VMSTATE_INT16_ARRAY (i16_1, TestArray,VMSTATE_ARRAY_SIZE ), +VMSTATE_INT32_ARRAY (i32_1, TestArray,VMSTATE_ARRAY_SIZE ), VMSTATE_END_OF_LIST() } };
@@ -595,6 +600,9 @@ uint8_t wire_array_primitive[] = {0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x22 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x23 ,/* i16_1 */ 0x00 ,0x29 ,0x00 ,0x2a ,0x00 ,0x2b ,0x00 ,0x2c ,0x00 ,0x2d , +/* i32_1 */ 0x00 ,0x00 ,0x00 ,0x33 ,0x00 ,0x00 ,0x00 ,0x34 , +0x00 ,0x00 ,0x00 ,0x35 ,0x00 ,0x00 ,0x00 ,0x36 , +0x00 ,0x00 ,0x00 ,0x37 , QEMU_VM_EOF, /* just to ensure we won't get EOF reported prematurely */ };
@@ -655,6 +663,7 @@ static void test_array_primitive(void)ELEM_ASSERT (u32_1, i);ELEM_ASSERT (u64_1, i);ELEM_ASSERT (i16_1, i); +ELEM_ASSERT (i32_1, i); }/* We save the file again. We want the EOF this time */
@@ -689,6 +698,10 @@ static const VMStateDescription vmstate_array_test = { test_true),VMSTATE_UINT64_ARRAY_TEST (u64_2, TestArray,VMSTATE_ARRAY_SIZE , test_false), +VMSTATE_INT32_ARRAY_TEST (i32_1, TestArray,VMSTATE_ARRAY_SIZE , + test_true), +VMSTATE_INT32_ARRAY_TEST (i32_2, TestArray,VMSTATE_ARRAY_SIZE , + test_false), VMSTATE_END_OF_LIST() } };
@@ -704,6 +717,9 @@ uint8_t wire_array_test[] = {0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x21 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x22 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x23 , +/* i32_1 */ 0x00 ,0x00 ,0x00 ,0x33 ,0x00 ,0x00 ,0x00 ,0x34 , +0x00 ,0x00 ,0x00 ,0x35 ,0x00 ,0x00 ,0x00 ,0x36 , +0x00 ,0x00 ,0x00 ,0x37 , QEMU_VM_EOF, /* just to ensure we won't get EOF reported prematurely */ };
@@ -757,6 +773,8 @@ static void test_array_test(void)ELEM_NOT_ASSERT (u32_2, i);ELEM_ASSERT (u64_1, i);ELEM_NOT_ASSERT (u64_2, i); +ELEM_ASSERT (i32_1, i); +ELEM_NOT_ASSERT (i32_2, i); } }#undef FIELD_ASSERT
Signature · 1 line
1.9.0
PATCH 38/97 vmstate: Test for VMSTATE_INT64_ARRAY
In reply to Juan QuintelaRemove unused VMSTATE_INT64_ARRAY_V.
--- include/migration/vmstate.h | 9 +++------ tests/test-vmstate.c | 9 +++++++++ 2 files changed, 12 insertions(+), 6 deletions(-)
include/migration/vmstate.h +3 -6
@@ -633,6 +633,9 @@ extern const VMStateInfo vmstate_info_bitmap;#define VMSTATE_INT32_ARRAY (_f, _s, _n) \ VMSTATE_INT32_ARRAY_TEST(_f, _s, _n, NULL) +#define VMSTATE_INT64_ARRAY (_f, _s, _n) \ + VMSTATE_ARRAY_TEST(_f, _s, _n, NULL, vmstate_info_int64, int64_t) +#define VMSTATE_UINT16_2DARRAY_V (_f, _s, _n1, _n2, _v) \ VMSTATE_2DARRAY(_f, _s, _n1, _n2, _v, vmstate_info_uint16, uint16_t)
@@ -657,12 +660,6 @@ extern const VMStateInfo vmstate_info_bitmap;#define VMSTATE_UINT32_SUB_ARRAY (_f, _s, _start, _num) \ VMSTATE_SUB_ARRAY(_f, _s, _start, _num, 0, vmstate_info_uint32, uint32_t) -#define VMSTATE_INT64_ARRAY_V (_f, _s, _n, _v) \ - VMSTATE_ARRAY(_f, _s, _n, _v, vmstate_info_int64, int64_t) - -#define VMSTATE_INT64_ARRAY (_f, _s, _n) \ - VMSTATE_INT64_ARRAY_V(_f, _s, _n, 0) -#define VMSTATE_FLOAT64_ARRAY_V (_f, _s, _n, _v) \ VMSTATE_ARRAY(_f, _s, _n, _v, vmstate_info_float64, float64)
tests/test-vmstate.c +9 -0
@@ -550,6 +550,7 @@ typedef struct TestArray {int16_t i16_1[VMSTATE_ARRAY_SIZE ];int32_t i32_1[VMSTATE_ARRAY_SIZE ];int32_t i32_2[VMSTATE_ARRAY_SIZE ]; +int64_t i64_1[VMSTATE_ARRAY_SIZE ]; } TestArray;TestArray obj_array = {
@@ -566,6 +567,7 @@ TestArray obj_array = { .i16_1 = {41, 42, 43, 44, 45}, .i32_1 = {51, 52, 53, 54, 55}, .i32_2 = {55, 54, 53, 52, 51}, + .i64_1 = {61, 62, 63, 64, 65}, }; static const VMStateDescription vmstate_array_primitive = {
@@ -582,6 +584,7 @@ static const VMStateDescription vmstate_array_primitive = {VMSTATE_UINT64_ARRAY (u64_1, TestArray,VMSTATE_ARRAY_SIZE ),VMSTATE_INT16_ARRAY (i16_1, TestArray,VMSTATE_ARRAY_SIZE ),VMSTATE_INT32_ARRAY (i32_1, TestArray,VMSTATE_ARRAY_SIZE ), +VMSTATE_INT64_ARRAY (i64_1, TestArray,VMSTATE_ARRAY_SIZE ), VMSTATE_END_OF_LIST() } };
@@ -603,6 +606,11 @@ uint8_t wire_array_primitive[] = {/* i32_1 */ 0x00 ,0x00 ,0x00 ,0x33 ,0x00 ,0x00 ,0x00 ,0x34 ,0x00 ,0x00 ,0x00 ,0x35 ,0x00 ,0x00 ,0x00 ,0x36 ,0x00 ,0x00 ,0x00 ,0x37 , +/* u64_1 */ 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x3d , +0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x3e , +0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x3f , +0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x40 , +0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x41 , QEMU_VM_EOF, /* just to ensure we won't get EOF reported prematurely */ };
@@ -664,6 +672,7 @@ static void test_array_primitive(void)ELEM_ASSERT (u64_1, i);ELEM_ASSERT (i16_1, i);ELEM_ASSERT (i32_1, i); +ELEM_ASSERT (i64_1, i); }/* We save the file again. We want the EOF this time */
Signature · 1 line
1.9.0
PATCH 39/97 vmstate: Test for VMSTATE_FLOAT64_ARRAY
In reply to Juan QuintelaRemove unused VMSTATE_FLOAT64_ARRAY_V.
--- include/migration/vmstate.h | 9 +++------ tests/test-vmstate.c | 10 ++++++++++ 2 files changed, 13 insertions(+), 6 deletions(-)
include/migration/vmstate.h +3 -6
@@ -636,6 +636,9 @@ extern const VMStateInfo vmstate_info_bitmap;#define VMSTATE_INT64_ARRAY (_f, _s, _n) \ VMSTATE_ARRAY_TEST(_f, _s, _n, NULL, vmstate_info_int64, int64_t) +#define VMSTATE_FLOAT64_ARRAY (_f, _s, _n) \ + VMSTATE_ARRAY_TEST(_f, _s, _n, NULL, vmstate_info_float64, float64) +#define VMSTATE_UINT16_2DARRAY_V (_f, _s, _n1, _n2, _v) \ VMSTATE_2DARRAY(_f, _s, _n1, _n2, _v, vmstate_info_uint16, uint16_t)
@@ -660,12 +663,6 @@ extern const VMStateInfo vmstate_info_bitmap;#define VMSTATE_UINT32_SUB_ARRAY (_f, _s, _start, _num) \ VMSTATE_SUB_ARRAY(_f, _s, _start, _num, 0, vmstate_info_uint32, uint32_t) -#define VMSTATE_FLOAT64_ARRAY_V (_f, _s, _n, _v) \ - VMSTATE_ARRAY(_f, _s, _n, _v, vmstate_info_float64, float64) - -#define VMSTATE_FLOAT64_ARRAY (_f, _s, _n) \ - VMSTATE_FLOAT64_ARRAY_V(_f, _s, _n, 0) -#define VMSTATE_BUFFER_V (_f, _s, _v) \ VMSTATE_STATIC_BUFFER(_f, _s, _v, NULL, 0, sizeof(typeof_field(_s, _f)))
tests/test-vmstate.c +10 -0
@@ -551,6 +551,7 @@ typedef struct TestArray {int32_t i32_1[VMSTATE_ARRAY_SIZE ];int32_t i32_2[VMSTATE_ARRAY_SIZE ];int64_t i64_1[VMSTATE_ARRAY_SIZE ]; +float64 f64_1[VMSTATE_ARRAY_SIZE ]; } TestArray;TestArray obj_array = {
@@ -568,6 +569,8 @@ TestArray obj_array = { .i32_1 = {51, 52, 53, 54, 55}, .i32_2 = {55, 54, 53, 52, 51}, .i64_1 = {61, 62, 63, 64, 65}, + .f64_1 = {float64_zero, float64_one, float64_ln2, float64_pi, + float64_infinity}, }; static const VMStateDescription vmstate_array_primitive = {
@@ -585,6 +588,7 @@ static const VMStateDescription vmstate_array_primitive = {VMSTATE_INT16_ARRAY (i16_1, TestArray,VMSTATE_ARRAY_SIZE ),VMSTATE_INT32_ARRAY (i32_1, TestArray,VMSTATE_ARRAY_SIZE ),VMSTATE_INT64_ARRAY (i64_1, TestArray,VMSTATE_ARRAY_SIZE ), +VMSTATE_FLOAT64_ARRAY (f64_1, TestArray,VMSTATE_ARRAY_SIZE ), VMSTATE_END_OF_LIST() } };
@@ -611,6 +615,11 @@ uint8_t wire_array_primitive[] = {0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x3f ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x40 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x41 , +/* f64_1 */ 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 , +0x3f ,0xf0 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 , +0x3f ,0xe6 ,0x2e ,0x42 ,0xfe ,0xfa ,0x39 ,0xef , +0x40 ,0x09 ,0x21 ,0xfb ,0x54 ,0x44 ,0x2d ,0x18 , +0x7f ,0xf0 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 , QEMU_VM_EOF, /* just to ensure we won't get EOF reported prematurely */ };
@@ -673,6 +682,7 @@ static void test_array_primitive(void)ELEM_ASSERT (i16_1, i);ELEM_ASSERT (i32_1, i);ELEM_ASSERT (i64_1, i); +ELEM_ASSERT (f64_1, i); }/* We save the file again. We want the EOF this time */
Signature · 1 line
1.9.0
PATCH 40/97 vmstate: Test for VMSTATE_UINT8_2DARRAY
In reply to Juan QuintelaRemove unused _V version.
--- include/migration/vmstate.h | 9 +++------ tests/test-vmstate.c | 19 ++++++++++++++++++- 2 files changed, 21 insertions(+), 7 deletions(-)
include/migration/vmstate.h +3 -6
@@ -639,21 +639,18 @@ extern const VMStateInfo vmstate_info_bitmap;#define VMSTATE_FLOAT64_ARRAY (_f, _s, _n) \ VMSTATE_ARRAY_TEST(_f, _s, _n, NULL, vmstate_info_float64, float64) +#define VMSTATE_UINT8_2DARRAY (_f, _s, _n1, _n2) \ + VMSTATE_2DARRAY(_f, _s, _n1, _n2, 0, vmstate_info_uint8, uint8_t) +#define VMSTATE_UINT16_2DARRAY_V (_f, _s, _n1, _n2, _v) \ VMSTATE_2DARRAY(_f, _s, _n1, _n2, _v, vmstate_info_uint16, uint16_t)#define VMSTATE_UINT16_2DARRAY (_f, _s, _n1, _n2) \ VMSTATE_UINT16_2DARRAY_V(_f, _s, _n1, _n2, 0) -#define VMSTATE_UINT8_2DARRAY_V (_f, _s, _n1, _n2, _v) \ - VMSTATE_2DARRAY(_f, _s, _n1, _n2, _v, vmstate_info_uint8, uint8_t) -#define VMSTATE_UINT8_SUB_ARRAY (_f, _s, _start, _num) \ VMSTATE_SUB_ARRAY(_f, _s, _start, _num, 0, vmstate_info_uint8, uint8_t) -#define VMSTATE_UINT8_2DARRAY (_f, _s, _n1, _n2) \ - VMSTATE_UINT8_2DARRAY_V(_f, _s, _n1, _n2, 0) -#define VMSTATE_UINT32_2DARRAY_V (_f, _s, _n1, _n2, _v) \ VMSTATE_2DARRAY(_f, _s, _n1, _n2, _v, vmstate_info_uint32, uint32_t)
tests/test-vmstate.c +18 -1
@@ -535,6 +535,7 @@ static void test_simple_bitmap(void)#undef FIELD_ASSERT#define VMSTATE_ARRAY_SIZE 5 +#define VMSTATE_2D_SIZE 3 typedef struct TestArray { int32_t size;
@@ -552,6 +553,7 @@ typedef struct TestArray {int32_t i32_2[VMSTATE_ARRAY_SIZE ];int64_t i64_1[VMSTATE_ARRAY_SIZE ];float64 f64_1[VMSTATE_ARRAY_SIZE ]; +uint8_t u8_1d[VMSTATE_2D_SIZE ][VMSTATE_2D_SIZE ]; } TestArray;TestArray obj_array = {
@@ -571,6 +573,9 @@ TestArray obj_array = { .i64_1 = {61, 62, 63, 64, 65}, .f64_1 = {float64_zero, float64_one, float64_ln2, float64_pi, float64_infinity}, + .u8_1d = { {71, 72, 73}, + {74, 75, 76}, + {77, 78, 79} }, }; static const VMStateDescription vmstate_array_primitive = {
@@ -589,6 +594,8 @@ static const VMStateDescription vmstate_array_primitive = {VMSTATE_INT32_ARRAY (i32_1, TestArray,VMSTATE_ARRAY_SIZE ),VMSTATE_INT64_ARRAY (i64_1, TestArray,VMSTATE_ARRAY_SIZE ),VMSTATE_FLOAT64_ARRAY (f64_1, TestArray,VMSTATE_ARRAY_SIZE ), +VMSTATE_UINT8_2DARRAY (u8_1d, TestArray,VMSTATE_2D_SIZE , +VMSTATE_2D_SIZE ), VMSTATE_END_OF_LIST() } };
@@ -620,13 +627,16 @@ uint8_t wire_array_primitive[] = {0x3f ,0xe6 ,0x2e ,0x42 ,0xfe ,0xfa ,0x39 ,0xef ,0x40 ,0x09 ,0x21 ,0xfb ,0x54 ,0x44 ,0x2d ,0x18 ,0x7f ,0xf0 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 , +/* u8_1d */ 0x47 ,0x48 ,0x49 , +0x4a ,0x4b ,0x4c , +0x4d ,0x4e ,0x4f , QEMU_VM_EOF, /* just to ensure we won't get EOF reported prematurely */ };static void test_array_primitive (void ) {QEMUFile *fsave =open_test_file (true); -int i; +int i, j;/* Save file with vmstate */ vmstate_save_state (fsave, &vmstate_array_primitive, &obj_array);
@@ -668,6 +678,8 @@ static void test_array_primitive(void)#define FIELD_ASSERT (name) g_assert_cmpint(obj.name, ==, obj_array.name)#define ELEM_ASSERT (name, i) \ g_assert_cmpint(obj.name[i], ==, obj_array.name[i]) +#define ELEM_ASSERT_2D (name, i, j) \ + g_assert_cmpint(obj.name[i][j], ==, obj_array.name[i][j])#define ELEM_NOT_ASSERT (name, i) \ g_assert_cmpint(obj.name[i], !=, obj_array.name[i])
@@ -684,6 +696,11 @@ static void test_array_primitive(void)ELEM_ASSERT (i64_1, i);ELEM_ASSERT (f64_1, i); } +for (i =0 ; i <VMSTATE_2D_SIZE ; i++) { +for (j =0 ; j <VMSTATE_2D_SIZE ; j++) { +ELEM_ASSERT_2D (u8_1d, i, j); + } + }/* We save the file again. We want the EOF this time */
Signature · 1 line
1.9.0
PATCH 41/97 vmstate: Test for VMSTATE_UINT16_2DARRAY.
In reply to Juan QuintelaRemove unused _V version.
--- include/migration/vmstate.h | 5 +---- tests/test-vmstate.c | 10 ++++++++++ 2 files changed, 11 insertions(+), 4 deletions(-)
include/migration/vmstate.h +1 -4
@@ -642,11 +642,8 @@ extern const VMStateInfo vmstate_info_bitmap;#define VMSTATE_UINT8_2DARRAY (_f, _s, _n1, _n2) \ VMSTATE_2DARRAY(_f, _s, _n1, _n2, 0, vmstate_info_uint8, uint8_t) -#define VMSTATE_UINT16_2DARRAY_V (_f, _s, _n1, _n2, _v) \ - VMSTATE_2DARRAY(_f, _s, _n1, _n2, _v, vmstate_info_uint16, uint16_t) -#define VMSTATE_UINT16_2DARRAY (_f, _s, _n1, _n2) \ - VMSTATE_UINT16_2DARRAY_V(_f, _s, _n1, _n2, 0) + VMSTATE_2DARRAY(_f, _s, _n1, _n2, 0, vmstate_info_uint16, uint16_t)#define VMSTATE_UINT8_SUB_ARRAY (_f, _s, _start, _num) \ VMSTATE_SUB_ARRAY(_f, _s, _start, _num, 0, vmstate_info_uint8, uint8_t)
tests/test-vmstate.c +10 -0
@@ -554,6 +554,7 @@ typedef struct TestArray {int64_t i64_1[VMSTATE_ARRAY_SIZE ];float64 f64_1[VMSTATE_ARRAY_SIZE ];uint8_t u8_1d[VMSTATE_2D_SIZE ][VMSTATE_2D_SIZE ]; +uint16_t u16_1d[VMSTATE_2D_SIZE ][VMSTATE_2D_SIZE ]; } TestArray;TestArray obj_array = {
@@ -576,6 +577,9 @@ TestArray obj_array = { .u8_1d = { {71, 72, 73}, {74, 75, 76}, {77, 78, 79} }, + .u16_1d = { {81, 82, 83}, + {84, 85, 86}, + {87, 88, 89} }, }; static const VMStateDescription vmstate_array_primitive = {
@@ -596,6 +600,8 @@ static const VMStateDescription vmstate_array_primitive = {VMSTATE_FLOAT64_ARRAY (f64_1, TestArray,VMSTATE_ARRAY_SIZE ),VMSTATE_UINT8_2DARRAY (u8_1d, TestArray,VMSTATE_2D_SIZE ,VMSTATE_2D_SIZE ), +VMSTATE_UINT16_2DARRAY (u16_1d, TestArray,VMSTATE_2D_SIZE , +VMSTATE_2D_SIZE ), VMSTATE_END_OF_LIST() } };
@@ -630,6 +636,9 @@ uint8_t wire_array_primitive[] = {/* u8_1d */ 0x47 ,0x48 ,0x49 ,0x4a ,0x4b ,0x4c ,0x4d ,0x4e ,0x4f , +/* u16_1d */ 0x00 ,0x51 ,0x00 ,0x52 ,0x00 ,0x53 , +0x00 ,0x54 ,0x00 ,0x55 ,0x00 ,0x56 , +0x00 ,0x57 ,0x00 ,0x58 ,0x00 ,0x59 , QEMU_VM_EOF, /* just to ensure we won't get EOF reported prematurely */ };
@@ -699,6 +708,7 @@ static void test_array_primitive(void)for (i =0 ; i <VMSTATE_2D_SIZE ; i++) {for (j =0 ; j <VMSTATE_2D_SIZE ; j++) {ELEM_ASSERT_2D (u8_1d, i, j); +ELEM_ASSERT_2D (u16_1d, i, j); } }
Signature · 1 line
1.9.0
PATCH 42/97 vmstate: Test for VMSTATE_UINT32_2DARRAY
In reply to Juan QuintelaRemove unused _V version.
--- include/migration/vmstate.h | 9 +++------ tests/test-vmstate.c | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 6 deletions(-)
include/migration/vmstate.h +3 -6
@@ -645,15 +645,12 @@ extern const VMStateInfo vmstate_info_bitmap;#define VMSTATE_UINT16_2DARRAY (_f, _s, _n1, _n2) \ VMSTATE_2DARRAY(_f, _s, _n1, _n2, 0, vmstate_info_uint16, uint16_t) +#define VMSTATE_UINT32_2DARRAY (_f, _s, _n1, _n2) \ + VMSTATE_2DARRAY(_f, _s, _n1, _n2, 0, vmstate_info_uint32, uint32_t) +#define VMSTATE_UINT8_SUB_ARRAY (_f, _s, _start, _num) \ VMSTATE_SUB_ARRAY(_f, _s, _start, _num, 0, vmstate_info_uint8, uint8_t) -#define VMSTATE_UINT32_2DARRAY_V (_f, _s, _n1, _n2, _v) \ - VMSTATE_2DARRAY(_f, _s, _n1, _n2, _v, vmstate_info_uint32, uint32_t) - -#define VMSTATE_UINT32_2DARRAY (_f, _s, _n1, _n2) \ - VMSTATE_UINT32_2DARRAY_V(_f, _s, _n1, _n2, 0) -#define VMSTATE_UINT32_SUB_ARRAY (_f, _s, _start, _num) \ VMSTATE_SUB_ARRAY(_f, _s, _start, _num, 0, vmstate_info_uint32, uint32_t)
tests/test-vmstate.c +16 -0
@@ -555,6 +555,7 @@ typedef struct TestArray {float64 f64_1[VMSTATE_ARRAY_SIZE ];uint8_t u8_1d[VMSTATE_2D_SIZE ][VMSTATE_2D_SIZE ];uint16_t u16_1d[VMSTATE_2D_SIZE ][VMSTATE_2D_SIZE ]; +uint32_t u32_1d[VMSTATE_2D_SIZE ][VMSTATE_2D_SIZE ]; } TestArray;TestArray obj_array = {
@@ -580,6 +581,9 @@ TestArray obj_array = { .u16_1d = { {81, 82, 83}, {84, 85, 86}, {87, 88, 89} }, + .u32_1d = { {91, 92, 93}, + {94, 95, 96}, + {97, 98, 99} }, }; static const VMStateDescription vmstate_array_primitive = {
@@ -602,6 +606,8 @@ static const VMStateDescription vmstate_array_primitive = { VMSTATE_2D_SIZE),VMSTATE_UINT16_2DARRAY (u16_1d, TestArray,VMSTATE_2D_SIZE ,VMSTATE_2D_SIZE ), +VMSTATE_UINT32_2DARRAY (u32_1d, TestArray,VMSTATE_2D_SIZE , +VMSTATE_2D_SIZE ), VMSTATE_END_OF_LIST() } };
@@ -639,6 +645,15 @@ uint8_t wire_array_primitive[] = {/* u16_1d */ 0x00 ,0x51 ,0x00 ,0x52 ,0x00 ,0x53 ,0x00 ,0x54 ,0x00 ,0x55 ,0x00 ,0x56 ,0x00 ,0x57 ,0x00 ,0x58 ,0x00 ,0x59 , +/* u16_1d */ 0x00 ,0x00 ,0x00 ,0x5b , +0x00 ,0x00 ,0x00 ,0x5c , +0x00 ,0x00 ,0x00 ,0x5d , +0x00 ,0x00 ,0x00 ,0x5e , +0x00 ,0x00 ,0x00 ,0x5f , +0x00 ,0x00 ,0x00 ,0x60 , +0x00 ,0x00 ,0x00 ,0x61 , +0x00 ,0x00 ,0x00 ,0x62 , +0x00 ,0x00 ,0x00 ,0x63 , QEMU_VM_EOF, /* just to ensure we won't get EOF reported prematurely */ };
@@ -709,6 +724,7 @@ static void test_array_primitive(void)for (j =0 ; j <VMSTATE_2D_SIZE ; j++) {ELEM_ASSERT_2D (u8_1d, i, j);ELEM_ASSERT_2D (u16_1d, i, j); +ELEM_ASSERT_2D (u32_1d, i, j); } }
Signature · 1 line
1.9.0
PATCH 43/97 vmstate: Remove unused VMSTATE_BUFFER_V
In reply to Juan Quintela--- include/migration/vmstate.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
include/migration/vmstate.h +1 -4
@@ -654,11 +654,8 @@ extern const VMStateInfo vmstate_info_bitmap;#define VMSTATE_UINT32_SUB_ARRAY (_f, _s, _start, _num) \ VMSTATE_SUB_ARRAY(_f, _s, _start, _num, 0, vmstate_info_uint32, uint32_t) -#define VMSTATE_BUFFER_V (_f, _s, _v) \ - VMSTATE_STATIC_BUFFER(_f, _s, _v, NULL, 0, sizeof(typeof_field(_s, _f))) -#define VMSTATE_BUFFER (_f, _s) \ - VMSTATE_BUFFER_V(_f, _s, 0) + VMSTATE_STATIC_BUFFER(_f, _s, 0, NULL, 0, sizeof(typeof_field(_s, _f)))#define VMSTATE_PARTIAL_BUFFER (_f, _s, _size) \ VMSTATE_STATIC_BUFFER(_f, _s, 0, NULL, 0, _size)
Signature · 1 line
1.9.0
PATCH 44/97 vmstate: Remove version from VMSTATE_BUFFER_UNSAFE
In reply to Juan QuintelaAll users used 0 anyways. Rename VMSTATE_BUFFER_UNSAFE_INFO to VMSTATE_BUFFER_UNSAFE_TEST to be consistent with rest of fields.
--- hw/display/g364fb.c | 4 ++-- hw/net/smc91c111.c | 2 +- hw/pci/pci.c | 10 ++++++---- hw/scsi/esp-pci.c | 2 +- hw/scsi/lsi53c895a.c | 4 ++-- include/hw/pci/shpc.h | 2 +- include/migration/vmstate.h | 18 +++++++++--------- 7 files changed, 22 insertions(+), 20 deletions(-)
hw/display/g364fb.c +2 -2
@@ -462,8 +462,8 @@ static const VMStateDescription vmstate_g364fb = { .post_load = g364fb_post_load, .fields = (VMStateField []) {VMSTATE_VBUFFER_UINT32 (vram, G364State,1 ,NULL ,0 , vram_size), -VMSTATE_BUFFER_UNSAFE (color_palette, G364State,0 ,256 *3 ), -VMSTATE_BUFFER_UNSAFE (cursor_palette, G364State,0 ,9 ), +VMSTATE_BUFFER_UNSAFE (color_palette, G364State,256 *3 ), +VMSTATE_BUFFER_UNSAFE (cursor_palette, G364State,9 ),VMSTATE_UINT16_ARRAY (cursor, G364State,512 ),VMSTATE_UINT32 (cursor_position, G364State),VMSTATE_UINT32 (ctla, G364State),
hw/net/smc91c111.c +1 -1
@@ -72,7 +72,7 @@ static const VMStateDescription vmstate_smc91c111 = {VMSTATE_INT32_ARRAY (rx_fifo, smc91c111_state,NUM_PACKETS ),VMSTATE_INT32 (tx_fifo_done_len, smc91c111_state),VMSTATE_INT32_ARRAY (tx_fifo_done, smc91c111_state,NUM_PACKETS ), -VMSTATE_BUFFER_UNSAFE (data, smc91c111_state,0 ,NUM_PACKETS *2048 ), +VMSTATE_BUFFER_UNSAFE (data, smc91c111_state,NUM_PACKETS *2048 ),VMSTATE_UINT8 (int_level, smc91c111_state),VMSTATE_UINT8 (int_mask, smc91c111_state),VMSTATE_END_OF_LIST ()
hw/pci/pci.c +6 -4
@@ -474,10 +474,11 @@ const VMStateDescription vmstate_pci_device = { .minimum_version_id = 1, .fields = (VMStateField []) {VMSTATE_INT32_POSITIVE_LE (version_id, PCIDevice), -VMSTATE_BUFFER_UNSAFE_INFO (config, PCIDevice,0 , +VMSTATE_BUFFER_UNSAFE_TEST (config, PCIDevice,NULL , vmstate_info_pci_config,PCI_CONFIG_SPACE_SIZE ), -VMSTATE_BUFFER_UNSAFE_INFO (irq_state, PCIDevice,2 , +VMSTATE_BUFFER_UNSAFE_TEST (irq_state, PCIDevice, + vmstate_2_plus, vmstate_info_pci_irq_state,PCI_NUM_PINS *sizeof (int32_t )),VMSTATE_END_OF_LIST ()
@@ -490,10 +491,11 @@ const VMStateDescription vmstate_pcie_device = { .minimum_version_id = 1, .fields = (VMStateField []) {VMSTATE_INT32_POSITIVE_LE (version_id, PCIDevice), -VMSTATE_BUFFER_UNSAFE_INFO (config, PCIDevice,0 , +VMSTATE_BUFFER_UNSAFE_TEST (config, PCIDevice,NULL , vmstate_info_pci_config,PCIE_CONFIG_SPACE_SIZE ), -VMSTATE_BUFFER_UNSAFE_INFO (irq_state, PCIDevice,2 , +VMSTATE_BUFFER_UNSAFE_TEST (irq_state, PCIDevice, + vmstate_2_plus, vmstate_info_pci_irq_state,PCI_NUM_PINS *sizeof (int32_t )),VMSTATE_END_OF_LIST ()
hw/scsi/esp-pci.c +1 -1
@@ -312,7 +312,7 @@ static const VMStateDescription vmstate_esp_pci_scsi = { .minimum_version_id = 0, .fields = (VMStateField []) {VMSTATE_PCI_DEVICE (parent_obj, PCIESPState), -VMSTATE_BUFFER_UNSAFE (dma_regs, PCIESPState,0 ,8 *sizeof (uint32_t )), +VMSTATE_BUFFER_UNSAFE (dma_regs, PCIESPState,8 *sizeof (uint32_t )),VMSTATE_STRUCT (esp, PCIESPState,0 , vmstate_esp, ESPState),VMSTATE_END_OF_LIST () }
hw/scsi/lsi53c895a.c +2 -2
@@ -2064,10 +2064,10 @@ static const VMStateDescription vmstate_lsi_scsi = {VMSTATE_UINT32 (ia, LSIState),VMSTATE_UINT32 (sbc, LSIState),VMSTATE_UINT32 (csbc, LSIState), -VMSTATE_BUFFER_UNSAFE (scratch, LSIState,0 ,18 *sizeof (uint32_t )), +VMSTATE_BUFFER_UNSAFE (scratch, LSIState,18 *sizeof (uint32_t )),VMSTATE_UINT8 (sbr, LSIState), -VMSTATE_BUFFER_UNSAFE (script_ram, LSIState,0 ,2048 *sizeof (uint32_t )), +VMSTATE_BUFFER_UNSAFE (script_ram, LSIState,2048 *sizeof (uint32_t )), VMSTATE_END_OF_LIST() } };
include/hw/pci/shpc.h +1 -1
@@ -51,6 +51,6 @@ void shpc_device_hot_unplug_cb(HotplugHandler *hotplug_dev, DeviceState *dev,extern VMStateInfo shpc_vmstate_info;#define SHPC_VMSTATE (_field, _type) \ - VMSTATE_BUFFER_UNSAFE_INFO(_field, _type, 0, shpc_vmstate_info, 0) + VMSTATE_BUFFER_UNSAFE_TEST(_field, _type, 0, shpc_vmstate_info, 0)#endif
include/migration/vmstate.h +9 -9
@@ -464,13 +464,13 @@ extern const VMStateInfo vmstate_info_bitmap; .start = (_start), \ } -#define VMSTATE_BUFFER_UNSAFE_INFO (_field, _state, _version, _info, _size) { \ - .name = (stringify(_field)), \ - .version_id = (_version), \ - .size = (_size), \ - .info = &(_info), \ - .flags = VMS_BUFFER, \ - .offset = offsetof(_state, _field), \ +#define VMSTATE_BUFFER_UNSAFE_TEST (_field, _state, _test, _info, _size) { \ + .name = (stringify(_field)), \ + .field_exists = (_test), \ + .size = (_size), \ + .info = &(_info), \ + .flags = VMS_BUFFER, \ + .offset = offsetof(_state, _field), \ }#define VMSTATE_BUFFER_POINTER_UNSAFE (_field, _state, _version, _size) { \
@@ -675,8 +675,8 @@ extern const VMStateInfo vmstate_info_bitmap;#define VMSTATE_BUFFER_TEST (_f, _s, _test) \ VMSTATE_STATIC_BUFFER(_f, _s, 0, _test, 0, sizeof(typeof_field(_s, _f))) -#define VMSTATE_BUFFER_UNSAFE (_field, _state, _version, _size) \ - VMSTATE_BUFFER_UNSAFE_INFO(_field, _state, _version, vmstate_info_buffer, _size) +#define VMSTATE_BUFFER_UNSAFE (_field, _state, _size) \ + VMSTATE_BUFFER_UNSAFE_TEST(_field, _state, NULL, vmstate_info_buffer, _size)#define VMSTATE_UNUSED (_size) \ VMSTATE_UNUSED_TEST(NULL, _size)
Signature · 1 line
1.9.0
PATCH 45/97 vmstate: Remove unused version fields from ARM
In reply to Juan Quintela--- target-ppc/machine.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-)
target-ppc/machine.c +4 -10
@@ -120,11 +120,8 @@ static const VMStateInfo vmstate_info_avr = { .put = put_avr, }; -#define VMSTATE_AVR_ARRAY_V (_f, _s, _n, _v) \ - VMSTATE_ARRAY(_f, _s, _n, _v, vmstate_info_avr, ppc_avr_t) - -#define VMSTATE_AVR_ARRAY (_f, _s, _n) \ - VMSTATE_AVR_ARRAY_V(_f, _s, _n, 0) +#define VMSTATE_AVR_ARRAY (_f, _s, _n) \ + VMSTATE_ARRAY_TEST(_f, _s, _n, NULL, vmstate_info_avr, ppc_avr_t)static void cpu_pre_save (void *opaque) {
@@ -290,11 +287,8 @@ static const VMStateInfo vmstate_info_slbe = { .put = put_slbe, }; -#define VMSTATE_SLB_ARRAY_V (_f, _s, _n, _v) \ - VMSTATE_ARRAY(_f, _s, _n, _v, vmstate_info_slbe, ppc_slb_t) - -#define VMSTATE_SLB_ARRAY (_f, _s, _n) \ - VMSTATE_SLB_ARRAY_V(_f, _s, _n, 0) +#define VMSTATE_SLB_ARRAY (_f, _s, _n) \ + VMSTATE_ARRAY_TEST(_f, _s, _n, NULL, vmstate_info_slbe, ppc_slb_t)static bool slb_needed (void *opaque) {
Signature · 1 line
1.9.0
PATCH 46/97 vmstate: All ptimers users were at least at version 1 or more
In reply to Juan QuintelaSo we can remove the version field.
--- include/hw/ptimer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/hw/ptimer.h +1 -1
@@ -28,7 +28,7 @@ void ptimer_stop(ptimer_state *s);extern const VMStateDescription vmstate_ptimer;#define VMSTATE_PTIMER (_field, _state) \ - VMSTATE_STRUCT_POINTER_V(_field, _state, 1, vmstate_ptimer, ptimer_state) + VMSTATE_STRUCT_POINTER(_field, _state, vmstate_ptimer, ptimer_state)#define VMSTATE_PTIMER_ARRAY (_f, _s, _n) \ VMSTATE_ARRAY_OF_POINTER_TO_STRUCT(_f, _s, _n, 0, \
Signature · 1 line
1.9.0
PATCH 47/97 vmstate: remove version from all variants of VMSTATE_STRUCT_POINTER*
In reply to Juan QuintelaThere were no more users of them.
--- include/migration/vmstate.h | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-)
include/migration/vmstate.h +2 -15
@@ -310,18 +310,8 @@ extern const VMStateInfo vmstate_info_bitmap; .offset = vmstate_offset_value(_state, _field, _type), \ } -#define VMSTATE_STRUCT_POINTER_V (_field, _state, _version, _vmsd, _type) { \ +#define VMSTATE_STRUCT_POINTER_TEST (_field, _state, _test, _vmsd, _type) { \ .name = (stringify(_field)), \ - .version_id = (_version), \ - .vmsd = &(_vmsd), \ - .size = sizeof(_type *), \ - .flags = VMS_STRUCT|VMS_POINTER, \ - .offset = vmstate_offset_pointer(_state, _field, _type), \ -} - -#define VMSTATE_STRUCT_POINTER_TEST_V (_field, _state, _test, _version, _vmsd, _type) { \ - .name = (stringify(_field)), \ - .version_id = (_version), \ .field_exists = (_test), \ .vmsd = &(_vmsd), \ .size = sizeof(_type *), \
@@ -516,10 +506,7 @@ extern const VMStateInfo vmstate_info_bitmap; VMSTATE_STRUCT_TEST(_field, _state, NULL, _version, _vmsd, _type)#define VMSTATE_STRUCT_POINTER (_field, _state, _vmsd, _type) \ - VMSTATE_STRUCT_POINTER_V(_field, _state, 0, _vmsd, _type) - -#define VMSTATE_STRUCT_POINTER_TEST (_field, _state, _test, _vmsd, _type) \ - VMSTATE_STRUCT_POINTER_TEST_V(_field, _state, _test, 0, _vmsd, _type) + VMSTATE_STRUCT_POINTER_TEST(_field, _state, NULL, _vmsd, _type)#define VMSTATE_STRUCT_ARRAY (_field, _state, _num, _version, _vmsd, _type) \ VMSTATE_STRUCT_ARRAY_TEST(_field, _state, _num, NULL, _version, \
Signature · 1 line
1.9.0
PATCH 48/97 vmstate: Port last 3 users of VMSTATE_ARRAY to VMSTATE_ARRAY_TEST
In reply to Juan QuintelaAnd then remove VMSTATE_ARRAY.
--- hw/net/vmxnet3.c | 13 +++++++------ include/migration/vmstate.h | 10 ---------- 2 files changed, 7 insertions(+), 16 deletions(-)
hw/net/vmxnet3.c +7 -6
@@ -2405,14 +2405,15 @@ static const VMStateDescription vmstate_vmxnet3 = {VMSTATE_UINT64 (drv_shmem, VMXNET3State),VMSTATE_UINT64 (temp_shared_guest_driver_memory, VMXNET3State), -VMSTATE_ARRAY (txq_descr, VMXNET3State, -VMXNET3_DEVICE_MAX_TX_QUEUES ,0 , txq_descr_info, +VMSTATE_ARRAY_TEST (txq_descr, VMXNET3State, +VMXNET3_DEVICE_MAX_TX_QUEUES ,NULL , txq_descr_info, Vmxnet3TxqDescr), -VMSTATE_ARRAY (rxq_descr, VMXNET3State, -VMXNET3_DEVICE_MAX_RX_QUEUES ,0 , rxq_descr_info, +VMSTATE_ARRAY_TEST (rxq_descr, VMXNET3State, +VMXNET3_DEVICE_MAX_RX_QUEUES ,NULL , rxq_descr_info, Vmxnet3RxqDescr), -VMSTATE_ARRAY (interrupt_states, VMXNET3State,VMXNET3_MAX_INTRS , -0 , int_state_info, Vmxnet3IntState), +VMSTATE_ARRAY_TEST (interrupt_states, VMXNET3State, +VMXNET3_MAX_INTRS ,NULL , int_state_info, + Vmxnet3IntState),VMSTATE_END_OF_LIST () },
include/migration/vmstate.h +0 -10
@@ -221,16 +221,6 @@ extern const VMStateInfo vmstate_info_bitmap; .offset = vmstate_offset_value(_state, _field, _type), \ } -#define VMSTATE_ARRAY (_field, _state, _num, _version, _info, _type) {\ - .name = (stringify(_field)), \ - .version_id = (_version), \ - .num = (_num), \ - .info = &(_info), \ - .size = sizeof(_type), \ - .flags = VMS_ARRAY, \ - .offset = vmstate_offset_array(_state, _field, _type, _num), \ -} -#define VMSTATE_2DARRAY (_field, _state, _n1, _n2, _version, _info, _type) { \ .name = (stringify(_field)), \ .version_id = (_version), \
Signature · 1 line
1.9.0
PATCH 49/97 vmstate: Port last user of VMSTATE_SINGLE to VMSTATE_SINGLE_TEST
In reply to Juan Quintela--- hw/timer/twl92230.c | 2 +- include/migration/vmstate.h | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-)
hw/timer/twl92230.c +1 -1
@@ -765,7 +765,7 @@ static const VMStateInfo vmstate_hack_int32_as_uint16 = { };#define VMSTATE_UINT16_HACK (_f, _s) \ - VMSTATE_SINGLE(_f, _s, 0, vmstate_hack_int32_as_uint16, int32_t) + VMSTATE_SINGLE_TEST(_f, _s, NULL, 0, vmstate_hack_int32_as_uint16, int32_t)static const VMStateDescription vmstate_menelaus_tm = {
include/migration/vmstate.h +0 -3
@@ -489,9 +489,6 @@ extern const VMStateInfo vmstate_info_bitmap;_v : version */ -#define VMSTATE_SINGLE (_field, _state, _version, _info, _type) \ - VMSTATE_SINGLE_TEST(_field, _state, NULL, _version, _info, _type) -#define VMSTATE_STRUCT (_field, _state, _version, _vmsd, _type) \ VMSTATE_STRUCT_TEST(_field, _state, NULL, _version, _vmsd, _type)
Signature · 1 line
1.9.0
PATCH 50/97 vmstate: Remove unused VMSTATE_POINTER
In reply to Juan Quintela--- include/migration/vmstate.h | 9 --------- 1 file changed, 9 deletions(-)
include/migration/vmstate.h +0 -9
@@ -203,15 +203,6 @@ extern const VMStateInfo vmstate_info_bitmap; .offset = vmstate_offset_value(_state, _field, _type), \ } -#define VMSTATE_POINTER (_field, _state, _version, _info, _type) { \ - .name = (stringify(_field)), \ - .version_id = (_version), \ - .info = &(_info), \ - .size = sizeof(_type), \ - .flags = VMS_SINGLE|VMS_POINTER, \ - .offset = vmstate_offset_value(_state, _field, _type), \ -} -#define VMSTATE_POINTER_TEST (_field, _state, _test, _info, _type) { \ .name = (stringify(_field)), \ .info = &(_info), \
Signature · 1 line
1.9.0
PATCH 51/97 vmstate: Rename VMSTATE_SINGLE_TEST to VMSTATE_SINGLE
In reply to Juan QuintelaAnd as no user used the version_id, just remove the parameter.
--- hw/nvram/eeprom93xx.c | 2 +- hw/nvram/fw_cfg.c | 2 +- hw/timer/twl92230.c | 2 +- include/migration/vmstate.h | 36 +++++++++++++++++------------------- target-i386/machine.c | 2 +- 5 files changed, 21 insertions(+), 23 deletions(-)
hw/nvram/eeprom93xx.c +1 -1
@@ -114,7 +114,7 @@ static const VMStateInfo vmstate_hack_uint16_from_uint8 = { };#define VMSTATE_UINT16_HACK_TEST (_f, _s, _t) \ - VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_hack_uint16_from_uint8, uint16_t) + VMSTATE_SINGLE(_f, _s, _t, vmstate_hack_uint16_from_uint8, uint16_t)static bool is_old_eeprom_version (void *opaque,int version_id) {
hw/nvram/fw_cfg.c +1 -1
@@ -365,7 +365,7 @@ static const VMStateInfo vmstate_hack_uint32_as_uint16 = { };#define VMSTATE_UINT16_HACK (_f, _s, _t) \ - VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_hack_uint32_as_uint16, uint32_t) + VMSTATE_SINGLE(_f, _s, _t, vmstate_hack_uint32_as_uint16, uint32_t)static bool is_version_1 (void *opaque,int version_id)
hw/timer/twl92230.c +1 -1
@@ -765,7 +765,7 @@ static const VMStateInfo vmstate_hack_int32_as_uint16 = { };#define VMSTATE_UINT16_HACK (_f, _s) \ - VMSTATE_SINGLE_TEST(_f, _s, NULL, 0, vmstate_hack_int32_as_uint16, int32_t) + VMSTATE_SINGLE(_f, _s, NULL, vmstate_hack_int32_as_uint16, int32_t)static const VMStateDescription vmstate_menelaus_tm = {
include/migration/vmstate.h +17 -19
@@ -193,9 +193,8 @@ extern const VMStateInfo vmstate_info_bitmap;vmstate_offset_array (_state, _field, uint8_t, \ sizeof(typeof_field(_state, _field))) -#define VMSTATE_SINGLE_TEST (_field, _state, _test, _version, _info, _type) { \ +#define VMSTATE_SINGLE (_field, _state, _test, _info, _type) { \ .name = (stringify(_field)), \ - .version_id = (_version), \ .field_exists = (_test), \ .size = sizeof(_type), \ .info = &(_info), \
@@ -491,25 +490,24 @@ extern const VMStateInfo vmstate_info_bitmap; _vmsd, _type)#define VMSTATE_BOOL_TEST (_f, _s, _t) \ - VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_info_bool, bool) + VMSTATE_SINGLE(_f, _s, _t, vmstate_info_bool, bool)#define VMSTATE_INT8_TEST (_f, _s, _t) \ - VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_info_int8, int8_t) + VMSTATE_SINGLE(_f, _s, _t, vmstate_info_int8, int8_t)#define VMSTATE_INT16_TEST (_f, _s, _t) \ - VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_info_int16, int16_t) + VMSTATE_SINGLE(_f, _s, _t, vmstate_info_int16, int16_t)#define VMSTATE_INT32_TEST (_f, _s, _t) \ - VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_info_int32, int32_t) + VMSTATE_SINGLE(_f, _s, _t, vmstate_info_int32, int32_t)#define VMSTATE_INT64_TEST (_f, _s, _t) \ - VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_info_int64, int64_t) - + VMSTATE_SINGLE(_f, _s, _t, vmstate_info_int64, int64_t)#define VMSTATE_UINT8_TEST (_f, _s, _t) \ - VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_info_uint8, uint8_t) + VMSTATE_SINGLE(_f, _s, _t, vmstate_info_uint8, uint8_t)#define VMSTATE_UINT16_TEST (_f, _s, _t) \ - VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_info_uint16, uint16_t) + VMSTATE_SINGLE(_f, _s, _t, vmstate_info_uint16, uint16_t)#define VMSTATE_UINT32_TEST (_f, _s, _t) \ - VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_info_uint32, uint32_t) + VMSTATE_SINGLE(_f, _s, _t, vmstate_info_uint32, uint32_t)#define VMSTATE_UINT64_TEST (_f, _s, _t) \ - VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_info_uint64, uint64_t) + VMSTATE_SINGLE(_f, _s, _t, vmstate_info_uint64, uint64_t)#define VMSTATE_BOOL (_f, _s) \ VMSTATE_BOOL_TEST(_f, _s, NULL)
@@ -533,28 +531,28 @@ extern const VMStateInfo vmstate_info_bitmap; VMSTATE_UINT64_TEST(_f, _s, NULL)#define VMSTATE_UINT8_EQUAL (_f, _s) \ - VMSTATE_SINGLE_TEST(_f, _s, NULL, 0, vmstate_info_uint8_equal, uint8_t) + VMSTATE_SINGLE(_f, _s, NULL, vmstate_info_uint8_equal, uint8_t)#define VMSTATE_UINT16_EQUAL_TEST (_f, _s, _t) \ - VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_info_uint16_equal, uint16_t) + VMSTATE_SINGLE(_f, _s, _t, vmstate_info_uint16_equal, uint16_t)#define VMSTATE_UINT16_EQUAL (_f, _s) \ VMSTATE_UINT16_EQUAL_TEST(_f, _s, NULL)#define VMSTATE_UINT32_EQUAL (_f, _s) \ - VMSTATE_SINGLE_TEST(_f, _s, NULL, 0, vmstate_info_uint32_equal, uint32_t) + VMSTATE_SINGLE(_f, _s, NULL, vmstate_info_uint32_equal, uint32_t)#define VMSTATE_UINT64_EQUAL (_f, _s) \ - VMSTATE_SINGLE_TEST(_f, _s, NULL, 0, vmstate_info_uint64_equal, uint64_t) + VMSTATE_SINGLE(_f, _s, NULL, vmstate_info_uint64_equal, uint64_t)#define VMSTATE_INT32_EQUAL (_f, _s) \ - VMSTATE_SINGLE_TEST(_f, _s, NULL, 0, vmstate_info_int32_equal, int32_t) + VMSTATE_SINGLE(_f, _s, NULL, vmstate_info_int32_equal, int32_t)#define VMSTATE_INT32_POSITIVE_LE (_f, _s) \ - VMSTATE_SINGLE_TEST(_f, _s, NULL, 0, vmstate_info_int32_le, int32_t) + VMSTATE_SINGLE(_f, _s, NULL, vmstate_info_int32_le, int32_t)#define VMSTATE_FLOAT64 (_f, _s) \ - VMSTATE_SINGLE_TEST(_f, _s, NULL, 0, vmstate_info_float64, float64) + VMSTATE_SINGLE(_f, _s, NULL, vmstate_info_float64, float64)#define VMSTATE_TIMER_TEST (_f, _s, _test) \ VMSTATE_POINTER_TEST(_f, _s, _test, vmstate_info_timer, QEMUTimer *)
target-i386/machine.c +1 -1
@@ -245,7 +245,7 @@ static const VMStateInfo vmstate_hack_uint64_as_uint32 = { };#define VMSTATE_HACK_UINT32 (_f, _s, _t) \ - VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_hack_uint64_as_uint32, uint64_t) + VMSTATE_SINGLE(_f, _s, _t, vmstate_hack_uint64_as_uint32, uint64_t)#endif static void cpu_pre_save (void *opaque)
Signature · 1 line
1.9.0
PATCH 52/97 vmstate: Move VMSTATE_2DARRAY to use _test
In reply to Juan QuintelaNo user used versions, so easy to change.
--- include/migration/vmstate.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)
include/migration/vmstate.h +11 -11
@@ -211,14 +211,14 @@ extern const VMStateInfo vmstate_info_bitmap; .offset = vmstate_offset_value(_state, _field, _type), \ } -#define VMSTATE_2DARRAY (_field, _state, _n1, _n2, _version, _info, _type) { \ - .name = (stringify(_field)), \ - .version_id = (_version), \ - .num = (_n1) * (_n2), \ - .info = &(_info), \ - .size = sizeof(_type), \ - .flags = VMS_ARRAY, \ - .offset = vmstate_offset_2darray(_state, _field, _type, _n1, _n2), \ +#define VMSTATE_2DARRAY (_field, _state, _n1, _n2, _test, _info, _type) { \ + .name = (stringify(_field)), \ + .field_exists = (_test), \ + .num = (_n1) * (_n2), \ + .info = &(_info), \ + .size = sizeof(_type), \ + .flags = VMS_ARRAY, \ + .offset = vmstate_offset_2darray(_state, _field, _type, _n1, _n2), \ }#define VMSTATE_ARRAY_TEST (_field, _state, _num, _test, _info, _type) {\
@@ -603,13 +603,13 @@ extern const VMStateInfo vmstate_info_bitmap; VMSTATE_ARRAY_TEST(_f, _s, _n, NULL, vmstate_info_float64, float64)#define VMSTATE_UINT8_2DARRAY (_f, _s, _n1, _n2) \ - VMSTATE_2DARRAY(_f, _s, _n1, _n2, 0, vmstate_info_uint8, uint8_t) + VMSTATE_2DARRAY(_f, _s, _n1, _n2, NULL, vmstate_info_uint8, uint8_t)#define VMSTATE_UINT16_2DARRAY (_f, _s, _n1, _n2) \ - VMSTATE_2DARRAY(_f, _s, _n1, _n2, 0, vmstate_info_uint16, uint16_t) + VMSTATE_2DARRAY(_f, _s, _n1, _n2, NULL, vmstate_info_uint16, uint16_t)#define VMSTATE_UINT32_2DARRAY (_f, _s, _n1, _n2) \ - VMSTATE_2DARRAY(_f, _s, _n1, _n2, 0, vmstate_info_uint32, uint32_t) + VMSTATE_2DARRAY(_f, _s, _n1, _n2, NULL, vmstate_info_uint32, uint32_t)#define VMSTATE_UINT8_SUB_ARRAY (_f, _s, _start, _num) \ VMSTATE_SUB_ARRAY(_f, _s, _start, _num, 0, vmstate_info_uint8, uint8_t)
Signature · 1 line
1.9.0
PATCH 53/97 vmstate: Rename VMSTATE_POINTER_TEST without _TEST
In reply to Juan QuintelaThe other didn't exist anymore.
--- include/migration/vmstate.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
include/migration/vmstate.h +7 -7
@@ -202,13 +202,13 @@ extern const VMStateInfo vmstate_info_bitmap; .offset = vmstate_offset_value(_state, _field, _type), \ } -#define VMSTATE_POINTER_TEST (_field, _state, _test, _info, _type) { \ - .name = (stringify(_field)), \ - .info = &(_info), \ +#define VMSTATE_POINTER (_field, _state, _test, _info, _type) { \ + .name = (stringify(_field)), \ + .info = &(_info), \ .field_exists = (_test), \ - .size = sizeof(_type), \ - .flags = VMS_SINGLE|VMS_POINTER, \ - .offset = vmstate_offset_value(_state, _field, _type), \ + .size = sizeof(_type), \ + .flags = VMS_SINGLE|VMS_POINTER, \ + .offset = vmstate_offset_value(_state, _field, _type), \ }#define VMSTATE_2DARRAY (_field, _state, _n1, _n2, _test, _info, _type) { \
@@ -555,7 +555,7 @@ extern const VMStateInfo vmstate_info_bitmap; VMSTATE_SINGLE(_f, _s, NULL, vmstate_info_float64, float64)#define VMSTATE_TIMER_TEST (_f, _s, _test) \ - VMSTATE_POINTER_TEST(_f, _s, _test, vmstate_info_timer, QEMUTimer *) + VMSTATE_POINTER(_f, _s, _test, vmstate_info_timer, QEMUTimer*)#define VMSTATE_TIMER (_f, _s) \ VMSTATE_TIMER_TEST(_f, _s, NULL)
Signature · 1 line
1.9.0
PATCH 54/97 vmstate: Rename VMSTATE_ARRAY_TEST to VMSTATE_ARRAY
In reply to Juan QuintelaVMSTATE_ARRAY is not being used anymore.
--- hw/net/vmxnet3.c | 9 ++++----- include/migration/vmstate.h | 20 ++++++++++---------- target-i386/machine.c | 6 +++--- target-ppc/machine.c | 4 ++-- 4 files changed, 19 insertions(+), 20 deletions(-)
hw/net/vmxnet3.c +4 -5
@@ -2405,15 +2405,14 @@ static const VMStateDescription vmstate_vmxnet3 = {VMSTATE_UINT64 (drv_shmem, VMXNET3State),VMSTATE_UINT64 (temp_shared_guest_driver_memory, VMXNET3State), -VMSTATE_ARRAY_TEST (txq_descr, VMXNET3State, +VMSTATE_ARRAY (txq_descr, VMXNET3State,VMXNET3_DEVICE_MAX_TX_QUEUES ,NULL , txq_descr_info, Vmxnet3TxqDescr), -VMSTATE_ARRAY_TEST (rxq_descr, VMXNET3State, +VMSTATE_ARRAY (rxq_descr, VMXNET3State,VMXNET3_DEVICE_MAX_RX_QUEUES ,NULL , rxq_descr_info, Vmxnet3RxqDescr), -VMSTATE_ARRAY_TEST (interrupt_states, VMXNET3State, -VMXNET3_MAX_INTRS ,NULL , int_state_info, - Vmxnet3IntState), +VMSTATE_ARRAY (interrupt_states, VMXNET3State,VMXNET3_MAX_INTRS , +NULL , int_state_info, Vmxnet3IntState),VMSTATE_END_OF_LIST () },
include/migration/vmstate.h +10 -10
@@ -221,7 +221,7 @@ extern const VMStateInfo vmstate_info_bitmap; .offset = vmstate_offset_2darray(_state, _field, _type, _n1, _n2), \ } -#define VMSTATE_ARRAY_TEST (_field, _state, _num, _test, _info, _type) {\ +#define VMSTATE_ARRAY (_field, _state, _num, _test, _info, _type) {\ .name = (stringify(_field)), \ .field_exists = (_test), \ .num = (_num), \
@@ -564,43 +564,43 @@ extern const VMStateInfo vmstate_info_bitmap; VMSTATE_ARRAY_OF_POINTER(_f, _s, _n, 0, vmstate_info_timer, QEMUTimer *) #define VMSTATE_BOOL_ARRAY_TEST(_f, _s, _n, _t) \ -VMSTATE_ARRAY_TEST (_f, _s, _n, _t, vmstate_info_bool, bool) +VMSTATE_ARRAY (_f, _s, _n, _t, vmstate_info_bool, bool) #define VMSTATE_BOOL_ARRAY(_f, _s, _n) \ VMSTATE_BOOL_ARRAY_TEST(_f, _s, _n, NULL)#define VMSTATE_UINT8_ARRAY (_f, _s, _n) \ - VMSTATE_ARRAY_TEST(_f, _s, _n, NULL, vmstate_info_uint8, uint8_t) + VMSTATE_ARRAY(_f, _s, _n, NULL, vmstate_info_uint8, uint8_t)#define VMSTATE_UINT16_ARRAY (_f, _s, _n) \ - VMSTATE_ARRAY_TEST(_f, _s, _n, NULL, vmstate_info_uint16, uint16_t) + VMSTATE_ARRAY(_f, _s, _n, NULL, vmstate_info_uint16, uint16_t)#define VMSTATE_UINT32_ARRAY_TEST (_f, _s, _n, _t) \ - VMSTATE_ARRAY_TEST(_f, _s, _n, _t, vmstate_info_uint32, uint32_t) + VMSTATE_ARRAY(_f, _s, _n, _t, vmstate_info_uint32, uint32_t)#define VMSTATE_UINT32_ARRAY (_f, _s, _n) \ VMSTATE_UINT32_ARRAY_TEST(_f, _s, _n, NULL)#define VMSTATE_UINT64_ARRAY_TEST (_f, _s, _n, _t) \ - VMSTATE_ARRAY_TEST(_f, _s, _n, _t, vmstate_info_uint64, uint64_t) + VMSTATE_ARRAY(_f, _s, _n, _t, vmstate_info_uint64, uint64_t)#define VMSTATE_UINT64_ARRAY (_f, _s, _n) \ VMSTATE_UINT64_ARRAY_TEST(_f, _s, _n, NULL)#define VMSTATE_INT16_ARRAY (_f, _s, _n) \ - VMSTATE_ARRAY_TEST(_f, _s, _n, NULL, vmstate_info_int16, int16_t) + VMSTATE_ARRAY(_f, _s, _n, NULL, vmstate_info_int16, int16_t)#define VMSTATE_INT32_ARRAY_TEST (_f, _s, _n, _t) \ - VMSTATE_ARRAY_TEST(_f, _s, _n, _t, vmstate_info_int32, int32_t) + VMSTATE_ARRAY(_f, _s, _n, _t, vmstate_info_int32, int32_t)#define VMSTATE_INT32_ARRAY (_f, _s, _n) \ VMSTATE_INT32_ARRAY_TEST(_f, _s, _n, NULL)#define VMSTATE_INT64_ARRAY (_f, _s, _n) \ - VMSTATE_ARRAY_TEST(_f, _s, _n, NULL, vmstate_info_int64, int64_t) + VMSTATE_ARRAY(_f, _s, _n, NULL, vmstate_info_int64, int64_t)#define VMSTATE_FLOAT64_ARRAY (_f, _s, _n) \ - VMSTATE_ARRAY_TEST(_f, _s, _n, NULL, vmstate_info_float64, float64) + VMSTATE_ARRAY(_f, _s, _n, NULL, vmstate_info_float64, float64)#define VMSTATE_UINT8_2DARRAY (_f, _s, _n1, _n2) \ VMSTATE_2DARRAY(_f, _s, _n1, _n2, NULL, vmstate_info_uint8, uint8_t)
target-i386/machine.c +3 -3
@@ -210,9 +210,9 @@ static bool fpregs_is_1_no_mmx(void *opaque, int version_id) }#define VMSTATE_FP_REGS (_field, _state, _n) \ - VMSTATE_ARRAY_TEST(_field, _state, _n, fpregs_is_0, vmstate_fpreg, FPReg), \ - VMSTATE_ARRAY_TEST(_field, _state, _n, fpregs_is_1_mmx, vmstate_fpreg_1_mmx, FPReg), \ - VMSTATE_ARRAY_TEST(_field, _state, _n, fpregs_is_1_no_mmx, vmstate_fpreg_1_no_mmx, FPReg) + VMSTATE_ARRAY(_field, _state, _n, fpregs_is_0, vmstate_fpreg, FPReg), \ + VMSTATE_ARRAY(_field, _state, _n, fpregs_is_1_mmx, vmstate_fpreg_1_mmx, FPReg), \ + VMSTATE_ARRAY(_field, _state, _n, fpregs_is_1_no_mmx, vmstate_fpreg_1_no_mmx, FPReg)static bool version_is_5 (void *opaque,int version_id) {
target-ppc/machine.c +2 -2
@@ -121,7 +121,7 @@ static const VMStateInfo vmstate_info_avr = { };#define VMSTATE_AVR_ARRAY (_f, _s, _n) \ - VMSTATE_ARRAY_TEST(_f, _s, _n, NULL, vmstate_info_avr, ppc_avr_t) + VMSTATE_ARRAY(_f, _s, _n, NULL, vmstate_info_avr, ppc_avr_t)static void cpu_pre_save (void *opaque) {
@@ -288,7 +288,7 @@ static const VMStateInfo vmstate_info_slbe = { };#define VMSTATE_SLB_ARRAY (_f, _s, _n) \ - VMSTATE_ARRAY_TEST(_f, _s, _n, NULL, vmstate_info_slbe, ppc_slb_t) + VMSTATE_ARRAY(_f, _s, _n, NULL, vmstate_info_slbe, ppc_slb_t)static bool slb_needed (void *opaque) {
Signature · 1 line
1.9.0
PATCH 55/97 vmstate: Remove version_id from VMSTATE_VBUFFER
In reply to Juan QuintelaNone of its two users use it.
--- include/migration/vmstate.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
include/migration/vmstate.h +3 -4
@@ -412,9 +412,8 @@ extern const VMStateInfo vmstate_info_bitmap; .start = (_start), \ } -#define VMSTATE_VBUFFER (_field, _state, _version, _test, _start, _field_size) { \ +#define VMSTATE_VBUFFER (_field, _state, _test, _start, _field_size) { \ .name = (stringify(_field)), \ - .version_id = (_version), \ .field_exists = (_test), \ .size_offset = vmstate_offset_value(_state, _field_size, int32_t),\ .info = &vmstate_info_buffer, \
@@ -627,13 +626,13 @@ extern const VMStateInfo vmstate_info_bitmap; VMSTATE_STATIC_BUFFER(_f, _s, 0, NULL, _start, sizeof(typeof_field(_s, _f)))#define VMSTATE_PARTIAL_VBUFFER (_f, _s, _size) \ - VMSTATE_VBUFFER(_f, _s, 0, NULL, 0, _size) + VMSTATE_VBUFFER(_f, _s, NULL, 0, _size)#define VMSTATE_PARTIAL_VBUFFER_UINT32 (_f, _s, _size) \ VMSTATE_VBUFFER_UINT32(_f, _s, 0, NULL, 0, _size)#define VMSTATE_SUB_VBUFFER (_f, _s, _start, _size) \ - VMSTATE_VBUFFER(_f, _s, 0, NULL, _start, _size) + VMSTATE_VBUFFER(_f, _s, NULL, _start, _size)#define VMSTATE_BUFFER_TEST (_f, _s, _test) \ VMSTATE_STATIC_BUFFER(_f, _s, 0, _test, 0, sizeof(typeof_field(_s, _f)))
Signature · 1 line
1.9.0
PATCH 56/97 vmstate: Remove version_id fields that were not used
In reply to Juan Quintela--- include/migration/vmstate.h | 4 ---- 1 file changed, 4 deletions(-)
include/migration/vmstate.h +0 -4
@@ -342,7 +342,6 @@ extern const VMStateInfo vmstate_info_bitmap;#define VMSTATE_STRUCT_VARRAY_POINTER_INT32 (_field, _state, _field_num, _vmsd, _type) { \ .name = (stringify(_field)), \ - .version_id = 0, \ .num_offset = vmstate_offset_value(_state, _field_num, int32_t), \ .size = sizeof(_type), \ .vmsd = &(_vmsd), \
@@ -352,7 +351,6 @@ extern const VMStateInfo vmstate_info_bitmap;#define VMSTATE_STRUCT_VARRAY_POINTER_UINT32 (_field, _state, _field_num, _vmsd, _type) { \ .name = (stringify(_field)), \ - .version_id = 0, \ .num_offset = vmstate_offset_value(_state, _field_num, uint32_t),\ .size = sizeof(_type), \ .vmsd = &(_vmsd), \
@@ -362,7 +360,6 @@ extern const VMStateInfo vmstate_info_bitmap;#define VMSTATE_STRUCT_VARRAY_POINTER_UINT16 (_field, _state, _field_num, _vmsd, _type) { \ .name = (stringify(_field)), \ - .version_id = 0, \ .num_offset = vmstate_offset_value(_state, _field_num, uint16_t),\ .size = sizeof(_type), \ .vmsd = &(_vmsd), \
@@ -464,7 +461,6 @@ extern const VMStateInfo vmstate_info_bitmap;*/ #define VMSTATE_BITMAP (_field, _state, _field_size) { \ .name = (stringify(_field)), \ - .version_id = 0, \ .size_offset = vmstate_offset_value(_state, _field_size, int32_t),\ .info = &vmstate_info_bitmap, \ .flags = VMS_VBUFFER|VMS_POINTER, \
Signature · 1 line
1.9.0
PATCH 57/97 vmstate: Remove version_id from VMSTATE_SUB_ARRAY
In reply to Juan QuintelaNone of its two users used it.
--- include/migration/vmstate.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
include/migration/vmstate.h +3 -4
@@ -231,9 +231,8 @@ extern const VMStateInfo vmstate_info_bitmap; .offset = vmstate_offset_array(_state, _field, _type, _num),\ } -#define VMSTATE_SUB_ARRAY (_field, _state, _start, _num, _version, _info, _type) { \ +#define VMSTATE_SUB_ARRAY (_field, _state, _start, _num, _info, _type) { \ .name = (stringify(_field)), \ - .version_id = (_version), \ .num = (_num), \ .info = &(_info), \ .size = sizeof(_type), \
@@ -607,10 +606,10 @@ extern const VMStateInfo vmstate_info_bitmap; VMSTATE_2DARRAY(_f, _s, _n1, _n2, NULL, vmstate_info_uint32, uint32_t)#define VMSTATE_UINT8_SUB_ARRAY (_f, _s, _start, _num) \ - VMSTATE_SUB_ARRAY(_f, _s, _start, _num, 0, vmstate_info_uint8, uint8_t) + VMSTATE_SUB_ARRAY(_f, _s, _start, _num, vmstate_info_uint8, uint8_t)#define VMSTATE_UINT32_SUB_ARRAY (_f, _s, _start, _num) \ - VMSTATE_SUB_ARRAY(_f, _s, _start, _num, 0, vmstate_info_uint32, uint32_t) + VMSTATE_SUB_ARRAY(_f, _s, _start, _num, vmstate_info_uint32, uint32_t)#define VMSTATE_BUFFER (_f, _s) \ VMSTATE_STATIC_BUFFER(_f, _s, 0, NULL, 0, sizeof(typeof_field(_s, _f)))
Signature · 1 line
1.9.0
PATCH 58/97 vmstate: Remove version parameter from VMSTATE_VARRAY_INT32
In reply to Juan Quintela--- docs/migration.txt | 2 +- hw/block/fdc.c | 2 +- hw/display/qxl.c | 2 +- hw/display/vmware_vga.c | 2 +- hw/ide/core.c | 2 +- hw/pci/pci.c | 3 +-- include/migration/vmstate.h | 3 +-- target-arm/machine.c | 4 ++-- 8 files changed, 9 insertions(+), 11 deletions(-)
docs/migration.txt +1 -1
@@ -259,7 +259,7 @@ const VMStateDescription vmstate_ide_drive_pio_state = { .post_load = ide_drive_pio_post_load, .fields = (VMStateField[]) { VMSTATE_INT32(req_nb_sectors, IDEState), - VMSTATE_VARRAY_INT32(io_buffer, IDEState, io_buffer_total_len, 1, + VMSTATE_VARRAY_INT32(io_buffer, IDEState, io_buffer_total_len, vmstate_info_uint8, uint8_t), VMSTATE_INT32(cur_io_buffer_offset, IDEState), VMSTATE_INT32(cur_io_buffer_len, IDEState),
hw/block/fdc.c +1 -1
@@ -752,7 +752,7 @@ static const VMStateDescription vmstate_fdc = {VMSTATE_UINT8 (status1, FDCtrl),VMSTATE_UINT8 (status2, FDCtrl),/* Command FIFO */ -VMSTATE_VARRAY_INT32 (fifo, FDCtrl, fifo_size,0 , vmstate_info_uint8, +VMSTATE_VARRAY_INT32 (fifo, FDCtrl, fifo_size, vmstate_info_uint8, uint8_t),VMSTATE_UINT32 (data_pos, FDCtrl), VMSTATE_UINT32(data_len, FDCtrl),
hw/display/qxl.c +1 -1
@@ -2271,7 +2271,7 @@ static VMStateDescription qxl_vmstate = { qxl_surface, QXLSurfaceCreate),VMSTATE_INT32_EQUAL (ssd.num_surfaces, PCIQXLDevice),VMSTATE_VARRAY_INT32 (guest_surfaces.cmds, PCIQXLDevice, - ssd.num_surfaces,0 , + ssd.num_surfaces, vmstate_info_uint64, uint64_t),VMSTATE_UINT64 (guest_cursor, PCIQXLDevice),VMSTATE_END_OF_LIST ()
hw/display/vmware_vga.c +1 -1
@@ -1163,7 +1163,7 @@ static const VMStateDescription vmstate_vmware_vga_internal = { VMSTATE_INT32(cursor.on, struct vmsvga_state_s), VMSTATE_INT32(index, struct vmsvga_state_s), VMSTATE_VARRAY_INT32(scratch, struct vmsvga_state_s, - scratch_size,0 , vmstate_info_uint32, uint32_t), + scratch_size, vmstate_info_uint32, uint32_t), VMSTATE_INT32(new_width, struct vmsvga_state_s), VMSTATE_INT32(new_height, struct vmsvga_state_s), VMSTATE_UINT32(guest, struct vmsvga_state_s),
hw/ide/core.c +1 -1
@@ -2368,7 +2368,7 @@ static const VMStateDescription vmstate_ide_drive_pio_state = { .post_load = ide_drive_pio_post_load, .fields = (VMStateField []) {VMSTATE_INT32 (req_nb_sectors, IDEState), -VMSTATE_VARRAY_INT32 (io_buffer, IDEState, io_buffer_total_len,1 , +VMSTATE_VARRAY_INT32 (io_buffer, IDEState, io_buffer_total_len, vmstate_info_uint8, uint8_t),VMSTATE_INT32 (cur_io_buffer_offset, IDEState),VMSTATE_INT32 (cur_io_buffer_len, IDEState),
hw/pci/pci.c +1 -2
@@ -66,8 +66,7 @@ static const VMStateDescription vmstate_pcibus = { .minimum_version_id = 1, .fields = (VMStateField []) {VMSTATE_INT32_EQUAL (nirq, PCIBus), -VMSTATE_VARRAY_INT32 (irq_count, PCIBus, - nirq,0 , vmstate_info_int32, +VMSTATE_VARRAY_INT32 (irq_count, PCIBus, nirq, vmstate_info_int32, int32_t),VMSTATE_END_OF_LIST () }
include/migration/vmstate.h +1 -2
@@ -249,9 +249,8 @@ extern const VMStateInfo vmstate_info_bitmap; .offset = offsetof(_state, _field), \ } -#define VMSTATE_VARRAY_INT32 (_field, _state, _field_num, _version, _info, _type) {\ +#define VMSTATE_VARRAY_INT32 (_field, _state, _field_num, _info, _type) {\ .name = (stringify(_field)), \ - .version_id = (_version), \ .num_offset = vmstate_offset_value(_state, _field_num, int32_t), \ .info = &(_info), \ .size = sizeof(_type), \
target-arm/machine.c +2 -2
@@ -244,10 +244,10 @@ const VMStateDescription vmstate_arm_cpu = {VMSTATE_INT32_POSITIVE_LE (cpreg_vmstate_array_len,ARMCPU ),VMSTATE_VARRAY_INT32 (cpreg_vmstate_indexes,ARMCPU , cpreg_vmstate_array_len, -0 , vmstate_info_uint64, uint64_t), + vmstate_info_uint64, uint64_t),VMSTATE_VARRAY_INT32 (cpreg_vmstate_values,ARMCPU , cpreg_vmstate_array_len, -0 , vmstate_info_uint64, uint64_t), + vmstate_info_uint64, uint64_t),VMSTATE_UINT64 (env.exclusive_addr,ARMCPU ),VMSTATE_UINT64 (env.exclusive_val,ARMCPU ), VMSTATE_UINT64(env.exclusive_high, ARMCPU),
Signature · 1 line
1.9.0
PATCH 59/97 vmstate: Remove version_id from VMSTATE_VARRAY_UINT16_UNSAFE
In reply to Juan Quintela--- hw/nvram/eeprom93xx.c | 2 +- include/migration/vmstate.h | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-)
hw/nvram/eeprom93xx.c +1 -1
@@ -145,7 +145,7 @@ static const VMStateDescription vmstate_eeprom = {VMSTATE_UNUSED_TEST (is_old_eeprom_version,1 ),VMSTATE_UINT16_EQUAL_TEST (size, eeprom_t, is_eeprom_version),VMSTATE_UINT16 (data, eeprom_t), -VMSTATE_VARRAY_UINT16_UNSAFE (contents, eeprom_t, size,0 , +VMSTATE_VARRAY_UINT16_UNSAFE (contents, eeprom_t, size, vmstate_info_uint16, uint16_t), VMSTATE_END_OF_LIST() }
include/migration/vmstate.h +1 -2
@@ -268,9 +268,8 @@ extern const VMStateInfo vmstate_info_bitmap; .offset = vmstate_offset_pointer(_state, _field, _type), \ } -#define VMSTATE_VARRAY_UINT16_UNSAFE (_field, _state, _field_num, _version, _info, _type) {\ +#define VMSTATE_VARRAY_UINT16_UNSAFE (_field, _state, _field_num, _info, _type) {\ .name = (stringify(_field)), \ - .version_id = (_version), \ .num_offset = vmstate_offset_value(_state, _field_num, uint16_t),\ .info = &(_info), \ .size = sizeof(_type), \
Signature · 1 line
1.9.0
PATCH 60/97 vmstate: VMSTATE_ARRAY_OF_POINTER didn't used the version_id field
In reply to Juan Quintela--- include/migration/vmstate.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
include/migration/vmstate.h +2 -3
@@ -296,9 +296,8 @@ extern const VMStateInfo vmstate_info_bitmap; .offset = vmstate_offset_pointer(_state, _field, _type), \ } -#define VMSTATE_ARRAY_OF_POINTER (_field, _state, _num, _version, _info, _type) {\ +#define VMSTATE_ARRAY_OF_POINTER (_field, _state, _num, _info, _type) {\ .name = (stringify(_field)), \ - .version_id = (_version), \ .num = (_num), \ .info = &(_info), \ .size = sizeof(_type), \
@@ -553,7 +552,7 @@ extern const VMStateInfo vmstate_info_bitmap; VMSTATE_TIMER_TEST(_f, _s, NULL)#define VMSTATE_TIMER_ARRAY (_f, _s, _n) \ - VMSTATE_ARRAY_OF_POINTER(_f, _s, _n, 0, vmstate_info_timer, QEMUTimer *) + VMSTATE_ARRAY_OF_POINTER(_f, _s, _n, vmstate_info_timer, QEMUTimer*)#define VMSTATE_BOOL_ARRAY_TEST (_f, _s, _n, _t) \ VMSTATE_ARRAY(_f, _s, _n, _t, vmstate_info_bool, bool)
Signature · 1 line
1.9.0
PATCH 61/97 vmstate: remove version parameter from VMSTATE_BUFFER_POINTER_UNSAFE
In reply to Juan Quintela--- hw/block/onenand.c | 2 +- hw/sd/sd.c | 2 +- include/migration/vmstate.h | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-)
hw/block/onenand.c +1 -1
@@ -189,7 +189,7 @@ static const VMStateDescription vmstate_onenand = {VMSTATE_UINT8 (ecc.cp, OneNANDState),VMSTATE_UINT16_ARRAY (ecc.lp, OneNANDState,2 ),VMSTATE_UINT16 (ecc.count, OneNANDState), -VMSTATE_BUFFER_POINTER_UNSAFE (otp, OneNANDState,0 , +VMSTATE_BUFFER_POINTER_UNSAFE (otp, OneNANDState, ((64 +2 ) <<PAGE_SHIFT )), VMSTATE_END_OF_LIST() }
hw/sd/sd.c +1 -1
@@ -480,7 +480,7 @@ static const VMStateDescription sd_vmstate = {VMSTATE_UINT64 (data_start, SDState),VMSTATE_UINT32 (data_offset, SDState),VMSTATE_UINT8_ARRAY (data, SDState,512 ), -VMSTATE_BUFFER_POINTER_UNSAFE (buf, SDState,1 ,512 ), +VMSTATE_BUFFER_POINTER_UNSAFE (buf, SDState,512 ),VMSTATE_BOOL (enable, SDState), VMSTATE_END_OF_LIST() }
include/migration/vmstate.h +1 -2
@@ -435,9 +435,8 @@ extern const VMStateInfo vmstate_info_bitmap; .offset = offsetof(_state, _field), \ } -#define VMSTATE_BUFFER_POINTER_UNSAFE (_field, _state, _version, _size) { \ +#define VMSTATE_BUFFER_POINTER_UNSAFE (_field, _state, _size) { \ .name = (stringify(_field)), \ - .version_id = (_version), \ .size = (_size), \ .info = &vmstate_info_buffer, \ .flags = VMS_BUFFER|VMS_POINTER, \
Signature · 1 line
1.9.0
PATCH 62/97 vmstate: Remove version, test and start parameter from VMSTATE_VBUFFER_UINT32
In reply to Juan QuintelaNone of its users use them.
--- hw/char/exynos4210_uart.c | 2 +- hw/display/g364fb.c | 2 +- hw/dma/pl330.c | 8 ++++---- hw/intc/exynos4210_gic.c | 2 +- hw/net/vmxnet3.c | 3 +-- hw/nvram/mac_nvram.c | 2 +- hw/sd/sdhci.c | 2 +- hw/timer/m48t59.c | 2 +- include/migration/vmstate.h | 7 ++----- util/fifo8.c | 2 +- 10 files changed, 14 insertions(+), 18 deletions(-)
hw/char/exynos4210_uart.c +1 -1
@@ -563,7 +563,7 @@ static const VMStateDescription vmstate_exynos4210_uart_fifo = { .fields = (VMStateField[]) {VMSTATE_UINT32 (sp, Exynos4210UartFIFO),VMSTATE_UINT32 (rp, Exynos4210UartFIFO), -VMSTATE_VBUFFER_UINT32 (data, Exynos4210UartFIFO,1 ,NULL ,0 , size), +VMSTATE_VBUFFER_UINT32 (data, Exynos4210UartFIFO, size),VMSTATE_END_OF_LIST () } };
hw/display/g364fb.c +1 -1
@@ -461,7 +461,7 @@ static const VMStateDescription vmstate_g364fb = { .minimum_version_id = 1, .post_load = g364fb_post_load, .fields = (VMStateField []) { -VMSTATE_VBUFFER_UINT32 (vram, G364State,1 ,NULL ,0 , vram_size), +VMSTATE_VBUFFER_UINT32 (vram, G364State, vram_size),VMSTATE_BUFFER_UNSAFE (color_palette, G364State,256 *3 ),VMSTATE_BUFFER_UNSAFE (cursor_palette, G364State,9 ),VMSTATE_UINT16_ARRAY (cursor, G364State,512 ),
hw/dma/pl330.c +4 -4
@@ -170,8 +170,8 @@ static const VMStateDescription vmstate_pl330_fifo = { .version_id = 1, .minimum_version_id = 1, .fields = (VMStateField []) { -VMSTATE_VBUFFER_UINT32 (buf, PL330Fifo,1 ,NULL ,0 , buf_size), -VMSTATE_VBUFFER_UINT32 (tag, PL330Fifo,1 ,NULL ,0 , buf_size), +VMSTATE_VBUFFER_UINT32 (buf, PL330Fifo, buf_size), +VMSTATE_VBUFFER_UINT32 (tag, PL330Fifo, buf_size),VMSTATE_UINT32 (head, PL330Fifo),VMSTATE_UINT32 (num, PL330Fifo),VMSTATE_UINT32 (buf_size, PL330Fifo),
@@ -279,8 +279,8 @@ static const VMStateDescription vmstate_pl330 = {VMSTATE_STRUCT (manager, PL330State,0 , vmstate_pl330_chan, PL330Chan),VMSTATE_STRUCT_VARRAY_UINT32 (chan, PL330State, num_chnls,0 , vmstate_pl330_chan, PL330Chan), -VMSTATE_VBUFFER_UINT32 (lo_seqn, PL330State,1 ,NULL ,0 , num_chnls), -VMSTATE_VBUFFER_UINT32 (hi_seqn, PL330State,1 ,NULL ,0 , num_chnls), +VMSTATE_VBUFFER_UINT32 (lo_seqn, PL330State, num_chnls), +VMSTATE_VBUFFER_UINT32 (hi_seqn, PL330State, num_chnls),VMSTATE_STRUCT (fifo, PL330State,0 , vmstate_pl330_fifo, PL330Fifo),VMSTATE_STRUCT (read_queue, PL330State,0 , vmstate_pl330_queue, PL330Queue),
hw/intc/exynos4210_gic.c +1 -1
@@ -395,7 +395,7 @@ static const VMStateDescription vmstate_exynos4210_irq_gate = { .version_id = 2, .minimum_version_id = 2, .fields = (VMStateField []) { -VMSTATE_VBUFFER_UINT32 (level, Exynos4210IRQGateState,1 ,NULL ,0 , n_in), +VMSTATE_VBUFFER_UINT32 (level, Exynos4210IRQGateState, n_in),VMSTATE_END_OF_LIST () } };
hw/net/vmxnet3.c +1 -2
@@ -2176,8 +2176,7 @@ static const VMStateDescription vmxstate_vmxnet3_mcast_list = { .minimum_version_id = 1, .pre_load = vmxnet3_mcast_list_pre_load, .fields = (VMStateField []) { -VMSTATE_VBUFFER_UINT32 (mcast_list, VMXNET3State,0 ,NULL ,0 , - mcast_list_buff_size), +VMSTATE_VBUFFER_UINT32 (mcast_list, VMXNET3State, mcast_list_buff_size),VMSTATE_END_OF_LIST () } };
hw/nvram/mac_nvram.c +1 -1
@@ -97,7 +97,7 @@ static const VMStateDescription vmstate_macio_nvram = { .version_id = 1, .minimum_version_id = 1, .fields = (VMStateField []) { -VMSTATE_VBUFFER_UINT32 (data, MacIONVRAMState,0 ,NULL ,0 , size), +VMSTATE_VBUFFER_UINT32 (data, MacIONVRAMState, size),VMSTATE_END_OF_LIST () } };
hw/sd/sdhci.c +1 -1
@@ -1223,7 +1223,7 @@ const VMStateDescription sdhci_vmstate = {VMSTATE_UINT16 (data_count, SDHCIState),VMSTATE_UINT64 (admasysaddr, SDHCIState),VMSTATE_UINT8 (stopped_state, SDHCIState), -VMSTATE_VBUFFER_UINT32 (fifo_buffer, SDHCIState,1 ,NULL ,0 , buf_maxsz), +VMSTATE_VBUFFER_UINT32 (fifo_buffer, SDHCIState, buf_maxsz),VMSTATE_TIMER (insert_timer, SDHCIState),VMSTATE_TIMER (transfer_timer, SDHCIState),VMSTATE_END_OF_LIST ()
hw/timer/m48t59.c +1 -1
@@ -598,7 +598,7 @@ static const VMStateDescription vmstate_m48t59 = { .fields = (VMStateField[]) {VMSTATE_UINT8 (lock, M48t59State),VMSTATE_UINT16 (addr, M48t59State), -VMSTATE_VBUFFER_UINT32 (buffer, M48t59State,0 ,NULL ,0 , size), +VMSTATE_VBUFFER_UINT32 (buffer, M48t59State, size),VMSTATE_END_OF_LIST () } };
include/migration/vmstate.h +2 -5
@@ -415,15 +415,12 @@ extern const VMStateInfo vmstate_info_bitmap; .start = (_start), \ } -#define VMSTATE_VBUFFER_UINT32 (_field, _state, _version, _test, _start, _field_size) { \ +#define VMSTATE_VBUFFER_UINT32 (_field, _state, _field_size) { \ .name = (stringify(_field)), \ - .version_id = (_version), \ - .field_exists = (_test), \ .size_offset = vmstate_offset_value(_state, _field_size, uint32_t),\ .info = &vmstate_info_buffer, \ .flags = VMS_VBUFFER|VMS_POINTER, \ .offset = offsetof(_state, _field), \ - .start = (_start), \ }#define VMSTATE_BUFFER_UNSAFE_TEST (_field, _state, _test, _info, _size) { \
@@ -620,7 +617,7 @@ extern const VMStateInfo vmstate_info_bitmap; VMSTATE_VBUFFER(_f, _s, NULL, 0, _size)#define VMSTATE_PARTIAL_VBUFFER_UINT32 (_f, _s, _size) \ - VMSTATE_VBUFFER_UINT32(_f, _s, 0, NULL, 0, _size) + VMSTATE_VBUFFER_UINT32(_f, _s, _size)#define VMSTATE_SUB_VBUFFER (_f, _s, _start, _size) \ VMSTATE_VBUFFER(_f, _s, NULL, _start, _size)
util/fifo8.c +1 -1
@@ -117,7 +117,7 @@ const VMStateDescription vmstate_fifo8 = { .version_id = 1, .minimum_version_id = 1, .fields = (VMStateField []) { -VMSTATE_VBUFFER_UINT32 (data, Fifo8,1 ,NULL ,0 , capacity), +VMSTATE_VBUFFER_UINT32 (data, Fifo8, capacity),VMSTATE_UINT32 (head, Fifo8),VMSTATE_UINT32 (num, Fifo8),VMSTATE_END_OF_LIST ()
Signature · 1 line
1.9.0
PATCH 63/97 vmstate: Remove version paramenter from VMSTATE_ARRAY_OF_POINTER_TO_STRUCT
In reply to Juan Quintela--- include/hw/ptimer.h | 2 +- include/migration/vmstate.h | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-)
include/hw/ptimer.h +1 -1
@@ -31,7 +31,7 @@ extern const VMStateDescription vmstate_ptimer; VMSTATE_STRUCT_POINTER(_field, _state, vmstate_ptimer, ptimer_state)#define VMSTATE_PTIMER_ARRAY (_f, _s, _n) \ - VMSTATE_ARRAY_OF_POINTER_TO_STRUCT(_f, _s, _n, 0, \ + VMSTATE_ARRAY_OF_POINTER_TO_STRUCT(_f, _s, _n, \ vmstate_ptimer, ptimer_state)#endif
include/migration/vmstate.h +2 -3
@@ -305,12 +305,11 @@ extern const VMStateInfo vmstate_info_bitmap; .offset = vmstate_offset_array(_state, _field, _type, _num), \ } -#define VMSTATE_ARRAY_OF_POINTER_TO_STRUCT (_f, _s, _n, _v, _vmsd, _type) { \ +#define VMSTATE_ARRAY_OF_POINTER_TO_STRUCT (_f, _s, _n, _vmsd, _type) { \ .name = (stringify(_f)), \ - .version_id = (_v), \ .num = (_n), \ .vmsd = &(_vmsd), \ - .size = sizeof(_type *), \ + .size = sizeof(_type *), \ .flags = VMS_ARRAY|VMS_STRUCT|VMS_ARRAY_OF_POINTER, \ .offset = vmstate_offset_array(_s, _f, _type*, _n), \ }
Signature · 1 line
1.9.0
PATCH 64/97 vmstate: Remove VMSTATE_BUFFER_MULTIPLY
In reply to Juan QuintelaIt was unused.
--- include/migration/vmstate.h | 13 ------------- vmstate.c | 3 --- 2 files changed, 16 deletions(-)
include/migration/vmstate.h +0 -13
@@ -97,7 +97,6 @@ enum VMStateFlags {VMS_ARRAY_OF_POINTER =0x040 ,VMS_VARRAY_UINT16 =0x080 ,/* Array with size in uint16_t field */ VMS_VBUFFER =0x100 ,/* Buffer with size in int32_t field */ -VMS_MULTIPLY =0x200 ,/* multiply "size" field by field_size */ VMS_VARRAY_UINT8 =0x400 ,/* Array with size in uint8_t field*/ VMS_VARRAY_UINT32 = 0x800, /* Array with size in uint32_t field*/ };
@@ -392,18 +391,6 @@ extern const VMStateInfo vmstate_info_bitmap; .offset = vmstate_offset_buffer(_state, _field) + _start, \ } -#define VMSTATE_VBUFFER_MULTIPLY (_field, _state, _version, _test, _start, _field_size, _multiply) { \ - .name = (stringify(_field)), \ - .version_id = (_version), \ - .field_exists = (_test), \ - .size_offset = vmstate_offset_value(_state, _field_size, uint32_t),\ - .size = (_multiply), \ - .info = &vmstate_info_buffer, \ - .flags = VMS_VBUFFER|VMS_POINTER|VMS_MULTIPLY, \ - .offset = offsetof(_state, _field), \ - .start = (_start), \ -} -#define VMSTATE_VBUFFER (_field, _state, _test, _start, _field_size) { \ .name = (stringify(_field)), \ .field_exists = (_test), \
vmstate.c +0 -3
@@ -35,9 +35,6 @@ static int vmstate_size(void *opaque, VMStateField *field)if (field->flags &VMS_VBUFFER ) { size = *(int32_t *)(opaque+field->size_offset); -if (field->flags &VMS_MULTIPLY ) { - size *= field->size; - } }return size;
Signature · 1 line
1.9.0
PATCH 65/97 vmstate: Remove version parameter from VMSTATE_STATIC_BUFFER
In reply to Juan QuintelaNo user for it.
--- include/migration/vmstate.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
include/migration/vmstate.h +5 -6
@@ -381,9 +381,8 @@ extern const VMStateInfo vmstate_info_bitmap; .offset = offsetof(_state, _field), \ } -#define VMSTATE_STATIC_BUFFER (_field, _state, _version, _test, _start, _size) { \ +#define VMSTATE_STATIC_BUFFER (_field, _state, _test, _start, _size) { \ .name = (stringify(_field)), \ - .version_id = (_version), \ .field_exists = (_test), \ .size = (_size - _start), \ .info = &vmstate_info_buffer, \
@@ -591,13 +590,13 @@ extern const VMStateInfo vmstate_info_bitmap; VMSTATE_SUB_ARRAY(_f, _s, _start, _num, vmstate_info_uint32, uint32_t)#define VMSTATE_BUFFER (_f, _s) \ - VMSTATE_STATIC_BUFFER(_f, _s, 0, NULL, 0, sizeof(typeof_field(_s, _f))) + VMSTATE_STATIC_BUFFER(_f, _s, NULL, 0, sizeof(typeof_field(_s, _f)))#define VMSTATE_PARTIAL_BUFFER (_f, _s, _size) \ - VMSTATE_STATIC_BUFFER(_f, _s, 0, NULL, 0, _size) + VMSTATE_STATIC_BUFFER(_f, _s, NULL, 0, _size)#define VMSTATE_BUFFER_START_MIDDLE (_f, _s, _start) \ - VMSTATE_STATIC_BUFFER(_f, _s, 0, NULL, _start, sizeof(typeof_field(_s, _f))) + VMSTATE_STATIC_BUFFER(_f, _s, NULL, _start, sizeof(typeof_field(_s, _f)))#define VMSTATE_PARTIAL_VBUFFER (_f, _s, _size) \ VMSTATE_VBUFFER(_f, _s, NULL, 0, _size)
@@ -609,7 +608,7 @@ extern const VMStateInfo vmstate_info_bitmap; VMSTATE_VBUFFER(_f, _s, NULL, _start, _size)#define VMSTATE_BUFFER_TEST (_f, _s, _test) \ - VMSTATE_STATIC_BUFFER(_f, _s, 0, _test, 0, sizeof(typeof_field(_s, _f))) + VMSTATE_STATIC_BUFFER(_f, _s, _test, 0, sizeof(typeof_field(_s, _f)))#define VMSTATE_BUFFER_UNSAFE (_field, _state, _size) \ VMSTATE_BUFFER_UNSAFE_TEST(_field, _state, NULL, vmstate_info_buffer, _size)
Signature · 1 line
1.9.0
PATCH 66/97 vmstate: Remove version field from VMSTATE_STRUCT_VARRAY_UINT32
In reply to Juan QuintelaNo user of it.
--- hw/dma/pl330.c | 4 ++-- hw/timer/a9gtimer.c | 2 +- hw/timer/arm_mptimer.c | 2 +- hw/usb/hcd-xhci.c | 6 +++--- include/migration/vmstate.h | 3 +-- 5 files changed, 8 insertions(+), 9 deletions(-)
hw/dma/pl330.c +2 -2
@@ -216,7 +216,7 @@ static const VMStateDescription vmstate_pl330_queue = { .version_id = 1, .minimum_version_id =1 , .fields = (VMStateField[]) { -VMSTATE_STRUCT_VARRAY_UINT32 (queue, PL330Queue, queue_size,1 , +VMSTATE_STRUCT_VARRAY_UINT32 (queue, PL330Queue, queue_size, vmstate_pl330_queue_entry, PL330QueueEntry),VMSTATE_END_OF_LIST () }
@@ -277,7 +277,7 @@ static const VMStateDescription vmstate_pl330 = { .minimum_version_id = 1, .fields = (VMStateField []) {VMSTATE_STRUCT (manager, PL330State,0 , vmstate_pl330_chan, PL330Chan), -VMSTATE_STRUCT_VARRAY_UINT32 (chan, PL330State, num_chnls,0 , +VMSTATE_STRUCT_VARRAY_UINT32 (chan, PL330State, num_chnls, vmstate_pl330_chan, PL330Chan),VMSTATE_VBUFFER_UINT32 (lo_seqn, PL330State, num_chnls),VMSTATE_VBUFFER_UINT32 (hi_seqn, PL330State, num_chnls),
hw/timer/a9gtimer.c +1 -1
@@ -333,7 +333,7 @@ static const VMStateDescription vmstate_a9_gtimer = {VMSTATE_UINT64 (ref_counter, A9GTimerState),VMSTATE_UINT64 (cpu_ref_time, A9GTimerState),VMSTATE_STRUCT_VARRAY_UINT32 (per_cpu, A9GTimerState, num_cpu, -1 , vmstate_a9_gtimer_per_cpu, + vmstate_a9_gtimer_per_cpu, A9GTimerPerCPU), VMSTATE_END_OF_LIST() }
hw/timer/arm_mptimer.c +1 -1
@@ -257,7 +257,7 @@ static const VMStateDescription vmstate_arm_mptimer = { .minimum_version_id = 2, .fields = (VMStateField []) {VMSTATE_STRUCT_VARRAY_UINT32 (timerblock, ARMMPTimerState, num_cpu, -2 , vmstate_timerblock, TimerBlock), + vmstate_timerblock, TimerBlock),VMSTATE_END_OF_LIST () } };
hw/usb/hcd-xhci.c +3 -3
@@ -3752,11 +3752,11 @@ static const VMStateDescription vmstate_xhci = {VMSTATE_PCIE_DEVICE (parent_obj, XHCIState),VMSTATE_MSIX (parent_obj, XHCIState), -VMSTATE_STRUCT_VARRAY_UINT32 (ports, XHCIState, numports,1 , +VMSTATE_STRUCT_VARRAY_UINT32 (ports, XHCIState, numports, vmstate_xhci_port, XHCIPort), -VMSTATE_STRUCT_VARRAY_UINT32 (slots, XHCIState, numslots,1 , +VMSTATE_STRUCT_VARRAY_UINT32 (slots, XHCIState, numslots, vmstate_xhci_slot, XHCISlot), -VMSTATE_STRUCT_VARRAY_UINT32 (intr, XHCIState, numintrs,1 , +VMSTATE_STRUCT_VARRAY_UINT32 (intr, XHCIState, numintrs, vmstate_xhci_intr, XHCIInterrupter),/* Operational Registers */
include/migration/vmstate.h +1 -2
@@ -371,10 +371,9 @@ extern const VMStateInfo vmstate_info_bitmap; .offset = offsetof(_state, _field), \ } -#define VMSTATE_STRUCT_VARRAY_UINT32 (_field, _state, _field_num, _version, _vmsd, _type) { \ +#define VMSTATE_STRUCT_VARRAY_UINT32 (_field, _state, _field_num, _vmsd, _type) { \ .name = (stringify(_field)), \ .num_offset = vmstate_offset_value(_state, _field_num, uint32_t), \ - .version_id = (_version), \ .vmsd = &(_vmsd), \ .size = sizeof(_type), \ .flags = VMS_STRUCT|VMS_VARRAY_UINT32, \
Signature · 1 line
1.9.0
PATCH 67/97 vmstate: Move all users of versioning of VMSTATE_STRUCT_ARRAY to _TEST
In reply to Juan Quintela--- hw/char/escc.c | 4 ++-- hw/ide/internal.h | 3 ++- hw/timer/i8254_common.c | 5 +++-- target-i386/machine.c | 15 +++++++++------ 4 files changed, 16 insertions(+), 11 deletions(-)
hw/char/escc.c +2 -2
@@ -678,8 +678,8 @@ static const VMStateDescription vmstate_escc = { .version_id = 2, .minimum_version_id = 1, .fields = (VMStateField []) { -VMSTATE_STRUCT_ARRAY (chn, ESCCState,2 ,2 , vmstate_escc_chn, - ChannelState), +VMSTATE_STRUCT_ARRAY_TEST (chn, ESCCState,2 , vmstate_2_plus,0 , + vmstate_escc_chn, ChannelState),VMSTATE_END_OF_LIST () } };
hw/ide/internal.h +2 -1
@@ -526,7 +526,8 @@ extern const VMStateDescription vmstate_ide_bus;extern const VMStateDescription vmstate_ide_drive;#define VMSTATE_IDE_DRIVES (_field, _state) \ - VMSTATE_STRUCT_ARRAY(_field, _state, 2, 3, vmstate_ide_drive, IDEState) + VMSTATE_STRUCT_ARRAY_TEST(_field, _state, 2, vmstate_3_plus, 0,\ + vmstate_ide_drive, IDEState)void ide_bus_reset (IDEBus *bus);int64_t ide_get_sector (IDEState *s);
hw/timer/i8254_common.c +3 -2
@@ -268,8 +268,9 @@ static const VMStateDescription vmstate_pit_common = { .fields = (VMStateField[]) {VMSTATE_UINT32_TEST (channels[0 ].irq_disabled, PITCommonState, vmstate_3_plus), -VMSTATE_STRUCT_ARRAY (channels, PITCommonState,3 ,2 , - vmstate_pit_channel, PITChannelState), +VMSTATE_STRUCT_ARRAY_TEST (channels, PITCommonState,3 , + vmstate_2_plus,0 , vmstate_pit_channel, + PITChannelState),VMSTATE_INT64 (channels[0 ].next_transition_time, PITCommonState),/* formerly irq_timer */ VMSTATE_END_OF_LIST ()
target-i386/machine.c +9 -6
@@ -57,8 +57,9 @@ static const VMStateDescription vmstate_ymmh_reg = { } }; -#define VMSTATE_YMMH_REGS_VARS (_field, _state, _n, _v) \ - VMSTATE_STRUCT_ARRAY(_field, _state, _n, _v, vmstate_ymmh_reg, XMMReg) +#define VMSTATE_YMMH_REGS_VARS (_field, _state, _n, _t) \ + VMSTATE_STRUCT_ARRAY_TEST(_field, _state, _n, _t, 0,\ + vmstate_ymmh_reg, XMMReg)static const VMStateDescription vmstate_bnd_regs = { .name ="bnd_regs" ,
@@ -85,8 +86,9 @@ static const VMStateDescription vmstate_mtrr_var = { } }; -#define VMSTATE_MTRR_VARS (_field, _state, _n, _v) \ - VMSTATE_STRUCT_ARRAY(_field, _state, _n, _v, vmstate_mtrr_var, MTRRVar) +#define VMSTATE_MTRR_VARS (_field, _state, _n, _t) \ + VMSTATE_STRUCT_ARRAY_TEST(_field, _state, _n, _t, 0,\ + vmstate_mtrr_var, MTRRVar)static void put_fpreg_error (QEMUFile *f,void *opaque,size_t size) {
@@ -669,7 +671,7 @@ const VMStateDescription vmstate_x86_cpu = {/* MTRRs */ VMSTATE_UINT64_ARRAY_TEST (env.mtrr_fixed,X86CPU ,11 , vmstate_8_plus),VMSTATE_UINT64_TEST (env.mtrr_deftype,X86CPU , vmstate_8_plus), -VMSTATE_MTRR_VARS (env.mtrr_var,X86CPU ,8 ,8 ), +VMSTATE_MTRR_VARS (env.mtrr_var,X86CPU ,8 , vmstate_8_plus),/* KVM-related states */ VMSTATE_INT32_TEST (env.interrupt_injected,X86CPU , vmstate_9_plus), VMSTATE_UINT32_TEST(env.mp_state, X86CPU, vmstate_9_plus),
@@ -694,7 +696,8 @@ const VMStateDescription vmstate_x86_cpu = {/* XSAVE related fields */ VMSTATE_UINT64_TEST (env.xcr0,X86CPU , vmstate_12_plus),VMSTATE_UINT64_TEST (env.xstate_bv,X86CPU , vmstate_12_plus), -VMSTATE_YMMH_REGS_VARS (env.ymmh_regs,X86CPU ,CPU_NB_REGS ,12 ), +VMSTATE_YMMH_REGS_VARS (env.ymmh_regs,X86CPU ,CPU_NB_REGS , + vmstate_12_plus),VMSTATE_END_OF_LIST ()/* The above list is not sorted /wrt version numbers, watch out! */ },
Signature · 1 line
1.9.0
PATCH 68/97 vmstate: Remove version paramenter from VMSTATE_STRUCT_ARRAY
In reply to Juan QuintelaNo users of that field left.
--- hw/arm/musicpal.c | 2 +- hw/audio/ac97.c | 2 +- hw/audio/es1370.c | 2 +- hw/audio/hda-codec.c | 3 +-- hw/audio/intel-hda.c | 3 +-- hw/block/fdc.c | 2 +- hw/char/ipoctal232.c | 4 ++-- hw/char/serial-pci.c | 2 +- hw/display/exynos4210_fimd.c | 2 +- hw/display/pxa2xx_lcd.c | 2 +- hw/display/qxl.c | 2 +- hw/dma/i8257.c | 2 +- hw/dma/pl080.c | 2 +- hw/ide/internal.h | 2 +- hw/ide/pci.c | 3 +-- hw/input/hid.c | 2 +- hw/intc/arm_gic_common.c | 2 +- hw/intc/exynos4210_combiner.c | 2 +- hw/intc/heathrow_pic.c | 2 +- hw/intc/slavio_intctl.c | 2 +- hw/misc/macio/cuda.c | 2 +- hw/misc/macio/mac_dbdma.c | 2 +- hw/net/allwinner_emac.c | 2 +- hw/pci-host/ppce500.c | 4 ++-- hw/ppc/ppc4xx_pci.c | 10 ++++------ hw/ppc/spapr_pci.c | 4 ++-- hw/timer/cadence_ttc.c | 3 +-- hw/timer/exynos4210_mct.c | 2 +- hw/timer/exynos4210_pwm.c | 4 ++-- hw/timer/pxa2xx_timer.c | 4 ++-- hw/timer/slavio_timer.c | 2 +- hw/usb/dev-hub.c | 2 +- hw/usb/dev-smartcard-reader.c | 4 ++-- hw/usb/hcd-uhci.c | 2 +- hw/usb/redirect.c | 2 +- include/migration/vmstate.h | 5 ++--- target-i386/machine.c | 6 +++--- 37 files changed, 49 insertions(+), 56 deletions(-)
hw/arm/musicpal.c +1 -1
@@ -949,7 +949,7 @@ static const VMStateDescription mv88w8618_pit_vmsd = { .version_id = 1, .minimum_version_id =1 , .fields = (VMStateField[]) { -VMSTATE_STRUCT_ARRAY (timer, mv88w8618_pit_state,4 ,1 , +VMSTATE_STRUCT_ARRAY (timer, mv88w8618_pit_state,4 , mv88w8618_timer_vmsd, mv88w8618_timer_state),VMSTATE_END_OF_LIST () }
hw/audio/ac97.c +1 -1
@@ -1216,7 +1216,7 @@ static const VMStateDescription vmstate_ac97 = {VMSTATE_UINT32 (glob_cnt, AC97LinkState),VMSTATE_UINT32 (glob_sta, AC97LinkState),VMSTATE_UINT32 (cas, AC97LinkState), -VMSTATE_STRUCT_ARRAY (bm_regs, AC97LinkState,3 ,1 , +VMSTATE_STRUCT_ARRAY (bm_regs, AC97LinkState,3 , vmstate_ac97_bm_regs, AC97BusMasterRegs),VMSTATE_BUFFER (mixer_data, AC97LinkState), VMSTATE_UNUSED_TEST (is_version_2, 3),
hw/audio/es1370.c +1 -1
@@ -999,7 +999,7 @@ static const VMStateDescription vmstate_es1370 = { .post_load = es1370_post_load, .fields = (VMStateField []) {VMSTATE_PCI_DEVICE (dev, ES1370State), -VMSTATE_STRUCT_ARRAY (chan, ES1370State,NB_CHANNELS ,2 , +VMSTATE_STRUCT_ARRAY (chan, ES1370State,NB_CHANNELS , vmstate_es1370_channel, struct chan),VMSTATE_UINT32 (ctl, ES1370State),VMSTATE_UINT32 (status, ES1370State),
hw/audio/hda-codec.c +1 -2
@@ -599,8 +599,7 @@ static const VMStateDescription vmstate_hda_audio = { .version_id = 2, .post_load = hda_audio_post_load, .fields = (VMStateField []) { -VMSTATE_STRUCT_ARRAY (st, HDAAudioState,4 ,0 , - vmstate_hda_audio_stream, +VMSTATE_STRUCT_ARRAY (st, HDAAudioState,4 , vmstate_hda_audio_stream, HDAAudioStream),VMSTATE_BOOL_ARRAY (running_compat, HDAAudioState,16 ), VMSTATE_BOOL_ARRAY_TEST(running_real, HDAAudioState, 2 * 16,
hw/audio/intel-hda.c +1 -2
@@ -1220,8 +1220,7 @@ static const VMStateDescription vmstate_intel_hda = {VMSTATE_UINT32 (icw, IntelHDAState),VMSTATE_UINT32 (irr, IntelHDAState),VMSTATE_UINT32 (ics, IntelHDAState), -VMSTATE_STRUCT_ARRAY (st, IntelHDAState,8 ,0 , - vmstate_intel_hda_stream, +VMSTATE_STRUCT_ARRAY (st, IntelHDAState,8 , vmstate_intel_hda_stream, IntelHDAStream),/* additional state info */
hw/block/fdc.c +1 -1
@@ -767,7 +767,7 @@ static const VMStateDescription vmstate_fdc = {VMSTATE_UINT8 (lock, FDCtrl),VMSTATE_UINT8 (pwrd, FDCtrl),VMSTATE_UINT8_EQUAL (num_floppies, FDCtrl), -VMSTATE_STRUCT_ARRAY (drives, FDCtrl,MAX_FD ,1 , +VMSTATE_STRUCT_ARRAY (drives, FDCtrl,MAX_FD , vmstate_fdrive, FDrive), VMSTATE_END_OF_LIST() }
hw/char/ipoctal232.c +2 -2
@@ -153,9 +153,9 @@ static const VMStateDescription vmstate_ipoctal = { .minimum_version_id = 1, .fields = (VMStateField []) {VMSTATE_IPACK_DEVICE (parent_obj, IPOctalState), -VMSTATE_STRUCT_ARRAY (ch, IPOctalState,N_CHANNELS ,1 , +VMSTATE_STRUCT_ARRAY (ch, IPOctalState,N_CHANNELS , vmstate_scc2698_channel, SCC2698Channel), -VMSTATE_STRUCT_ARRAY (blk, IPOctalState,N_BLOCKS ,1 , +VMSTATE_STRUCT_ARRAY (blk, IPOctalState,N_BLOCKS , vmstate_scc2698_block, SCC2698Block),VMSTATE_UINT8 (irq_vector, IPOctalState),VMSTATE_END_OF_LIST ()
hw/char/serial-pci.c +1 -1
@@ -169,7 +169,7 @@ static const VMStateDescription vmstate_pci_multi_serial = { .fields = (VMStateField[]) {VMSTATE_PCI_DEVICE (dev, PCIMultiSerialState),VMSTATE_STRUCT_ARRAY (state, PCIMultiSerialState,PCI_SERIAL_MAX_PORTS , -0 , vmstate_serial, SerialState), + vmstate_serial, SerialState),VMSTATE_UINT32_ARRAY (level, PCIMultiSerialState,PCI_SERIAL_MAX_PORTS ),VMSTATE_END_OF_LIST () }
hw/display/exynos4210_fimd.c +1 -1
@@ -1893,7 +1893,7 @@ static const VMStateDescription exynos4210_fimd_vmstate = {VMSTATE_UINT32 (hueoffset, Exynos4210fimdState),VMSTATE_UINT32_ARRAY (i80ifcmd, Exynos4210fimdState,12 ),VMSTATE_UINT32 (blendcon, Exynos4210fimdState), -VMSTATE_STRUCT_ARRAY (window, Exynos4210fimdState,5 ,1 , +VMSTATE_STRUCT_ARRAY (window, Exynos4210fimdState,5 , exynos4210_fimd_window_vmstate, Exynos4210fimdWindow), VMSTATE_END_OF_LIST() }
hw/display/pxa2xx_lcd.c +1 -1
@@ -972,7 +972,7 @@ static const VMStateDescription vmstate_pxa2xx_lcdc = {VMSTATE_UINT32 (tcr, PXA2xxLCDState),VMSTATE_UINT32 (liidr, PXA2xxLCDState),VMSTATE_UINT8 (bscntr, PXA2xxLCDState), -VMSTATE_STRUCT_ARRAY (dma_ch, PXA2xxLCDState,7 ,0 , +VMSTATE_STRUCT_ARRAY (dma_ch, PXA2xxLCDState,7 , vmstate_dma_channel, struct DMAChannel), VMSTATE_END_OF_LIST() }
hw/display/qxl.c +1 -1
@@ -2265,7 +2265,7 @@ static VMStateDescription qxl_vmstate = {VMSTATE_UINT32 (mode, PCIQXLDevice),VMSTATE_UINT32 (ssd.unique, PCIQXLDevice),VMSTATE_INT32_EQUAL (num_memslots, PCIQXLDevice), -VMSTATE_STRUCT_ARRAY (guest_slots, PCIQXLDevice,NUM_MEMSLOTS ,0 , +VMSTATE_STRUCT_ARRAY (guest_slots, PCIQXLDevice,NUM_MEMSLOTS , qxl_memslot, struct guest_slots),VMSTATE_STRUCT (guest_primary.surface, PCIQXLDevice,0 , qxl_surface, QXLSurfaceCreate),
hw/dma/i8257.c +1 -1
@@ -580,7 +580,7 @@ static const VMStateDescription vmstate_dma = { VMSTATE_UINT8(mask, struct dma_cont), VMSTATE_UINT8(flip_flop, struct dma_cont), VMSTATE_INT32(dshift, struct dma_cont), - VMSTATE_STRUCT_ARRAY(regs, struct dma_cont, 4, 1, vmstate_dma_regs, struct dma_regs), + VMSTATE_STRUCT_ARRAY(regs, struct dma_cont, 4, vmstate_dma_regs, struct dma_regs), VMSTATE_END_OF_LIST() } };
hw/dma/pl080.c +1 -1
@@ -89,7 +89,7 @@ static const VMStateDescription vmstate_pl080 = {VMSTATE_UINT8 (tc_int, PL080State),VMSTATE_UINT8 (tc_int, PL080State),VMSTATE_STRUCT_ARRAY (chan, PL080State,PL080_MAX_CHANNELS , -1 , vmstate_pl080_channel, pl080_channel), + vmstate_pl080_channel, pl080_channel),VMSTATE_INT32 (running, PL080State), VMSTATE_END_OF_LIST() }
hw/ide/internal.h +1 -1
@@ -521,7 +521,7 @@ extern const VMStateDescription vmstate_ide_bus; VMSTATE_STRUCT(_field, _state, 1, vmstate_ide_bus, IDEBus)#define VMSTATE_IDE_BUS_ARRAY (_field, _state, _num) \ - VMSTATE_STRUCT_ARRAY(_field, _state, _num, 1, vmstate_ide_bus, IDEBus) + VMSTATE_STRUCT_ARRAY(_field, _state, _num, vmstate_ide_bus, IDEBus)extern const VMStateDescription vmstate_ide_drive;
hw/ide/pci.c +1 -2
@@ -479,8 +479,7 @@ const VMStateDescription vmstate_ide_pci = { .post_load = ide_pci_post_load, .fields = (VMStateField []) {VMSTATE_PCI_DEVICE (parent_obj, PCIIDEState), -VMSTATE_STRUCT_ARRAY (bmdma, PCIIDEState,2 ,0 , - vmstate_bmdma, BMDMAState), +VMSTATE_STRUCT_ARRAY (bmdma, PCIIDEState,2 , vmstate_bmdma, BMDMAState),VMSTATE_IDE_BUS_ARRAY (bus, PCIIDEState,2 ),VMSTATE_IDE_DRIVES (bus[0 ].ifs, PCIIDEState),VMSTATE_IDE_DRIVES (bus[1 ].ifs, PCIIDEState),
hw/input/hid.c +1 -1
@@ -468,7 +468,7 @@ const VMStateDescription vmstate_hid_ptr_device = { .minimum_version_id = 1, .post_load = hid_post_load, .fields = (VMStateField []) { -VMSTATE_STRUCT_ARRAY (ptr.queue, HIDState,QUEUE_LENGTH ,0 , +VMSTATE_STRUCT_ARRAY (ptr.queue, HIDState,QUEUE_LENGTH , vmstate_hid_ptr_queue, HIDPointerEvent),VMSTATE_UINT32 (head, HIDState),VMSTATE_UINT32 (n, HIDState),
hw/intc/arm_gic_common.c +1 -1
@@ -65,7 +65,7 @@ static const VMStateDescription vmstate_gic = { .fields = (VMStateField[]) {VMSTATE_BOOL (enabled, GICState),VMSTATE_BOOL_ARRAY (cpu_enabled, GICState,GIC_NCPU ), -VMSTATE_STRUCT_ARRAY (irq_state, GICState,GIC_MAXIRQ ,1 , +VMSTATE_STRUCT_ARRAY (irq_state, GICState,GIC_MAXIRQ , vmstate_gic_irq_state, gic_irq_state),VMSTATE_UINT8_ARRAY (irq_target, GICState,GIC_MAXIRQ ),VMSTATE_UINT8_2DARRAY (priority1, GICState,GIC_INTERNAL ,GIC_NCPU ),
hw/intc/exynos4210_combiner.c +1 -1
@@ -89,7 +89,7 @@ static const VMStateDescription vmstate_exynos4210_combiner = { .version_id = 1, .minimum_version_id = 1, .fields = (VMStateField []) { -VMSTATE_STRUCT_ARRAY (group, Exynos4210CombinerState,IIC_NGRP ,0 , +VMSTATE_STRUCT_ARRAY (group, Exynos4210CombinerState,IIC_NGRP , vmstate_exynos4210_combiner_group_state, CombinerGroupState),VMSTATE_UINT32_ARRAY (reg_set, Exynos4210CombinerState,IIC_REGSET_SIZE ),
hw/intc/heathrow_pic.c +1 -1
@@ -173,7 +173,7 @@ static const VMStateDescription vmstate_heathrow_pic = { .version_id = 1, .minimum_version_id =1 , .fields = (VMStateField[]) { -VMSTATE_STRUCT_ARRAY (pics, HeathrowPICS,2 ,1 , +VMSTATE_STRUCT_ARRAY (pics, HeathrowPICS,2 , vmstate_heathrow_pic_one, HeathrowPIC),VMSTATE_END_OF_LIST () }
hw/intc/slavio_intctl.c +1 -1
@@ -393,7 +393,7 @@ static const VMStateDescription vmstate_intctl = { .minimum_version_id = 1, .post_load = vmstate_intctl_post_load, .fields = (VMStateField []) { -VMSTATE_STRUCT_ARRAY (slaves, SLAVIO_INTCTLState,MAX_CPUS ,1 , +VMSTATE_STRUCT_ARRAY (slaves, SLAVIO_INTCTLState,MAX_CPUS , vmstate_intctl_cpu, SLAVIO_CPUINTCTLState),VMSTATE_UINT32 (intregm_pending, SLAVIO_INTCTLState),VMSTATE_UINT32 (intregm_disabled, SLAVIO_INTCTLState),
hw/misc/macio/cuda.c +1 -1
@@ -649,7 +649,7 @@ static const VMStateDescription vmstate_cuda = {VMSTATE_BUFFER (data_in, CUDAState),VMSTATE_BUFFER (data_out, CUDAState),VMSTATE_UINT32 (tick_offset, CUDAState), -VMSTATE_STRUCT_ARRAY (timers, CUDAState,2 ,1 , +VMSTATE_STRUCT_ARRAY (timers, CUDAState,2 , vmstate_cuda_timer, CUDATimer), VMSTATE_END_OF_LIST() }
hw/misc/macio/mac_dbdma.c +1 -1
@@ -730,7 +730,7 @@ static const VMStateDescription vmstate_dbdma = { .version_id = 2, .minimum_version_id =2 , .fields = (VMStateField[]) { -VMSTATE_STRUCT_ARRAY (channels, DBDMAState,DBDMA_CHANNELS ,1 , +VMSTATE_STRUCT_ARRAY (channels, DBDMAState,DBDMA_CHANNELS , vmstate_dbdma_channel, DBDMA_channel),VMSTATE_END_OF_LIST () }
hw/net/allwinner_emac.c +1 -1
@@ -505,7 +505,7 @@ static const VMStateDescription vmstate_aw_emac = {VMSTATE_UINT32 (rx_num_packets, AwEmacState),VMSTATE_UINT32 (rx_packet_size, AwEmacState),VMSTATE_UINT32 (rx_packet_pos, AwEmacState), -VMSTATE_STRUCT_ARRAY (tx_fifo, AwEmacState,NUM_TX_FIFOS ,1 , +VMSTATE_STRUCT_ARRAY (tx_fifo, AwEmacState,NUM_TX_FIFOS , vmstate_fifo8, Fifo8),VMSTATE_UINT32_ARRAY (tx_length, AwEmacState,NUM_TX_FIFOS ), VMSTATE_UINT32(tx_channel, AwEmacState),
hw/pci-host/ppce500.c +2 -2
@@ -305,9 +305,9 @@ static const VMStateDescription vmstate_ppce500_pci = { .version_id = 1, .minimum_version_id = 1, .fields = (VMStateField []) { -VMSTATE_STRUCT_ARRAY (pob, PPCE500PCIState,PPCE500_PCI_NR_POBS ,1 , +VMSTATE_STRUCT_ARRAY (pob, PPCE500PCIState,PPCE500_PCI_NR_POBS , vmstate_pci_outbound, struct pci_outbound), -VMSTATE_STRUCT_ARRAY (pib, PPCE500PCIState,PPCE500_PCI_NR_PIBS ,1 , +VMSTATE_STRUCT_ARRAY (pib, PPCE500PCIState,PPCE500_PCI_NR_PIBS , vmstate_pci_outbound, struct pci_inbound),VMSTATE_UINT32 (gasket_time, PPCE500PCIState),VMSTATE_END_OF_LIST ()
hw/ppc/ppc4xx_pci.c +4 -6
@@ -319,12 +319,10 @@ static const VMStateDescription vmstate_ppc4xx_pci = { .version_id = 1, .minimum_version_id = 1, .fields = (VMStateField []) { -VMSTATE_STRUCT_ARRAY (pmm, PPC4xxPCIState, PPC4xx_PCI_NR_PMMS,1 , - vmstate_pci_master_map, - struct PCIMasterMap), -VMSTATE_STRUCT_ARRAY (ptm, PPC4xxPCIState, PPC4xx_PCI_NR_PTMS,1 , - vmstate_pci_target_map, - struct PCITargetMap), +VMSTATE_STRUCT_ARRAY (pmm, PPC4xxPCIState, PPC4xx_PCI_NR_PMMS, + vmstate_pci_master_map, struct PCIMasterMap), +VMSTATE_STRUCT_ARRAY (ptm, PPC4xxPCIState, PPC4xx_PCI_NR_PTMS, + vmstate_pci_target_map, struct PCITargetMap),VMSTATE_END_OF_LIST () } };
hw/ppc/spapr_pci.c +2 -2
@@ -690,9 +690,9 @@ static const VMStateDescription vmstate_spapr_pci = {VMSTATE_UINT64_EQUAL (mem_win_size, sPAPRPHBState),VMSTATE_UINT64_EQUAL (io_win_addr, sPAPRPHBState),VMSTATE_UINT64_EQUAL (io_win_size, sPAPRPHBState), -VMSTATE_STRUCT_ARRAY (lsi_table, sPAPRPHBState,PCI_NUM_PINS ,0 , +VMSTATE_STRUCT_ARRAY (lsi_table, sPAPRPHBState,PCI_NUM_PINS , vmstate_spapr_pci_lsi, struct spapr_pci_lsi), -VMSTATE_STRUCT_ARRAY (msi_table, sPAPRPHBState,SPAPR_MSIX_MAX_DEVS ,0 , +VMSTATE_STRUCT_ARRAY (msi_table, sPAPRPHBState,SPAPR_MSIX_MAX_DEVS , vmstate_spapr_pci_msi, struct spapr_pci_msi),VMSTATE_END_OF_LIST ()
hw/timer/cadence_ttc.c +1 -2
@@ -462,8 +462,7 @@ static const VMStateDescription vmstate_cadence_ttc = { .version_id = 1, .minimum_version_id =1 , .fields = (VMStateField[]) { -VMSTATE_STRUCT_ARRAY (timer, CadenceTTCState,3 ,0 , - vmstate_cadence_timer, +VMSTATE_STRUCT_ARRAY (timer, CadenceTTCState,3 , vmstate_cadence_timer, CadenceTimerState),VMSTATE_END_OF_LIST () }
hw/timer/exynos4210_mct.c +1 -1
@@ -348,7 +348,7 @@ static const VMStateDescription vmstate_exynos4210_mct_state = { .minimum_version_id = 1, .fields = (VMStateField []) {VMSTATE_UINT32 (reg_mct_cfg, Exynos4210MCTState), -VMSTATE_STRUCT_ARRAY (l_timer, Exynos4210MCTState,2 ,0 , +VMSTATE_STRUCT_ARRAY (l_timer, Exynos4210MCTState,2 , vmstate_exynos4210_mct_lt, Exynos4210MCTLT),VMSTATE_STRUCT (g_timer, Exynos4210MCTState,0 , vmstate_exynos4210_mct_gt, Exynos4210MCTGT),
hw/timer/exynos4210_pwm.c +2 -2
@@ -139,8 +139,8 @@ static const VMStateDescription vmstate_exynos4210_pwm_state = {VMSTATE_UINT32 (reg_tcon, Exynos4210PWMState),VMSTATE_UINT32 (reg_tint_cstat, Exynos4210PWMState),VMSTATE_STRUCT_ARRAY (timer, Exynos4210PWMState, -EXYNOS4210_PWM_TIMERS_NUM ,0 , - vmstate_exynos4210_pwm, Exynos4210PWM), +EXYNOS4210_PWM_TIMERS_NUM , + vmstate_exynos4210_pwm, Exynos4210PWM), VMSTATE_END_OF_LIST() } };
hw/timer/pxa2xx_timer.c +2 -2
@@ -512,8 +512,8 @@ static const VMStateDescription vmstate_pxa2xx_timer_regs = {VMSTATE_INT32 (clock, PXA2xxTimerInfo),VMSTATE_INT32 (oldclock, PXA2xxTimerInfo),VMSTATE_UINT64 (lastload, PXA2xxTimerInfo), -VMSTATE_STRUCT_ARRAY (timer, PXA2xxTimerInfo,4 ,1 , - vmstate_pxa2xx_timer0_regs, PXA2xxTimer0), +VMSTATE_STRUCT_ARRAY (timer, PXA2xxTimerInfo,4 , + vmstate_pxa2xx_timer0_regs, PXA2xxTimer0),VMSTATE_UINT32 (events, PXA2xxTimerInfo),VMSTATE_UINT32 (irq_enabled, PXA2xxTimerInfo), VMSTATE_UINT32(reset3, PXA2xxTimerInfo),
hw/timer/slavio_timer.c +1 -1
@@ -345,7 +345,7 @@ static const VMStateDescription vmstate_slavio_timer = { .version_id = 3, .minimum_version_id =3 , .fields = (VMStateField[]) { -VMSTATE_STRUCT_ARRAY (cputimer, SLAVIO_TIMERState,MAX_CPUS +1 ,3 , +VMSTATE_STRUCT_ARRAY (cputimer, SLAVIO_TIMERState,MAX_CPUS +1 , vmstate_timer, CPUTimerState),VMSTATE_END_OF_LIST () }
hw/usb/dev-hub.c +1 -1
@@ -553,7 +553,7 @@ static const VMStateDescription vmstate_usb_hub = { .minimum_version_id = 1, .fields = (VMStateField []) {VMSTATE_USB_DEVICE (dev, USBHubState), -VMSTATE_STRUCT_ARRAY (ports, USBHubState,NUM_PORTS ,0 , +VMSTATE_STRUCT_ARRAY (ports, USBHubState,NUM_PORTS , vmstate_usb_hub_port, USBHubPort),VMSTATE_END_OF_LIST () }
hw/usb/dev-smartcard-reader.c +2 -2
@@ -1419,11 +1419,11 @@ static VMStateDescription ccid_vmstate = {VMSTATE_BUFFER (abProtocolDataStructure.data, USBCCIDState),VMSTATE_UINT32 (ulProtocolDataStructureSize, USBCCIDState),VMSTATE_STRUCT_ARRAY (bulk_in_pending, USBCCIDState, -BULK_IN_PENDING_NUM ,1 , bulk_in_vmstate, BulkIn), +BULK_IN_PENDING_NUM , bulk_in_vmstate, BulkIn),VMSTATE_UINT32 (bulk_in_pending_start, USBCCIDState),VMSTATE_UINT32 (bulk_in_pending_end, USBCCIDState),VMSTATE_STRUCT_ARRAY (pending_answers, USBCCIDState, -PENDING_ANSWERS_NUM ,1 , answer_vmstate, Answer), +PENDING_ANSWERS_NUM , answer_vmstate, Answer),VMSTATE_UINT32 (pending_answers_num, USBCCIDState),VMSTATE_UINT8 (migration_state, USBCCIDState), VMSTATE_UINT32(state_vmstate, USBCCIDState),
hw/usb/hcd-uhci.c +1 -1
@@ -447,7 +447,7 @@ static const VMStateDescription vmstate_uhci = { .fields = (VMStateField[]) {VMSTATE_PCI_DEVICE (dev, UHCIState),VMSTATE_UINT8_EQUAL (num_ports_vmstate, UHCIState), -VMSTATE_STRUCT_ARRAY (ports, UHCIState,NB_PORTS ,1 , +VMSTATE_STRUCT_ARRAY (ports, UHCIState,NB_PORTS , vmstate_uhci_port, UHCIPort),VMSTATE_UINT16 (cmd, UHCIState),VMSTATE_UINT16 (status, UHCIState),
hw/usb/redirect.c +1 -1
@@ -2321,7 +2321,7 @@ static const VMStateDescription usbredir_vmstate = { .flags = VMS_SINGLE, .offset =0 , }, -VMSTATE_STRUCT_ARRAY (endpoint, USBRedirDevice,MAX_ENDPOINTS ,1 , +VMSTATE_STRUCT_ARRAY (endpoint, USBRedirDevice,MAX_ENDPOINTS , usbredir_ep_vmstate, struct endp_data), VMSTATE_STRUCT(cancelled, USBRedirDevice, 1, usbredir_ep_packet_id_queue_vmstate,
include/migration/vmstate.h +2 -3
@@ -456,9 +456,8 @@ extern const VMStateInfo vmstate_info_bitmap;#define VMSTATE_STRUCT_POINTER (_field, _state, _vmsd, _type) \ VMSTATE_STRUCT_POINTER_TEST(_field, _state, NULL, _vmsd, _type) -#define VMSTATE_STRUCT_ARRAY (_field, _state, _num, _version, _vmsd, _type) \ - VMSTATE_STRUCT_ARRAY_TEST(_field, _state, _num, NULL, _version, \ - _vmsd, _type) +#define VMSTATE_STRUCT_ARRAY (_field, _state, _num, _vmsd, _type) \ + VMSTATE_STRUCT_ARRAY_TEST(_field, _state, _num, NULL, 0, _vmsd, _type)#define VMSTATE_BOOL_TEST (_f, _s, _t) \ VMSTATE_SINGLE(_f, _s, _t, vmstate_info_bool, bool)
target-i386/machine.c +3 -3
@@ -29,7 +29,7 @@ static const VMStateDescription vmstate_segment = { }#define VMSTATE_SEGMENT_ARRAY (_field, _state, _n) \ - VMSTATE_STRUCT_ARRAY(_field, _state, _n, 0, vmstate_segment, SegmentCache) + VMSTATE_STRUCT_ARRAY(_field, _state, _n, vmstate_segment, SegmentCache)static const VMStateDescription vmstate_xmm_reg = { .name ="xmm_reg" ,
@@ -43,7 +43,7 @@ static const VMStateDescription vmstate_xmm_reg = { };#define VMSTATE_XMM_REGS (_field, _state, _n) \ - VMSTATE_STRUCT_ARRAY(_field, _state, _n, 0, vmstate_xmm_reg, XMMReg) + VMSTATE_STRUCT_ARRAY(_field, _state, _n, vmstate_xmm_reg, XMMReg)/* YMMH format is the same as XMM */ static const VMStateDescription vmstate_ymmh_reg = {
@@ -73,7 +73,7 @@ static const VMStateDescription vmstate_bnd_regs = { };#define VMSTATE_BND_REGS (_field, _state, _n) \ - VMSTATE_STRUCT_ARRAY(_field, _state, _n, 0, vmstate_bnd_regs, BNDReg) + VMSTATE_STRUCT_ARRAY(_field, _state, _n, vmstate_bnd_regs, BNDReg)static const VMStateDescription vmstate_mtrr_var = { .name ="mtrr_var" ,
Signature · 1 line
1.9.0
PATCH 69/97 vmstate: Remove version parameter from VMSTATE_STRUCT_ARRAY_TEST
In reply to Juan QuintelaNo users left.
--- hw/char/escc.c | 2 +- hw/ide/internal.h | 2 +- hw/timer/i8254_common.c | 2 +- hw/timer/pxa2xx_timer.c | 2 +- hw/usb/hcd-xhci.c | 2 +- include/hw/acpi/pcihp.h | 2 +- include/migration/vmstate.h | 5 ++--- target-i386/machine.c | 6 ++---- 8 files changed, 10 insertions(+), 13 deletions(-)
hw/char/escc.c +1 -1
@@ -678,7 +678,7 @@ static const VMStateDescription vmstate_escc = { .version_id = 2, .minimum_version_id =1 , .fields = (VMStateField[]) { -VMSTATE_STRUCT_ARRAY_TEST (chn, ESCCState,2 , vmstate_2_plus,0 , +VMSTATE_STRUCT_ARRAY_TEST (chn, ESCCState,2 , vmstate_2_plus, vmstate_escc_chn, ChannelState),VMSTATE_END_OF_LIST () }
hw/ide/internal.h +1 -1
@@ -526,7 +526,7 @@ extern const VMStateDescription vmstate_ide_bus;extern const VMStateDescription vmstate_ide_drive;#define VMSTATE_IDE_DRIVES (_field, _state) \ - VMSTATE_STRUCT_ARRAY_TEST(_field, _state, 2, vmstate_3_plus, 0,\ + VMSTATE_STRUCT_ARRAY_TEST(_field, _state, 2, vmstate_3_plus,\ vmstate_ide_drive, IDEState)void ide_bus_reset (IDEBus *bus);
hw/timer/i8254_common.c +1 -1
@@ -269,7 +269,7 @@ static const VMStateDescription vmstate_pit_common = {VMSTATE_UINT32_TEST (channels[0 ].irq_disabled, PITCommonState, vmstate_3_plus),VMSTATE_STRUCT_ARRAY_TEST (channels, PITCommonState,3 , - vmstate_2_plus,0 , vmstate_pit_channel, + vmstate_2_plus, vmstate_pit_channel, PITChannelState),VMSTATE_INT64 (channels[0 ].next_transition_time, PITCommonState), /* formerly irq_timer */
hw/timer/pxa2xx_timer.c +1 -1
@@ -519,7 +519,7 @@ static const VMStateDescription vmstate_pxa2xx_timer_regs = {VMSTATE_UINT32 (reset3, PXA2xxTimerInfo),VMSTATE_UINT32 (snapshot, PXA2xxTimerInfo),VMSTATE_STRUCT_ARRAY_TEST (tm4, PXA2xxTimerInfo,8 , - pxa2xx_timer_has_tm4_test,0 , + pxa2xx_timer_has_tm4_test, vmstate_pxa2xx_timer4_regs, PXA2xxTimer4), VMSTATE_END_OF_LIST(), }
hw/usb/hcd-xhci.c +1 -1
@@ -3737,7 +3737,7 @@ static const VMStateDescription vmstate_xhci_intr = {VMSTATE_UINT32_TEST (ev_buffer_put, XHCIInterrupter, xhci_er_full),VMSTATE_UINT32_TEST (ev_buffer_get, XHCIInterrupter, xhci_er_full),VMSTATE_STRUCT_ARRAY_TEST (ev_buffer, XHCIInterrupter,EV_QUEUE , - xhci_er_full,1 , + xhci_er_full, vmstate_xhci_event, XHCIEvent),VMSTATE_END_OF_LIST ()
include/hw/acpi/pcihp.h +1 -1
@@ -68,7 +68,7 @@ extern const VMStateDescription vmstate_acpi_pcihp_pci_status; test_pcihp), \VMSTATE_STRUCT_ARRAY_TEST (pcihp.acpi_pcihp_pci_status, state, \ACPI_PCIHP_MAX_HOTPLUG_BUS , \ - test_pcihp,1 , \ + test_pcihp, \ vmstate_acpi_pcihp_pci_status, \ AcpiPciHpPciStatus)
include/migration/vmstate.h +2 -3
@@ -313,11 +313,10 @@ extern const VMStateInfo vmstate_info_bitmap; .offset = vmstate_offset_array(_s, _f, _type*, _n), \ } -#define VMSTATE_STRUCT_ARRAY_TEST (_field, _state, _num, _test, _version, _vmsd, _type) { \ +#define VMSTATE_STRUCT_ARRAY_TEST (_field, _state, _num, _test, _vmsd, _type) { \ .name = (stringify(_field)), \ .num = (_num), \ .field_exists = (_test), \ - .version_id = (_version), \ .vmsd = &(_vmsd), \ .size = sizeof(_type), \ .flags = VMS_STRUCT|VMS_ARRAY, \
@@ -457,7 +456,7 @@ extern const VMStateInfo vmstate_info_bitmap; VMSTATE_STRUCT_POINTER_TEST(_field, _state, NULL, _vmsd, _type)#define VMSTATE_STRUCT_ARRAY (_field, _state, _num, _vmsd, _type) \ - VMSTATE_STRUCT_ARRAY_TEST(_field, _state, _num, NULL, 0, _vmsd, _type) + VMSTATE_STRUCT_ARRAY_TEST(_field, _state, _num, NULL, _vmsd, _type)#define VMSTATE_BOOL_TEST (_f, _s, _t) \ VMSTATE_SINGLE(_f, _s, _t, vmstate_info_bool, bool)
target-i386/machine.c +2 -4
@@ -58,8 +58,7 @@ static const VMStateDescription vmstate_ymmh_reg = { };#define VMSTATE_YMMH_REGS_VARS (_field, _state, _n, _t) \ - VMSTATE_STRUCT_ARRAY_TEST(_field, _state, _n, _t, 0,\ - vmstate_ymmh_reg, XMMReg) + VMSTATE_STRUCT_ARRAY_TEST(_field, _state, _n, _t, vmstate_ymmh_reg, XMMReg)static const VMStateDescription vmstate_bnd_regs = { .name ="bnd_regs" ,
@@ -87,8 +86,7 @@ static const VMStateDescription vmstate_mtrr_var = { };#define VMSTATE_MTRR_VARS (_field, _state, _n, _t) \ - VMSTATE_STRUCT_ARRAY_TEST(_field, _state, _n, _t, 0,\ - vmstate_mtrr_var, MTRRVar) + VMSTATE_STRUCT_ARRAY_TEST(_field, _state, _n, _t, vmstate_mtrr_var, MTRRVar)static void put_fpreg_error (QEMUFile *f,void *opaque,size_t size) {
Signature · 1 line
1.9.0
PATCH 70/97 vmstate: Remove unused version parameter from VMSTATE_STRUCT_VARRAY_INT32
In reply to Juan Quintela--- hw/input/stellaris_input.c | 2 +- include/migration/vmstate.h | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-)
hw/input/stellaris_input.c +1 -1
@@ -63,7 +63,7 @@ static const VMStateDescription vmstate_stellaris_gamepad = { .minimum_version_id = 1, .fields = (VMStateField []) {VMSTATE_INT32 (extension, gamepad_state), -VMSTATE_STRUCT_VARRAY_INT32 (buttons, gamepad_state, num_buttons,0 , +VMSTATE_STRUCT_VARRAY_INT32 (buttons, gamepad_state, num_buttons, vmstate_stellaris_button, gamepad_button),VMSTATE_END_OF_LIST () }
include/migration/vmstate.h +1 -2
@@ -360,10 +360,9 @@ extern const VMStateInfo vmstate_info_bitmap; .offset = vmstate_offset_pointer(_state, _field, _type), \ } -#define VMSTATE_STRUCT_VARRAY_INT32 (_field, _state, _field_num, _version, _vmsd, _type) { \ +#define VMSTATE_STRUCT_VARRAY_INT32 (_field, _state, _field_num, _vmsd, _type) { \ .name = (stringify(_field)), \ .num_offset = vmstate_offset_value(_state, _field_num, int32_t), \ - .version_id = (_version), \ .vmsd = &(_vmsd), \ .size = sizeof(_type), \ .flags = VMS_STRUCT|VMS_VARRAY_INT32, \
Signature · 1 line
1.9.0
PATCH 71/97 vmstate: Remove unused version parameter from VMSTATE_STRUCT_VARRAY_UINT8
In reply to Juan Quintela--- hw/timer/hpet.c | 2 +- include/migration/vmstate.h | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-)
hw/timer/hpet.c +1 -1
@@ -304,7 +304,7 @@ static const VMStateDescription vmstate_hpet = {VMSTATE_UINT64 (isr, HPETState),VMSTATE_UINT64 (hpet_counter, HPETState),VMSTATE_UINT8_TEST (num_timers, HPETState, vmstate_2_plus), -VMSTATE_STRUCT_VARRAY_UINT8 (timer, HPETState, num_timers,0 , +VMSTATE_STRUCT_VARRAY_UINT8 (timer, HPETState, num_timers, vmstate_hpet_timer, HPETTimer),VMSTATE_END_OF_LIST () },
include/migration/vmstate.h +1 -2
@@ -323,10 +323,9 @@ extern const VMStateInfo vmstate_info_bitmap; .offset = vmstate_offset_array(_state, _field, _type, _num),\ } -#define VMSTATE_STRUCT_VARRAY_UINT8 (_field, _state, _field_num, _version, _vmsd, _type) { \ +#define VMSTATE_STRUCT_VARRAY_UINT8 (_field, _state, _field_num, _vmsd, _type) { \ .name = (stringify(_field)), \ .num_offset = vmstate_offset_value(_state, _field_num, uint8_t), \ - .version_id = (_version), \ .vmsd = &(_vmsd), \ .size = sizeof(_type), \ .flags = VMS_STRUCT|VMS_VARRAY_UINT8, \
Signature · 1 line
1.9.0
PATCH 72/97 vmstate: Introduce VMSTATE_VARRAY_UINT32_TEST
In reply to Juan QuintelaUse it on the only case were a version was used.
--- hw/misc/arm_sysctl.c | 5 +++-- include/migration/vmstate.h | 7 +++++-- 2 files changed, 8 insertions(+), 4 deletions(-)
hw/misc/arm_sysctl.c +3 -2
@@ -67,8 +67,9 @@ static const VMStateDescription vmstate_arm_sysctl = {VMSTATE_UINT32_TEST (sys_clcd, arm_sysctl_state, vmstate_3_plus),VMSTATE_UINT32_ARRAY_TEST (mb_clock, arm_sysctl_state,6 , vmstate_4_plus), -VMSTATE_VARRAY_UINT32 (db_clock, arm_sysctl_state, db_num_clocks, -4 , vmstate_info_uint32, uint32_t), +VMSTATE_VARRAY_UINT32_TEST (db_clock, arm_sysctl_state, db_num_clocks, + vmstate_4_plus, vmstate_info_uint32, + uint32_t), VMSTATE_END_OF_LIST() } };
include/migration/vmstate.h +5 -2
@@ -257,9 +257,9 @@ extern const VMStateInfo vmstate_info_bitmap; .offset = vmstate_offset_pointer(_state, _field, _type), \ } -#define VMSTATE_VARRAY_UINT32 (_field, _state, _field_num, _version, _info, _type) {\ +#define VMSTATE_VARRAY_UINT32_TEST (_field, _state, _field_num, _test, _info, _type) {\ .name = (stringify(_field)), \ - .version_id = (_version), \ + .field_exists = (_test), \ .num_offset = vmstate_offset_value(_state, _field_num, uint32_t),\ .info = &(_info), \ .size = sizeof(_type), \
@@ -611,6 +611,9 @@ extern const VMStateInfo vmstate_info_bitmap;#define VMSTATE_UNUSED (_size) \ VMSTATE_UNUSED_TEST(NULL, _size) +#define VMSTATE_VARRAY_UINT32 (_field, _state, _field_num, _version, _info, _type) \ + VMSTATE_VARRAY_UINT32_TEST(_field, _state, _field_num, NULL, _info, _type) +#define VMSTATE_END_OF_LIST () \ {}
Signature · 1 line
1.9.0
PATCH 73/97 vmstate: Remove version parameter from VMSTATE_VARRAY_UINT32
In reply to Juan Quintela--- hw/nvram/ds1225y.c | 2 +- hw/ppc/spapr_iommu.c | 3 ++- include/migration/vmstate.h | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-)
hw/nvram/ds1225y.c +1 -1
@@ -97,7 +97,7 @@ static const VMStateDescription vmstate_nvram = { .minimum_version_id = 0, .post_load = nvram_post_load, .fields = (VMStateField[]) { -VMSTATE_VARRAY_UINT32 (contents, NvRamState, chip_size,0 , +VMSTATE_VARRAY_UINT32 (contents, NvRamState, chip_size, vmstate_info_uint8, uint8_t),VMSTATE_END_OF_LIST () }
hw/ppc/spapr_iommu.c +2 -1
@@ -105,7 +105,8 @@ static const VMStateDescription vmstate_spapr_tce_table = {/* IOMMU state */ VMSTATE_BOOL (bypass, sPAPRTCETable), -VMSTATE_VARRAY_UINT32 (table, sPAPRTCETable, nb_table,0 , vmstate_info_uint64, uint64_t), +VMSTATE_VARRAY_UINT32 (table, sPAPRTCETable, nb_table, + vmstate_info_uint64, uint64_t),VMSTATE_END_OF_LIST () },
include/migration/vmstate.h +1 -1
@@ -611,7 +611,7 @@ extern const VMStateInfo vmstate_info_bitmap;#define VMSTATE_UNUSED (_size) \ VMSTATE_UNUSED_TEST(NULL, _size) -#define VMSTATE_VARRAY_UINT32 (_field, _state, _field_num, _version, _info, _type) \ +#define VMSTATE_VARRAY_UINT32 (_field, _state, _field_num, _info, _type) \ VMSTATE_VARRAY_UINT32_TEST(_field, _state, _field_num, NULL, _info, _type)#define VMSTATE_END_OF_LIST () \
Signature · 1 line
1.9.0
PATCH 74/97 vmstate: Remove version parameter from VMSTATE_STRUCT_TEST
In reply to Juan QuintelaAs we haven't yet moved everything that uses VMSTATE_STRUCT_TEST we create a temporary VMSTATE_STRUCT_INFO. This would allows us to not having to move fields to VMSTATE_STRUCT_TEST and then remove the version parameter.
--- hw/acpi/piix4.c | 2 +- include/migration/vmstate.h | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-)
hw/acpi/piix4.c +1 -1
@@ -270,7 +270,7 @@ static const VMStateDescription vmstate_acpi = { acpi_pci_hotplug.acpi_pcihp_pci_status[ACPI_PCIHP_BSEL_DEFAULT ], PIIX4PMState, vmstate_test_no_use_acpi_pci_hotplug, -2 , vmstate_pci_status, + vmstate_pci_status, struct AcpiPciHpPciStatus),VMSTATE_PCI_HOTPLUG (acpi_pci_hotplug, PIIX4PMState, vmstate_test_use_acpi_pci_hotplug),
include/migration/vmstate.h +5 -2
@@ -276,7 +276,7 @@ extern const VMStateInfo vmstate_info_bitmap; .offset = offsetof(_state, _field), \ } -#define VMSTATE_STRUCT_TEST (_field, _state, _test, _version, _vmsd, _type) { \ +#define VMSTATE_STRUCT_INFO (_field, _state, _test, _version, _vmsd, _type) { \ .name = (stringify(_field)), \ .version_id = (_version), \ .field_exists = (_test), \
@@ -447,8 +447,11 @@ extern const VMStateInfo vmstate_info_bitmap;_v : version */ +#define VMSTATE_STRUCT_TEST (_field, _state, _test, _vmsd, _type) \ + VMSTATE_STRUCT_INFO(_field, _state, _test, 0, _vmsd, _type) +#define VMSTATE_STRUCT (_field, _state, _version, _vmsd, _type) \ - VMSTATE_STRUCT_TEST(_field, _state, NULL, _version, _vmsd, _type) + VMSTATE_STRUCT_INFO(_field, _state, NULL, _version, _vmsd, _type)#define VMSTATE_STRUCT_POINTER (_field, _state, _vmsd, _type) \ VMSTATE_STRUCT_POINTER_TEST(_field, _state, NULL, _vmsd, _type)
Signature · 1 line
1.9.0
PATCH 75/97 vmstate: Move all users of versioning to VMSTATE_STRUCT_TEST
In reply to Juan Quintela--- hw/usb/hcd-ehci-pci.c | 3 ++- hw/usb/hcd-ehci-sysbus.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)
hw/usb/hcd-ehci-pci.c +2 -1
@@ -110,7 +110,8 @@ static const VMStateDescription vmstate_ehci_pci = { .minimum_version_id = 1, .fields = (VMStateField []) {VMSTATE_PCI_DEVICE (pcidev, EHCIPCIState), -VMSTATE_STRUCT (ehci, EHCIPCIState,2 , vmstate_ehci, EHCIState), +VMSTATE_STRUCT_TEST (ehci, EHCIPCIState, vmstate_2_plus, + vmstate_ehci, EHCIState),VMSTATE_END_OF_LIST () } };
hw/usb/hcd-ehci-sysbus.c +2 -1
@@ -22,7 +22,8 @@ static const VMStateDescription vmstate_ehci_sysbus = { .version_id = 2, .minimum_version_id = 1, .fields = (VMStateField []) { -VMSTATE_STRUCT (ehci, EHCISysBusState,2 , vmstate_ehci, EHCIState), +VMSTATE_STRUCT_TEST (ehci, EHCISysBusState, vmstate_2_plus, + vmstate_ehci, EHCIState),VMSTATE_END_OF_LIST () } };
Signature · 1 line
1.9.0