mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-26 20:03:54 -06: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:
parent
b1f17720c1
commit
4024cc8506
4 changed files with 19 additions and 0 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue