mirror of
https://github.com/mii443/qemu.git
synced 2025-08-28 18:09:35 +00:00
migration: remove duplicate code
version_id is checked twice in the ram_load.
Signed-off-by: ChenLiang <chenliang88@huawei.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
(cherry picked from commit 21a246a43b
)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
This commit is contained in:
@ -997,7 +997,7 @@ static int ram_load(QEMUFile *f, void *opaque, int version_id)
|
|||||||
|
|
||||||
seq_iter++;
|
seq_iter++;
|
||||||
|
|
||||||
if (version_id < 4 || version_id > 4) {
|
if (version_id != 4) {
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1008,7 +1008,6 @@ static int ram_load(QEMUFile *f, void *opaque, int version_id)
|
|||||||
addr &= TARGET_PAGE_MASK;
|
addr &= TARGET_PAGE_MASK;
|
||||||
|
|
||||||
if (flags & RAM_SAVE_FLAG_MEM_SIZE) {
|
if (flags & RAM_SAVE_FLAG_MEM_SIZE) {
|
||||||
if (version_id == 4) {
|
|
||||||
/* Synchronize RAM block list */
|
/* Synchronize RAM block list */
|
||||||
char id[256];
|
char id[256];
|
||||||
ram_addr_t length;
|
ram_addr_t length;
|
||||||
@ -1047,7 +1046,6 @@ static int ram_load(QEMUFile *f, void *opaque, int version_id)
|
|||||||
total_ram_bytes -= length;
|
total_ram_bytes -= length;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (flags & RAM_SAVE_FLAG_COMPRESS) {
|
if (flags & RAM_SAVE_FLAG_COMPRESS) {
|
||||||
void *host;
|
void *host;
|
||||||
|
Reference in New Issue
Block a user