On 06/30/2011 10:46 AM, Paolo Bonzini wrote:
With the current migration format, VMS_STRUCTs with subsections
are ambiguous. The protocol cannot tell whether a 0x5 byte after
the VMS_STRUCT is a subsection or part of the parent data stream.
In the past QEMU assumed it was always a part of a subsection; after
commit eb60260 (savevm: fix corruption in vmstate_subsection_load().,
2011-02-03) the choice depends on whether the VMS_STRUCT has subsections
defined.
Unfortunately, this means that if a destination has no subsections
defined for the struct, it will happily read subsection data into
its own fields. And if you are "lucky" enough to stumble on a
zero byte at the right time, it will be interpreted as QEMU_VM_EOF
and migration will be interrupted.
There is no way out of this except defining an incompatible
migration protocol with a sentinel at the end of embedded structs.
Of course, this is restricted to new machine models.
Signed-off-by: Paolo Bonzini<pbonz...@redhat.com>
---
hw/pc_piix.c | 6 ++++++
savevm.c | 27 +++++++++++++++++++--------
2 files changed, 25 insertions(+), 8 deletions(-)
diff --git a/hw/pc_piix.c b/hw/pc_piix.c
index 18cc942..d8d629c 100644
--- a/hw/pc_piix.c
+++ b/hw/pc_piix.c
@@ -271,6 +271,7 @@ static QEMUMachine pc_machine_v0_14 = {
.desc = "Standard PC",
.init = pc_init_pci,
.max_cpus = 255,
+ .migration_format = 3,
};
Please introduce a macro so this code is readable.
We have other machines that support migration in other archs too.
Regards,
Anthony Liguori