On 12/17/10 15:27, Kevin Wolf wrote: > Am 16.12.2010 17:05, schrieb jes.soren...@redhat.com: >> From: Jes Sorensen <jes.soren...@redhat.com> >> >> In addition this adds missing braces to the function to be consistent >> with the coding style. >> >> Signed-off-by: Jes Sorensen <jes.soren...@redhat.com> >> --- >> block/qcow2.c | 61 >> ++++++++++++++++++++++++++++++++++++++++---------------- >> 1 files changed, 43 insertions(+), 18 deletions(-) >> >> diff --git a/block/qcow2.c b/block/qcow2.c >> index d7fd167..b4a9e5e 100644 >> --- a/block/qcow2.c >> +++ b/block/qcow2.c >> @@ -140,12 +140,14 @@ static int qcow2_read_extensions(BlockDriverState *bs, >> uint64_t start_offset, >> static int qcow2_open(BlockDriverState *bs, int flags) >> { >> BDRVQcowState *s = bs->opaque; >> - int len, i; >> + int len, i, ret = 0; >> QCowHeader header; >> uint64_t ext_end; >> >> - if (bdrv_pread(bs->file, 0, &header, sizeof(header)) != sizeof(header)) >> + if (bdrv_pread(bs->file, 0, &header, sizeof(header)) != sizeof(header)) >> { >> + ret = -EIO; >> goto fail; >> + } > > ret = bdrv_pread(...); > if (ret < 0) { > goto fail; > }
Hmmm I must have confused something and looked at a wrong pread function where it just returned -1 on error. I'll fix it. Thanks, Jes