block.c:find_image_format() calls bdrv_pread() to read first 2048
bytes from the device to guess its format.  This function can use
bdrv_read() directly since the the read is done on sector boundary.

Signed-off-by: Michael Tokarev <m...@tls.msk.ru>
---
 block.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/block.c b/block.c
index b88ee90..6b5bcaf 100644
--- a/block.c
+++ b/block.c
@@ -469,7 +469,7 @@ static int find_image_format(const char *filename, 
BlockDriver **pdrv)
         return ret;
     }
 
-    ret = bdrv_pread(bs, 0, buf, sizeof(buf));
+    ret = bdrv_read(bs, 0, buf, sizeof(buf) / BDRV_BLOCK_SIZE);
     bdrv_delete(bs);
     if (ret < 0) {
         *pdrv = NULL;
-- 
1.7.9.1


Reply via email to