On 08/23/2013 05:14 PM, Paolo Bonzini wrote:
Il 23/08/2013 11:11, Lei Li ha scritto:
In qemu_savevm_state_iterate(), if the return of ram_save_iterate < 0,
it will set error in QEMUFile by qemu_file_set_error(f, ret), the error
reported by qemu_file_get_error() in the QEMUFile is got from
qemu_file_set_error() by reading the f->last_error, right?
And now as qemu_file_rate_limit() never return negative value, what's the
meaning for the check: if (qemu_file_rate_limit(f) < 0) in
ram_save_iterate()?
I only see a "while ((ret = qemu_file_rate_limit(f)) == 0)", no
less-than-zero check.
Are we looking at the same code? :)
I think so, hehe.
You might want to look a little more. After the while(..), there is a check:
if (ret < 0) {
bytes_transferred += total_sent;
return ret;
}
Paolo
--
Lei