From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37106) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1awEjI-0004Dl-1N for qemu-devel@nongnu.org; Fri, 29 Apr 2016 16:09:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1awEj6-0001l1-2E for qemu-devel@nongnu.org; Fri, 29 Apr 2016 16:09:30 -0400 From: Eric Blake Date: Fri, 29 Apr 2016 14:08:29 -0600 Message-Id: <1461960516-4717-8-git-send-email-eblake@redhat.com> In-Reply-To: <1461960516-4717-1-git-send-email-eblake@redhat.com> References: <1461960516-4717-1-git-send-email-eblake@redhat.com> Subject: [Qemu-devel] [PATCH v4 07/14] m25p80: Switch to byte-based block access List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Crosthwaite , Kevin Wolf , Max Reitz , "open list:Block layer core" Sector-based blk_read() should die; switch to byte-based blk_pread() instead. Signed-off-by: Eric Blake --- Not compile tested - I'm not sure what else I'd need in my environment to actually test this one. I have: Fedora 23, dnf builddep qemu ./configure --enable-kvm --enable-system --disable-user --target-list=x86_64-softmmu,ppc64-softmmu --enable-debug --- hw/block/m25p80.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c index 906b712..01c51a2 100644 --- a/hw/block/m25p80.c +++ b/hw/block/m25p80.c @@ -907,8 +907,7 @@ static int m25p80_init(SSISlave *ss) s->storage = blk_blockalign(s->blk, s->size); /* FIXME: Move to late init */ - if (blk_read(s->blk, 0, s->storage, - DIV_ROUND_UP(s->size, BDRV_SECTOR_SIZE))) { + if (blk_pread(s->blk, 0, s->storage, s->size)) { fprintf(stderr, "Failed to initialize SPI flash!\n"); return 1; } -- 2.5.5