mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 07:13: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
|
@ -1321,11 +1321,13 @@ static int send_queued_data(CompressParam *param)
|
|||
assert(block == pss->last_sent_block);
|
||||
|
||||
if (param->result == RES_ZEROPAGE) {
|
||||
assert(qemu_file_buffer_empty(param->file));
|
||||
len += save_page_header(pss, file, block, offset | RAM_SAVE_FLAG_ZERO);
|
||||
qemu_put_byte(file, 0);
|
||||
len += 1;
|
||||
ram_release_page(block->idstr, offset);
|
||||
} else if (param->result == RES_COMPRESS) {
|
||||
assert(!qemu_file_buffer_empty(param->file));
|
||||
len += save_page_header(pss, file, block,
|
||||
offset | RAM_SAVE_FLAG_COMPRESS_PAGE);
|
||||
len += qemu_put_qemu_file(file, param->file);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue