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 <gele...@gmail.com>
---
 savevm.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

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;
+            }
         }
     }
     return 0;
-- 
1.6.5.1.1367.gcd48

--
SUN OF A BEACH

Reply via email to