mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
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>
This commit is contained in:
parent
0163a2e025
commit
5cd8cadae8
32 changed files with 266 additions and 402 deletions
|
@ -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
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue