summaryrefslogtreecommitdiffstats
path: root/cpus.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 /cpus.c
parent0163a2e025cda6acb33e100d296965671ace17d9 (diff)
downloadhqemu-5cd8cadae8db905afcbf877cae568c27d1d55a8a.zip
hqemu-5cd8cadae8db905afcbf877cae568c27d1d55a8a.tar.gz
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 'cpus.c')
-rw-r--r--cpus.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/cpus.c b/cpus.c
index f38b858..b85fb5f 100644
--- a/cpus.c
+++ b/cpus.c
@@ -480,6 +480,7 @@ static const VMStateDescription icount_vmstate_timers = {
.name = "timer/icount",
.version_id = 1,
.minimum_version_id = 1,
+ .needed = icount_state_needed,
.fields = (VMStateField[]) {
VMSTATE_INT64(qemu_icount_bias, TimersState),
VMSTATE_INT64(qemu_icount, TimersState),
@@ -497,13 +498,9 @@ static const VMStateDescription vmstate_timers = {
VMSTATE_INT64_V(cpu_clock_offset, TimersState, 2),
VMSTATE_END_OF_LIST()
},
- .subsections = (VMStateSubsection[]) {
- {
- .vmsd = &icount_vmstate_timers,
- .needed = icount_state_needed,
- }, {
- /* empty */
- }
+ .subsections = (const VMStateDescription*[]) {
+ &icount_vmstate_timers,
+ NULL
}
};
OpenPOWER on IntegriCloud