From 32b054954fb4a14b201f88d0b7fc94c60b8a740e Mon Sep 17 00:00:00 2001 From: Xiao Guangrong Date: Thu, 6 Sep 2018 15:01:01 +0800 Subject: migration: use save_page_use_compression in flush_compressed_data It avoids to touch compression locks if xbzrle and compression are both enabled Signed-off-by: Xiao Guangrong Reviewed-by: Juan Quintela Message-Id: <20180906070101.27280-4-xiaoguangrong@tencent.com> Signed-off-by: Juan Quintela Signed-off-by: Dr. David Alan Gilbert --- migration/ram.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'migration/ram.c') diff --git a/migration/ram.c b/migration/ram.c index 7c12f27..0fdaa8e 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -1932,11 +1932,13 @@ update_compress_thread_counts(const CompressParam *param, int bytes_xmit) compression_counters.pages++; } +static bool save_page_use_compression(RAMState *rs); + static void flush_compressed_data(RAMState *rs) { int idx, len, thread_count; - if (!migrate_use_compression()) { + if (!save_page_use_compression(rs)) { return; } thread_count = migrate_compress_threads(); -- cgit v1.1