From patchwork Wed Jul 28 04:37:32 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: vmstate: fix vmstate_subsection_load Date: Tue, 27 Jul 2010 18:37:32 -0000 From: TeLeMan X-Patchwork-Id: 60083 Message-Id: To: Juan Quintela , qemu-devel Cc: If the new version adds the new subsection for some vmstate, the old version will load the new version's vmstate unsuccessfully. So we have to ignore the unrecognized subsections. Signed-off-by: TeLeMan --- savevm.c | 11 +++++------ 1 files changed, 5 insertions(+), 6 deletions(-) return 0; diff --git a/savevm.c b/savevm.c index 9a8328d..3e1aa73 100644 --- a/savevm.c +++ b/savevm.c @@ -1581,12 +1581,11 @@ static int vmstate_subsection_load(QEMUFile *f, const VMStateDescription *vmsd, version_id = qemu_get_be32(f); sub_vmsd = vmstate_get_subsection(vmsd->subsections, idstr); - if (sub_vmsd == NULL) { - return -ENOENT; - } - ret = vmstate_load_state(f, sub_vmsd, opaque, version_id); - if (ret) { - return ret; + if (sub_vmsd) { + ret = vmstate_load_state(f, sub_vmsd, opaque, version_id); + if (ret) { + return ret; + } } }