diff options
author | Juan Quintela <quintela@redhat.com> | 2014-09-23 14:09:54 +0200 |
---|---|---|
committer | Juan Quintela <quintela@redhat.com> | 2015-06-12 06:53:57 +0200 |
commit | 5cd8cadae8db905afcbf877cae568c27d1d55a8a (patch) | |
tree | d6932290619f414a963ffb2a330e42bda1437492 /hw/virtio | |
parent | 0163a2e025cda6acb33e100d296965671ace17d9 (diff) | |
download | qemu-5cd8cadae8db905afcbf877cae568c27d1d55a8a.zip qemu-5cd8cadae8db905afcbf877cae568c27d1d55a8a.tar.gz qemu-5cd8cadae8db905afcbf877cae568c27d1d55a8a.tar.bz2 |
migration: Use normal VMStateDescriptions for Subsections
We create optional sections with this patch. But we already have
optional subsections. Instead of having two mechanism that do the
same, we can just generalize it.
For subsections we just change:
- Add a needed function to VMStateDescription
- Remove VMStateSubsection (after removal of the needed function
it is just a VMStateDescription)
- Adjust the whole tree, moving the needed function to the corresponding
VMStateDescription
Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'hw/virtio')
-rw-r--r-- | hw/virtio/virtio.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index fb49ffc..ee4e07c 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -1053,6 +1053,7 @@ static const VMStateDescription vmstate_virtio_device_endian = { .name = "virtio/device_endian", .version_id = 1, .minimum_version_id = 1, + .needed = &virtio_device_endian_needed, .fields = (VMStateField[]) { VMSTATE_UINT8(device_endian, VirtIODevice), VMSTATE_END_OF_LIST() @@ -1063,6 +1064,7 @@ static const VMStateDescription vmstate_virtio_64bit_features = { .name = "virtio/64bit_features", .version_id = 1, .minimum_version_id = 1, + .needed = &virtio_64bit_features_needed, .fields = (VMStateField[]) { VMSTATE_UINT64(guest_features, VirtIODevice), VMSTATE_END_OF_LIST() @@ -1077,16 +1079,10 @@ static const VMStateDescription vmstate_virtio = { .fields = (VMStateField[]) { VMSTATE_END_OF_LIST() }, - .subsections = (VMStateSubsection[]) { - { - .vmsd = &vmstate_virtio_device_endian, - .needed = &virtio_device_endian_needed - }, - { - .vmsd = &vmstate_virtio_64bit_features, - .needed = &virtio_64bit_features_needed - }, - { 0 } + .subsections = (const VMStateDescription*[]) { + &vmstate_virtio_device_endian, + &vmstate_virtio_64bit_features, + NULL } }; |