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:
Lukas Straub 2023-04-20 11:48:31 +02:00 committed by Juan Quintela
parent b1f17720c1
commit 4024cc8506
4 changed files with 19 additions and 0 deletions

View file

@ -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.