ram: remove support for loading v1

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
Juan Quintela 2009-09-10 03:04:22 +02:00 committed by Anthony Liguori
parent 799f1f2325
commit 1a621c8dc9

42
vl.c
View File

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