mirror of
https://github.com/mii443/qemu.git
synced 2025-08-22 23:25:48 +00:00
ram compress: Assert that the file buffer matches the result
Before this series, "nothing to send" was handled by the file buffer being empty. Now it is tracked via param->result. Assert that the file buffer state matches the result. Signed-off-by: Lukas Straub <lukasstraub2@web.de> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
This commit is contained in:
committed by
Juan Quintela
parent
b1f17720c1
commit
4024cc8506
@ -870,6 +870,17 @@ int qemu_put_qemu_file(QEMUFile *f_des, QEMUFile *f_src)
|
||||
return len;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check if the writable buffer is empty
|
||||
*/
|
||||
|
||||
bool qemu_file_buffer_empty(QEMUFile *file)
|
||||
{
|
||||
assert(qemu_file_is_writable(file));
|
||||
|
||||
return !file->iovcnt;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get a string whose length is determined by a single preceding byte
|
||||
* A preallocated 256 byte buffer must be passed in.
|
||||
|
Reference in New Issue
Block a user