mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 07:13:54 -06:00
migration: detect compression and decompression errors
Currently the page being compressed is allowed to be updated by the VM on the source QEMU, correspondingly the destination QEMU just ignores the decompression error. However, we completely miss the chance to catch real errors, then the VM is corrupted silently To make the migration more robuster, we copy the page to a buffer first to avoid it being written by VM, then detect and handle the errors of both compression and decompression errors properly Reviewed-by: Peter Xu <peterx@redhat.com> Signed-off-by: Xiao Guangrong <xiaoguangrong@tencent.com> Message-Id: <20180330075128.26919-5-xiaoguangrong@tencent.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
This commit is contained in:
parent
797ca154b4
commit
34ab9e9743
2 changed files with 41 additions and 19 deletions
|
@ -710,9 +710,9 @@ ssize_t qemu_put_compression_data(QEMUFile *f, z_stream *stream,
|
|||
blen = qemu_compress_data(stream, f->buf + f->buf_index + sizeof(int32_t),
|
||||
blen, p, size);
|
||||
if (blen < 0) {
|
||||
error_report("Compress Failed!");
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
|
||||
qemu_put_be32(f, blen);
|
||||
if (f->ops->writev_buffer) {
|
||||
add_to_iovec(f, f->buf + f->buf_index, blen, false);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue