aboutsummaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2016-06-20 18:24:02 +0200
committerKevin Wolf <kwolf@redhat.com>2016-07-05 16:46:27 +0200
commitcf2ab8fc345c34f8671fade9230746610e4fc340 (patch)
tree12cde9139b26e6ddc0f0e041bc48a81489246e8e /block.c
parent18d51c4bac9d96302035de0faa11e3df98358f45 (diff)
block: Convert bdrv_pread(v) to BdrvChild
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block.c')
-rw-r--r--block.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/block.c b/block.c
index 7603a0b5db..823ff1d7ab 100644
--- a/block.c
+++ b/block.c
@@ -536,9 +536,10 @@ BlockDriver *bdrv_probe_all(const uint8_t *buf, int buf_size,
return drv;
}
-static int find_image_format(BlockDriverState *bs, const char *filename,
+static int find_image_format(BdrvChild *file, const char *filename,
BlockDriver **pdrv, Error **errp)
{
+ BlockDriverState *bs = file->bs;
BlockDriver *drv;
uint8_t buf[BLOCK_PROBE_BUF_SIZE];
int ret = 0;
@@ -549,7 +550,7 @@ static int find_image_format(BlockDriverState *bs, const char *filename,
return ret;
}
- ret = bdrv_pread(bs, 0, buf, sizeof(buf));
+ ret = bdrv_pread(file, 0, buf, sizeof(buf));
if (ret < 0) {
error_setg_errno(errp, -ret, "Could not read image for determining its "
"format");
@@ -1652,7 +1653,7 @@ static BlockDriverState *bdrv_open_inherit(const char *filename,
/* Image format probing */
bs->probed = !drv;
if (!drv && file) {
- ret = find_image_format(file->bs, filename, &drv, &local_err);
+ ret = find_image_format(file, filename, &drv, &local_err);
if (ret < 0) {
goto fail;
}