From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51595) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZEbmR-0005W8-W7 for qemu-devel@nongnu.org; Mon, 13 Jul 2015 07:20:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZEbmO-0004xz-Qm for qemu-devel@nongnu.org; Mon, 13 Jul 2015 07:20:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55690) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZEbmO-0004xv-M5 for qemu-devel@nongnu.org; Mon, 13 Jul 2015 07:20:12 -0400 From: Juan Quintela In-Reply-To: <1434450415-11339-22-git-send-email-dgilbert@redhat.com> (David Alan Gilbert's message of "Tue, 16 Jun 2015 11:26:34 +0100") References: <1434450415-11339-1-git-send-email-dgilbert@redhat.com> <1434450415-11339-22-git-send-email-dgilbert@redhat.com> Date: Mon, 13 Jul 2015 13:20:09 +0200 Message-ID: <877fq4l2xi.fsf@neno.neno> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v7 21/42] postcopy: OS support test Reply-To: quintela@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Dr. David Alan Gilbert (git)" Cc: aarcange@redhat.com, yamahata@private.email.ne.jp, liang.z.li@intel.com, qemu-devel@nongnu.org, luis@cs.umu.se, amit.shah@redhat.com, pbonzini@redhat.com, david@gibson.dropbear.id.au "Dr. David Alan Gilbert (git)" wrote: > From: "Dr. David Alan Gilbert" > > Provide a check to see if the OS we're running on has all the bits > needed for postcopy. > > Creates postcopy-ram.c which will get most of the other helpers we need. > > Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Juan Quintela I am guessing that test is ok, but we are doing the test each time that we change the function. We always end calling that kind of functions in several places. Shouldn't be good to rename the function to __postcopy_ram_supported_by_host() and do a toplevel function that is: bool postcopy_ram_supported_by_host(void) { static bool first_time = true; static supported = false; if (firt_time) { first_time = false; supported = __postcopy_ram_supported_by_host() } return supported; } Notice that I don't know how slow the mmap + usefault thing is, but I guess that the values would not change while running, no? It has a review-by because I don't see anything wrong with it.