From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60237) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZsQev-00071w-Sq for qemu-devel@nongnu.org; Sat, 31 Oct 2015 03:33:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZsQes-0005ZR-Mj for qemu-devel@nongnu.org; Sat, 31 Oct 2015 03:33:05 -0400 Received: from mga14.intel.com ([192.55.52.115]:45385) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZsQes-0005ZK-Go for qemu-devel@nongnu.org; Sat, 31 Oct 2015 03:33:02 -0400 References: <1446184587-142784-1-git-send-email-guangrong.xiao@linux.intel.com> <1446184587-142784-8-git-send-email-guangrong.xiao@linux.intel.com> <5633700C.3060108@virtuozzo.com> From: Xiao Guangrong Message-ID: <56346D1C.6040605@linux.intel.com> Date: Sat, 31 Oct 2015 15:26:20 +0800 MIME-Version: 1.0 In-Reply-To: <5633700C.3060108@virtuozzo.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v6 07/33] util: introduce qemu_file_get_page_size() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladimir Sementsov-Ogievskiy , pbonzini@redhat.com, imammedo@redhat.com Cc: ehabkost@redhat.com, kvm@vger.kernel.org, mst@redhat.com, gleb@kernel.org, mtosatti@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, dan.j.williams@intel.com, rth@twiddle.net On 10/30/2015 09:26 PM, Vladimir Sementsov-Ogievskiy wrote: > logic is changed: > in old version gethugepagesize on statfs error generates exit(1) > in new it returns getpagesize() in this case (through fd_getpagesize) > (I think, fd_getpagesize should be fixed to handle error) Indeed. I will let fd_getpagesize() return 0 if statfs is failed, then the caller handle the error properly. > > also, in new version for windows we have getpagesize(), when in old version there was no difference > (how did it work?). May be it's ok, but should be mentioned in commit message Windows did not support file hugepage, so it will return normal page for this case. And this interface has not been used on windows so far. I will document it in the commit message as your suggestion.