From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41301) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XNHqx-0003Yu-5S for qemu-devel@nongnu.org; Fri, 29 Aug 2014 04:48:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XNHqs-0002WU-GI for qemu-devel@nongnu.org; Fri, 29 Aug 2014 04:48:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49012) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XNHqs-0002WH-98 for qemu-devel@nongnu.org; Fri, 29 Aug 2014 04:48:10 -0400 Date: Fri, 29 Aug 2014 09:48:01 +0100 From: "Richard W.M. Jones" Message-ID: <20140829084801.GV1302@redhat.com> References: <67d97abc587e7c6985166dbe800686938ac8adb5.1409299732.git.hutao@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <67d97abc587e7c6985166dbe800686938ac8adb5.1409299732.git.hutao@cn.fujitsu.com> Subject: Re: [Qemu-devel] [PATCH v13 5/6] raw-posix: Add full preallocation option List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Hu Tao Cc: Kevin Wolf , Fam Zheng , qemu-devel@nongnu.org, Max Reitz , Stefan Hajnoczi , Yasunori Goto On Fri, Aug 29, 2014 at 04:33:12PM +0800, Hu Tao wrote: > + if (prealloc == PREALLOC_MODE_FULL) { > + /* posix_fallocate() doesn't set errno. */ > + result = -posix_fallocate(fd, 0, total_size); > + if (result != 0) { Is it better to test: result != ENOSYS && result != EOPNOTSUPP here? I think this is definitely the right approach. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v