Patchwork [01/26] ram: remove support for loading v1

login
register
mail settings
Submitter Juan Quintela
Date Sept. 10, 2009, 1:04 a.m.
Message ID <c263256e4bcd9e7208b3fe28745b10c6ec96b49a.1252543871.git.quintela@redhat.com>
Download mbox | patch
Permalink /patch/33237/
State Superseded
Headers show

Comments

Juan Quintela - Sept. 10, 2009, 1:04 a.m.
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 vl.c |   42 ------------------------------------------
 1 files changed, 0 insertions(+), 42 deletions(-)

Patch

diff --git a/vl.c b/vl.c
index c6c6a6b..148a592 100644
--- a/vl.c
+++ b/vl.c
@@ -2792,45 +2792,6 @@  void qemu_del_wait_object(HANDLE handle, WaitObjectFunc *func, void *opaque)
 /***********************************************************/
 /* ram save/restore */

-static int ram_get_page(QEMUFile *f, uint8_t *buf, int len)
-{
-    int v;
-
-    v = qemu_get_byte(f);
-    switch(v) {
-    case 0:
-        if (qemu_get_buffer(f, buf, len) != len)
-            return -EIO;
-        break;
-    case 1:
-        v = qemu_get_byte(f);
-        memset(buf, v, len);
-        break;
-    default:
-        return -EINVAL;
-    }
-
-    if (qemu_file_has_error(f))
-        return -EIO;
-
-    return 0;
-}
-
-static int ram_load_v1(QEMUFile *f, void *opaque)
-{
-    int ret;
-    ram_addr_t i;
-
-    if (qemu_get_be32(f) != last_ram_offset)
-        return -EINVAL;
-    for(i = 0; i < last_ram_offset; i+= TARGET_PAGE_SIZE) {
-        ret = ram_get_page(f, qemu_get_ram_ptr(i), TARGET_PAGE_SIZE);
-        if (ret)
-            return ret;
-    }
-    return 0;
-}
-
 #define BDRV_HASH_BLOCK_SIZE 1024
 #define IOBUF_SIZE 4096
 #define RAM_CBLOCK_MAGIC 0xfabe
@@ -3065,9 +3026,6 @@  static int ram_load(QEMUFile *f, void *opaque, int version_id)
     ram_addr_t addr;
     int flags;

-    if (version_id == 1)
-        return ram_load_v1(f, opaque);
-
     if (version_id == 2) {
         if (qemu_get_be32(f) != last_ram_offset)
             return -EINVAL;