[Qemu-devel] [PULL 02/12] migration: Don't create decompression threads if not enabled

Juan Quintela posted 12 patches 8 years, 12 months ago
[Qemu-devel] [PULL 02/12] migration: Don't create decompression threads if not enabled
Posted by Juan Quintela 8 years, 12 months ago
Signed-off-by: Juan Quintela <quintela@redhat.com>

--

I removed the [HACK] part because previous patch just check that
compression pages are not received.
---
 migration/ram.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/migration/ram.c b/migration/ram.c
index 5817f8c..4422ee8 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -2251,6 +2251,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);
@@ -2272,6 +2275,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);
-- 
2.7.4


Re: [Qemu-devel] [PULL 02/12] migration: Don't create decompression threads if not enabled
Posted by Dr. David Alan Gilbert 8 years, 11 months ago
* Juan Quintela (quintela@redhat.com) wrote:
> Signed-off-by: Juan Quintela <quintela@redhat.com>

Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

This can go in separately.

> --
> 
> I removed the [HACK] part because previous patch just check that
> compression pages are not received.
> ---
>  migration/ram.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/migration/ram.c b/migration/ram.c
> index 5817f8c..4422ee8 100644
> --- a/migration/ram.c
> +++ b/migration/ram.c
> @@ -2251,6 +2251,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);
> @@ -2272,6 +2275,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);
> -- 
> 2.7.4
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK