qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] vmstate: fix vmstate_subsection_load
@ 2010-07-28  4:37 TeLeMan
  2010-07-28 10:43 ` [Qemu-devel] " Juan Quintela
  0 siblings, 1 reply; 9+ messages in thread
From: TeLeMan @ 2010-07-28  4:37 UTC (permalink / raw)
  To: Juan Quintela, qemu-devel

 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 <geleman@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

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-07-28 13:53 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-28  4:37 [Qemu-devel] [PATCH] vmstate: fix vmstate_subsection_load TeLeMan
2010-07-28 10:43 ` [Qemu-devel] " Juan Quintela
2010-07-28 11:23   ` TeLeMan
2010-07-28 11:51     ` Juan Quintela
2010-07-28 12:17       ` TeLeMan
2010-07-28 12:32         ` Juan Quintela
2010-07-28 12:51           ` TeLeMan
2010-07-28 13:12             ` Paolo Bonzini
2010-07-28 13:51               ` Juan Quintela

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).