Index: vl.c =================================================================== --- vl.c (revision 688) +++ vl.c (revision 689) @@ -5788,6 +5788,10 @@ return 0; } +/* The PREV_BDRV_HASH_BLOCK_SIZE is used for converter */ +/* It can be set to the default of 1024, and then it */ +/* reads old format and writes new format */ +#define PREV_BDRV_HASH_BLOCK_SIZE 16384 #define BDRV_HASH_BLOCK_SIZE 16384 #define IOBUF_SIZE 4096 #define RAM_CBLOCK_MAGIC 0xfabe @@ -6013,7 +6017,7 @@ return -EINVAL; if (ram_decompress_open(s, f) < 0) return -EINVAL; - for(i = 0; i < phys_ram_size; i+= BDRV_HASH_BLOCK_SIZE) { + for(i = 0; i < phys_ram_size; i+= PREV_BDRV_HASH_BLOCK_SIZE) { #ifdef USE_KVM if (kvm_allowed && (i>=0xa0000) && (i<0xc0000)) /* do not access video-addresses */ continue; @@ -6023,7 +6027,7 @@ goto error; } if (buf[0] == 0) { - if (ram_decompress_buf(s, phys_ram_base + i, BDRV_HASH_BLOCK_SIZE) < 0) { + if (ram_decompress_buf(s, phys_ram_base + i, PREV_BDRV_HASH_BLOCK_SIZE) < 0) { fprintf(stderr, "Error while reading ram block address=0x%08x", i); goto error; } @@ -6041,7 +6045,7 @@ goto error; } if (bdrv_read(bs_table[bs_index], sector_num, phys_ram_base + i, - BDRV_HASH_BLOCK_SIZE / 512) < 0) { + PREV_BDRV_HASH_BLOCK_SIZE / 512) < 0) { fprintf(stderr, "Error while reading sector %d:%" PRId64 "\n", bs_index, sector_num); goto error;