>>> + err = deflate(stream, Z_FINISH); >>> + if (err != Z_STREAM_END) { >>> + return -1; >>> + } >>> + >>> + return stream->next_out - dest; >>> +} >>> + >>> >>> @@ -683,8 +707,10 @@ ssize_t qemu_put_compression_data(QEMUFile *f, const >>> uint8_t *p, size_t size, >>> return -1; >>> } >>> } >>> - if (compress2(f->buf + f->buf_index + sizeof(int32_t), (uLongf *)&blen, >>> - (Bytef *)p, size, level) != Z_OK) { >>> + >>> + blen = qemu_compress_data(stream, f->buf + f->buf_index + >>> sizeof(int32_t), >>> + blen, p, size); >> The "level" parameter is never used after the patch, could we just removed >> it? >> On the other hand, deflate() of zlib supports compression level too(by >> deflateInit(stream, level)), should we just reuse the level properly? If >> not, the >> *migrate parameter compress_level* will be useless. > > The 'level' has been pushed to @stream: > + if (deflateInit(&comp_param[i].stream, > + migrate_compress_level()) != Z_OK) { > + goto exit; > + } Indeed, I missed that. Reviewed-by: Jiang Biao <jiang.bi...@zte.com.cn>
- [Qemu-devel] [PATCH 4/8] migration: introduce contr... guangrong . xiao
- Re: [Qemu-devel] [PATCH 4/8] migration: introd... Dr. David Alan Gilbert
- Re: [Qemu-devel] [PATCH 4/8] migration: in... Xiao Guangrong
- [Qemu-devel] [PATCH 2/8] migration: stop allocating... guangrong . xiao
- Re: [Qemu-devel] [PATCH 2/8] migration: stop a... Dr. David Alan Gilbert
- Re: [Qemu-devel] [PATCH 2/8] migration: st... Xiao Guangrong
- Re: [Qemu-devel] [PATCH 2/8] migration... Dr. David Alan Gilbert
- Re: [Qemu-devel] [PATCH 2/8] migra... Xiao Guangrong
- Re: [Qemu-devel] [PATCH 2/8] migration: stop ... jiang.biao2
- Re: [Qemu-devel] [PATCH 2/8] migration: st... Xiao Guangrong
- Re: [Qemu-devel] [PATCH 2/8] migratio... jiang.biao2
- Re: [Qemu-devel] [PATCH 2/8] migration: stop a... Peter Xu
- Re: [Qemu-devel] [PATCH 2/8] migration: st... Xiao Guangrong
- [Qemu-devel] [PATCH 3/8] migration: support to dete... guangrong . xiao
- Re: [Qemu-devel] [PATCH 3/8] migration: suppor... Dr. David Alan Gilbert
- Re: [Qemu-devel] [PATCH 3/8] migration: su... Xiao Guangrong
- Re: [Qemu-devel] [PATCH 3/8] migration: suppo... jiang.biao2
- Re: [Qemu-devel] [PATCH 3/8] migration: su... Xiao Guangrong
- Re: [Qemu-devel] [PATCH 3/8] migration: suppor... Peter Xu
- Re: [Qemu-devel] [PATCH 3/8] migration: su... Xiao Guangrong
- [Qemu-devel] [PATCH 6/8] migration: move calling sa... guangrong . xiao