From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xiao Guangrong Subject: Re: [PATCH v7 12/35] util: let qemu_fd_getlength support block device Date: Mon, 9 Nov 2015 13:58:27 +0800 Message-ID: <56403603.20002@linux.intel.com> References: <1446455617-129562-1-git-send-email-guangrong.xiao@linux.intel.com> <1446455617-129562-13-git-send-email-guangrong.xiao@linux.intel.com> <20151106155411.GY4180@thinpad.lan.raisama.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Kevin Wolf , vsementsov@virtuozzo.com, qemu-block@nongnu.org, kvm@vger.kernel.org, mst@redhat.com, gleb@kernel.org, mtosatti@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, imammedo@redhat.com, pbonzini@redhat.com, dan.j.williams@intel.com, rth@twiddle.net To: Eduardo Habkost Return-path: In-Reply-To: <20151106155411.GY4180@thinpad.lan.raisama.net> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-block-bounces+gceqb-qemu-block=m.gmane.org@nongnu.org Sender: qemu-block-bounces+gceqb-qemu-block=m.gmane.org@nongnu.org List-Id: kvm.vger.kernel.org On 11/06/2015 11:54 PM, Eduardo Habkost wrote: > On Mon, Nov 02, 2015 at 05:13:14PM +0800, Xiao Guangrong wrote: >> lseek can not work for all block devices as the man page says: >> | Some devices are incapable of seeking and POSIX does not specify >> | which devices must support lseek(). >> >> This patch tries to add the support on Linux by using BLKGETSIZE64 >> ioctl >> >> Signed-off-by: Xiao Guangrong > > On which cases is this patch necessary? Do you know any examples of > Linux block devices that won't work with lseek(SEEK_END)? To be honest, i have not checked all block device, this patch was made based on the man page. However, i do not mind drop this patch (and maybe other patches) to make this pachset smaller. BLKGETSIZE64 can be added in the future if we meet such device. From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32836) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZvfZX-0007FV-3s for qemu-devel@nongnu.org; Mon, 09 Nov 2015 01:04:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZvfZW-0004rM-7p for qemu-devel@nongnu.org; Mon, 09 Nov 2015 01:04:54 -0500 References: <1446455617-129562-1-git-send-email-guangrong.xiao@linux.intel.com> <1446455617-129562-13-git-send-email-guangrong.xiao@linux.intel.com> <20151106155411.GY4180@thinpad.lan.raisama.net> From: Xiao Guangrong Message-ID: <56403603.20002@linux.intel.com> Date: Mon, 9 Nov 2015 13:58:27 +0800 MIME-Version: 1.0 In-Reply-To: <20151106155411.GY4180@thinpad.lan.raisama.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v7 12/35] util: let qemu_fd_getlength support block device List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: Kevin Wolf , vsementsov@virtuozzo.com, qemu-block@nongnu.org, kvm@vger.kernel.org, mst@redhat.com, gleb@kernel.org, mtosatti@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, imammedo@redhat.com, pbonzini@redhat.com, dan.j.williams@intel.com, rth@twiddle.net On 11/06/2015 11:54 PM, Eduardo Habkost wrote: > On Mon, Nov 02, 2015 at 05:13:14PM +0800, Xiao Guangrong wrote: >> lseek can not work for all block devices as the man page says: >> | Some devices are incapable of seeking and POSIX does not specify >> | which devices must support lseek(). >> >> This patch tries to add the support on Linux by using BLKGETSIZE64 >> ioctl >> >> Signed-off-by: Xiao Guangrong > > On which cases is this patch necessary? Do you know any examples of > Linux block devices that won't work with lseek(SEEK_END)? To be honest, i have not checked all block device, this patch was made based on the man page. However, i do not mind drop this patch (and maybe other patches) to make this pachset smaller. BLKGETSIZE64 can be added in the future if we meet such device.