mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 09:13: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
|
@ -662,6 +662,7 @@ static const VMStateDescription vmstate_serial_thr_ipending = {
|
|||
.name = "serial/thr_ipending",
|
||||
.version_id = 1,
|
||||
.minimum_version_id = 1,
|
||||
.needed = serial_thr_ipending_needed,
|
||||
.fields = (VMStateField[]) {
|
||||
VMSTATE_INT32(thr_ipending, SerialState),
|
||||
VMSTATE_END_OF_LIST()
|
||||
|
@ -678,6 +679,7 @@ static const VMStateDescription vmstate_serial_tsr = {
|
|||
.name = "serial/tsr",
|
||||
.version_id = 1,
|
||||
.minimum_version_id = 1,
|
||||
.needed = serial_tsr_needed,
|
||||
.fields = (VMStateField[]) {
|
||||
VMSTATE_INT32(tsr_retry, SerialState),
|
||||
VMSTATE_UINT8(thr, SerialState),
|
||||
|
@ -697,6 +699,7 @@ static const VMStateDescription vmstate_serial_recv_fifo = {
|
|||
.name = "serial/recv_fifo",
|
||||
.version_id = 1,
|
||||
.minimum_version_id = 1,
|
||||
.needed = serial_recv_fifo_needed,
|
||||
.fields = (VMStateField[]) {
|
||||
VMSTATE_STRUCT(recv_fifo, SerialState, 1, vmstate_fifo8, Fifo8),
|
||||
VMSTATE_END_OF_LIST()
|
||||
|
@ -713,6 +716,7 @@ static const VMStateDescription vmstate_serial_xmit_fifo = {
|
|||
.name = "serial/xmit_fifo",
|
||||
.version_id = 1,
|
||||
.minimum_version_id = 1,
|
||||
.needed = serial_xmit_fifo_needed,
|
||||
.fields = (VMStateField[]) {
|
||||
VMSTATE_STRUCT(xmit_fifo, SerialState, 1, vmstate_fifo8, Fifo8),
|
||||
VMSTATE_END_OF_LIST()
|
||||
|
@ -729,6 +733,7 @@ static const VMStateDescription vmstate_serial_fifo_timeout_timer = {
|
|||
.name = "serial/fifo_timeout_timer",
|
||||
.version_id = 1,
|
||||
.minimum_version_id = 1,
|
||||
.needed = serial_fifo_timeout_timer_needed,
|
||||
.fields = (VMStateField[]) {
|
||||
VMSTATE_TIMER_PTR(fifo_timeout_timer, SerialState),
|
||||
VMSTATE_END_OF_LIST()
|
||||
|
@ -745,6 +750,7 @@ static const VMStateDescription vmstate_serial_timeout_ipending = {
|
|||
.name = "serial/timeout_ipending",
|
||||
.version_id = 1,
|
||||
.minimum_version_id = 1,
|
||||
.needed = serial_timeout_ipending_needed,
|
||||
.fields = (VMStateField[]) {
|
||||
VMSTATE_INT32(timeout_ipending, SerialState),
|
||||
VMSTATE_END_OF_LIST()
|
||||
|
@ -760,6 +766,7 @@ static bool serial_poll_needed(void *opaque)
|
|||
static const VMStateDescription vmstate_serial_poll = {
|
||||
.name = "serial/poll",
|
||||
.version_id = 1,
|
||||
.needed = serial_poll_needed,
|
||||
.minimum_version_id = 1,
|
||||
.fields = (VMStateField[]) {
|
||||
VMSTATE_INT32(poll_msl, SerialState),
|
||||
|
@ -788,31 +795,15 @@ const VMStateDescription vmstate_serial = {
|
|||
VMSTATE_UINT8_V(fcr_vmstate, SerialState, 3),
|
||||
VMSTATE_END_OF_LIST()
|
||||
},
|
||||
.subsections = (VMStateSubsection[]) {
|
||||
{
|
||||
.vmsd = &vmstate_serial_thr_ipending,
|
||||
.needed = &serial_thr_ipending_needed,
|
||||
} , {
|
||||
.vmsd = &vmstate_serial_tsr,
|
||||
.needed = &serial_tsr_needed,
|
||||
} , {
|
||||
.vmsd = &vmstate_serial_recv_fifo,
|
||||
.needed = &serial_recv_fifo_needed,
|
||||
} , {
|
||||
.vmsd = &vmstate_serial_xmit_fifo,
|
||||
.needed = &serial_xmit_fifo_needed,
|
||||
} , {
|
||||
.vmsd = &vmstate_serial_fifo_timeout_timer,
|
||||
.needed = &serial_fifo_timeout_timer_needed,
|
||||
} , {
|
||||
.vmsd = &vmstate_serial_timeout_ipending,
|
||||
.needed = &serial_timeout_ipending_needed,
|
||||
} , {
|
||||
.vmsd = &vmstate_serial_poll,
|
||||
.needed = &serial_poll_needed,
|
||||
} , {
|
||||
/* empty */
|
||||
}
|
||||
.subsections = (const VMStateDescription*[]) {
|
||||
&vmstate_serial_thr_ipending,
|
||||
&vmstate_serial_tsr,
|
||||
&vmstate_serial_recv_fifo,
|
||||
&vmstate_serial_xmit_fifo,
|
||||
&vmstate_serial_fifo_timeout_timer,
|
||||
&vmstate_serial_timeout_ipending,
|
||||
&vmstate_serial_poll,
|
||||
NULL
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue