From: Jes Sorensen <Jes.Sorensen@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH 2/2] Add proper -errno error return values to qcow2_open()
Date: Fri, 17 Dec 2010 15:47:32 +0100 [thread overview]
Message-ID: <4D0B7804.2020504@redhat.com> (raw)
In-Reply-To: <4D0B7343.3080609@redhat.com>
On 12/17/10 15:27, Kevin Wolf wrote:
> Am 16.12.2010 17:05, schrieb Jes.Sorensen@redhat.com:
>> From: Jes Sorensen <Jes.Sorensen@redhat.com>
>>
>> In addition this adds missing braces to the function to be consistent
>> with the coding style.
>>
>> Signed-off-by: Jes Sorensen <Jes.Sorensen@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
prev parent reply other threads:[~2010-12-17 14:47 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-16 16:05 [Qemu-devel] [PATCH 0/2] qcow2 cleanups Jes.Sorensen
2010-12-16 16:05 ` [Qemu-devel] [PATCH 1/2] block/qcow2.c: rename qcow_ functions to qcow2_ Jes.Sorensen
2010-12-17 14:20 ` [Qemu-devel] " Kevin Wolf
2010-12-17 14:37 ` Jes Sorensen
2010-12-16 16:05 ` [Qemu-devel] [PATCH 2/2] Add proper -errno error return values to qcow2_open() Jes.Sorensen
2010-12-17 14:27 ` [Qemu-devel] " Kevin Wolf
2010-12-17 14:47 ` Jes Sorensen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D0B7804.2020504@redhat.com \
--to=jes.sorensen@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).