From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43007) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fBb8b-00014R-Ju for qemu-devel@nongnu.org; Thu, 26 Apr 2018 03:16:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fBb8W-0003zK-J6 for qemu-devel@nongnu.org; Thu, 26 Apr 2018 03:16:17 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:59902 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fBb8W-0003z4-Dh for qemu-devel@nongnu.org; Thu, 26 Apr 2018 03:16:12 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8B8CE427095D for ; Thu, 26 Apr 2018 07:16:08 +0000 (UTC) Date: Thu, 26 Apr 2018 15:15:58 +0800 From: Peter Xu Message-ID: <20180426071558.GQ9036@xz-mi> References: <20180425112723.1111-1-quintela@redhat.com> <20180425112723.1111-11-quintela@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180425112723.1111-11-quintela@redhat.com> Subject: Re: [Qemu-devel] [PATCH v12 10/21] migration: Create multipage support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela Cc: qemu-devel@nongnu.org, dgilbert@redhat.com, lvivier@redhat.com On Wed, Apr 25, 2018 at 01:27:12PM +0200, Juan Quintela wrote: [...] > +static void multifd_pages_init(MultiFDPages_t **ppages, size_t size) > +{ > + MultiFDPages_t *pages = g_new0(MultiFDPages_t, 1); > + > + pages->allocated = size; > + pages->iov = g_new0(struct iovec, size); > + pages->offset = g_new0(ram_addr_t, size); > + *ppages = pages; > +} Can we just return the pages pointer? Then it can be: static MultiFDPages_t *multifd_pages_init(size_t size) [...] > @@ -731,6 +784,7 @@ static void *multifd_recv_thread(void *opaque) > int multifd_load_setup(void) > { > int thread_count; > + uint32_t page_count = migrate_multifd_page_count(); > uint8_t i; > > if (!migrate_use_multifd()) { > @@ -740,6 +794,7 @@ int multifd_load_setup(void) > multifd_recv_state = g_malloc0(sizeof(*multifd_recv_state)); > multifd_recv_state->params = g_new0(MultiFDRecvParams, thread_count); > atomic_set(&multifd_recv_state->count, 0); > + Useless line? Otherwise: Reviewed-by: Peter Xu -- Peter Xu