From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59020) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZsScM-0002dP-Tq for qemu-devel@nongnu.org; Sat, 31 Oct 2015 05:38:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZsScI-0008Th-JE for qemu-devel@nongnu.org; Sat, 31 Oct 2015 05:38:33 -0400 Received: from relay.parallels.com ([195.214.232.42]:40828) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZsScI-0008SL-Au for qemu-devel@nongnu.org; Sat, 31 Oct 2015 05:38:30 -0400 Message-ID: <56348BF4.7030609@virtuozzo.com> Date: Sat, 31 Oct 2015 12:37:56 +0300 From: Vladimir Sementsov-Ogievskiy MIME-Version: 1.0 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> <56346D1C.6040605@linux.intel.com> In-Reply-To: <56346D1C.6040605@linux.intel.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: Xiao Guangrong , 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 31.10.2015 10:26, Xiao Guangrong wrote: > > > 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. Why not use classic error codes < 0? Just change size_t to ssize_t and return exactly fstatfs return value. > >> >> 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. -- Best regards, Vladimir * now, @virtuozzo.com instead of @parallels.com. Sorry for this inconvenience.