From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44812) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YqLPj-00037p-3v for qemu-devel@nongnu.org; Thu, 07 May 2015 09:00:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YqLPf-0007qP-5U for qemu-devel@nongnu.org; Thu, 07 May 2015 09:00:31 -0400 Received: from mail-wi0-x22a.google.com ([2a00:1450:400c:c05::22a]:33944) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YqLPe-0007q8-Uv for qemu-devel@nongnu.org; Thu, 07 May 2015 09:00:27 -0400 Received: by wicmx19 with SMTP id mx19so13303013wic.1 for ; Thu, 07 May 2015 06:00:26 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <554B61E4.8000900@redhat.com> Date: Thu, 07 May 2015 15:00:20 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1429089983-24644-1-git-send-email-liang.z.li@intel.com> <1429089983-24644-6-git-send-email-liang.z.li@intel.com> In-Reply-To: <1429089983-24644-6-git-send-email-liang.z.li@intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [v8 05/14] arch_init: Alloc and free data struct for compression List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Liang Li , qemu-devel@nongnu.org Cc: quintela@redhat.com, armbru@redhat.com, lcapitulino@redhat.com, amit.shah@redhat.com, yang.z.zhang@intel.com, dgilbert@redhat.com On 15/04/2015 11:26, Liang Li wrote: > @@ -378,7 +402,18 @@ void migrate_compress_threads_create(void) > thread_count = migrate_compress_threads(); > compress_threads = g_new0(QemuThread, thread_count); > comp_param = g_new0(CompressParam, thread_count); > + comp_done_cond = g_new0(QemuCond, 1); > + comp_done_lock = g_new0(QemuMutex, 1); > + qemu_cond_init(comp_done_cond); > + qemu_mutex_init(comp_done_lock); Please make a struct that includes a QemuThread *, a CompressParam *, the QemuCond and the QemuMutex. Paolo