From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=45978 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ODdvG-000426-L9 for qemu-devel@nongnu.org; Sun, 16 May 2010 09:30:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1ODdvF-00035A-CX for qemu-devel@nongnu.org; Sun, 16 May 2010 09:30:26 -0400 Received: from verein.lst.de ([213.95.11.210]:36389) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ODdvF-000351-0B for qemu-devel@nongnu.org; Sun, 16 May 2010 09:30:25 -0400 Date: Sun, 16 May 2010 15:30:22 +0200 From: Christoph Hellwig Message-ID: <20100516133022.GB27075@lst.de> References: <1273930259-12694-1-git-send-email-nab@linux-iscsi.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1273930259-12694-1-git-send-email-nab@linux-iscsi.org> Subject: [Qemu-devel] Re: [PATCH 2/2] [block]: Skip refresh_total_sectors() for scsi-generic devices List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Nicholas A. Bellinger" Cc: Kevin Wolf , kvm-devel , qemu-devel , Hannes Reinecke , Christoph Hellwig , Gerd Hoffmann On Sat, May 15, 2010 at 06:30:59AM -0700, Nicholas A. Bellinger wrote: > From: Nicholas Bellinger > > This patch adds a BlockDriverState->sg check in block.c:bdrv_common_open() > to skip the new refresh_total_sectors() call once we know we are working with > a scsi-generic device. > > We go ahead and skip this call for scsi-generic devices because > block/raw-posix.c:raw_getlength() -> lseek() will return -ESPIPE. How about moving that check into refresh_total_sectors?