diff mbox

[03/13] migration: [HACK] Don't create decompression threads if not enabled

Message ID 1461163481-11439-4-git-send-email-quintela@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Juan Quintela April 20, 2016, 2:44 p.m. UTC
This is a partial fix, we also need to not allow reception of
compression packages if not enabled.

Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 migration/ram.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox

Patch

diff --git a/migration/ram.c b/migration/ram.c
index 3f05738..648362c 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -2215,6 +2215,9 @@  void migrate_decompress_threads_create(void)
 {
     int i, thread_count;

+    if (!migrate_use_compression()) {
+        return;
+    }
     thread_count = migrate_decompress_threads();
     decompress_threads = g_new0(QemuThread, thread_count);
     decomp_param = g_new0(DecompressParam, thread_count);
@@ -2233,6 +2236,9 @@  void migrate_decompress_threads_join(void)
 {
     int i, thread_count;

+    if (!migrate_use_compression()) {
+        return;
+    }
     quit_decomp_thread = true;
     thread_count = migrate_decompress_threads();
     for (i = 0; i < thread_count; i++) {