Commit 6cd0beda authored by Lei Li's avatar Lei Li Committed by Juan Quintela
Browse files

arch_init: right return for ram_save_iterate

qemu_file_rate_limit() never return negative value since the refactor
by Commit 1964a397

, this patch gets rid of the negative check for it,
adjust bytes_transferred and return value correspondingly in
Signed-off-by: default avatarLei Li <>
Signed-off-by: default avatarPaolo Bonzini <>
Signed-off-by: default avatarJuan Quintela <>
parent c77a5f2d
......@@ -710,15 +710,20 @@ static int ram_save_iterate(QEMUFile *f, void *opaque)
ram_control_after_iterate(f, RAM_CONTROL_ROUND);
bytes_transferred += total_sent;
* Do not count these 8 bytes into total_sent, so that we can
* return 0 if no page had been dirtied.
qemu_put_be64(f, RAM_SAVE_FLAG_EOS);
bytes_transferred += 8;
ret = qemu_file_get_error(f);
if (ret < 0) {
bytes_transferred += total_sent;
return ret;
qemu_put_be64(f, RAM_SAVE_FLAG_EOS);
total_sent += 8;
bytes_transferred += total_sent;
return total_sent;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment