qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Remove SaveVM v2 support
@ 2009-09-09 11:02 Juan Quintela
  0 siblings, 0 replies; only message in thread
From: Juan Quintela @ 2009-09-09 11:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: aliguori

In previous series I remove v2 support for RAM (that was the version that was
supported when SaveVM v3 appeared).  Now we can't load RAM for any image saved in SaveVM v2, we can as well remove SaveVM v2 entirely.

Note: That SaveVM RAM was at v2 when General SaveVM support went from v2 to v3 makes talking about versions confusing at least

Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 savevm.c |   47 ++++-------------------------------------------
 1 files changed, 4 insertions(+), 43 deletions(-)

diff --git a/savevm.c b/savevm.c
index 8216593..2567ec3 100644
--- a/savevm.c
+++ b/savevm.c
@@ -1276,47 +1276,6 @@ typedef struct LoadStateEntry {
     struct LoadStateEntry *next;
 } LoadStateEntry;

-static int qemu_loadvm_state_v2(QEMUFile *f)
-{
-    SaveStateEntry *se;
-    int len, ret, instance_id, record_len, version_id;
-    int64_t total_len, end_pos, cur_pos;
-    char idstr[256];
-
-    total_len = qemu_get_be64(f);
-    end_pos = total_len + qemu_ftell(f);
-    for(;;) {
-        if (qemu_ftell(f) >= end_pos)
-            break;
-        len = qemu_get_byte(f);
-        qemu_get_buffer(f, (uint8_t *)idstr, len);
-        idstr[len] = '\0';
-        instance_id = qemu_get_be32(f);
-        version_id = qemu_get_be32(f);
-        record_len = qemu_get_be32(f);
-        cur_pos = qemu_ftell(f);
-        se = find_se(idstr, instance_id);
-        if (!se) {
-            fprintf(stderr, "qemu: warning: instance 0x%x of device '%s' not present in current VM\n",
-                    instance_id, idstr);
-        } else {
-            ret = vmstate_load(f, se, version_id);
-            if (ret < 0) {
-                fprintf(stderr, "qemu: warning: error while loading state for instance 0x%x of device '%s'\n",
-                        instance_id, idstr);
-                return ret;
-            }
-        }
-        /* always seek to exact end of record */
-        qemu_fseek(f, cur_pos + record_len, SEEK_SET);
-    }
-
-    if (qemu_file_has_error(f))
-        return -EIO;
-
-    return 0;
-}
-
 int qemu_loadvm_state(QEMUFile *f)
 {
     LoadStateEntry *first_le = NULL;
@@ -1329,8 +1288,10 @@ int qemu_loadvm_state(QEMUFile *f)
         return -EINVAL;

     v = qemu_get_be32(f);
-    if (v == QEMU_VM_FILE_VERSION_COMPAT)
-        return qemu_loadvm_state_v2(f);
+    if (v == QEMU_VM_FILE_VERSION_COMPAT) {
+        fprintf(stderr, "SaveVM v2 format is obsolete and don't work anymore\n");
+        return -ENOTSUP;
+    }
     if (v != QEMU_VM_FILE_VERSION)
         return -ENOTSUP;

-- 
1.6.2.5

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2009-09-09 11:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-09 11:02 [Qemu-devel] [PATCH] Remove SaveVM v2 support 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).