summaryrefslogtreecommitdiff
path: root/hw/input/ps2.c
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2014-09-23 14:09:54 +0200
committerJuan Quintela <quintela@redhat.com>2015-06-12 06:53:57 +0200
commit5cd8cadae8db905afcbf877cae568c27d1d55a8a (patch)
treed6932290619f414a963ffb2a330e42bda1437492 /hw/input/ps2.c
parent0163a2e025cda6acb33e100d296965671ace17d9 (diff)
downloadqemu-5cd8cadae8db905afcbf877cae568c27d1d55a8a.tar.gz
qemu-5cd8cadae8db905afcbf877cae568c27d1d55a8a.tar.bz2
qemu-5cd8cadae8db905afcbf877cae568c27d1d55a8a.zip
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/input/ps2.c')
-rw-r--r--hw/input/ps2.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/hw/input/ps2.c b/hw/input/ps2.c
index 4baeea2b56..fdbe565e62 100644
--- a/hw/input/ps2.c
+++ b/hw/input/ps2.c
@@ -677,6 +677,7 @@ static const VMStateDescription vmstate_ps2_keyboard_ledstate = {
.version_id = 3,
.minimum_version_id = 2,
.post_load = ps2_kbd_ledstate_post_load,
+ .needed = ps2_keyboard_ledstate_needed,
.fields = (VMStateField[]) {
VMSTATE_INT32(ledstate, PS2KbdState),
VMSTATE_END_OF_LIST()
@@ -717,13 +718,9 @@ static const VMStateDescription vmstate_ps2_keyboard = {
VMSTATE_INT32_V(scancode_set, PS2KbdState,3),
VMSTATE_END_OF_LIST()
},
- .subsections = (VMStateSubsection []) {
- {
- .vmsd = &vmstate_ps2_keyboard_ledstate,
- .needed = ps2_keyboard_ledstate_needed,
- }, {
- /* empty */
- }
+ .subsections = (const VMStateDescription*[]) {
+ &vmstate_ps2_keyboard_ledstate,
+ NULL
}
};