Skip to content

Commit

Permalink
migration: Don't create decompression threads if not enabled
Browse files Browse the repository at this point in the history
Signed-off-by: Juan Quintela <[email protected]>
Reviewed-by: Dr. David Alan Gilbert <[email protected]>
Reviewed-by: Peter Xu <[email protected]>

--

I removed the [HACK] part because previous patch just check that
compression pages are not received.
  • Loading branch information
Juan Quintela committed Jun 14, 2017
1 parent edc6012 commit 3416ab5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions migration/ram.c
Original file line number Diff line number Diff line change
Expand Up @@ -2234,6 +2234,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);
Expand All @@ -2255,6 +2258,9 @@ void migrate_decompress_threads_join(void)
{
int i, thread_count;

if (!migrate_use_compression()) {
return;
}
thread_count = migrate_decompress_threads();
for (i = 0; i < thread_count; i++) {
qemu_mutex_lock(&decomp_param[i].mutex);
Expand Down

0 comments on commit 3416ab5

Please sign in to comment.