@@ -355,7 +355,12 @@ enum {
};
struct decompress_param {
- /* To be done */
+ int state;
+ QemuMutex mutex;
+ QemuCond cond;
+ void *des;
+ uint8 compbuf[COMPRESS_BUF_SIZE];
+ int len;
};
typedef struct decompress_param decompress_param;
@@ -1186,6 +1191,8 @@ void migrate_decompress_threads_create(int count)
decomp_param = g_malloc0(sizeof(decompress_param) * count);
quit_thread = false;
for (i = 0; i < count; i++) {
+ qemu_mutex_init(&decomp_param[i].mutex);
+ qemu_cond_init(&decomp_param[i].cond);
qemu_thread_create(decompress_threads + i, "decompress",
do_data_decompress, decomp_param + i, QEMU_THREAD_JOINABLE);
}
@@ -1199,6 +1206,8 @@ void migrate_decompress_threads_join(void)
thread_count = migrate_decompress_threads();
for (i = 0; i < thread_count; i++) {
qemu_thread_join(decompress_threads + i);
+ qemu_mutex_destroy(&decomp_param[i].mutex);
+ qemu_cond_destroy(&decomp_param[i].cond);
}
g_free(decompress_threads);
g_free(decomp_param);