Message ID | 1461960516-4717-8-git-send-email-eblake@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
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; }
Sector-based blk_read() should die; switch to byte-based blk_pread() instead. Signed-off-by: Eric Blake <eblake@redhat.com> --- 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(-)