From: Fam Zheng <famz@redhat.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>, qemu-block@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2 3/3] vmdk: Switch to heap arrays for vmdk_parent_open
Date: Wed, 9 Mar 2016 08:43:44 +0800 [thread overview]
Message-ID: <20160309004344.GA17947@ad.usersys.redhat.com> (raw)
In-Reply-To: <1457425476-32547-4-git-send-email-famz@redhat.com>
On Tue, 03/08 16:24, Fam Zheng wrote:
> Signed-off-by: Fam Zheng <famz@redhat.com>
> ---
> block/vmdk.c | 17 +++++++++++------
> 1 file changed, 11 insertions(+), 6 deletions(-)
>
> diff --git a/block/vmdk.c b/block/vmdk.c
> index c68f456..03be7f0 100644
> --- a/block/vmdk.c
> +++ b/block/vmdk.c
> @@ -343,15 +343,16 @@ static int vmdk_reopen_prepare(BDRVReopenState *state,
> static int vmdk_parent_open(BlockDriverState *bs)
> {
> char *p_name;
> - char desc[DESC_SIZE + 1];
> + char *desc;
> BDRVVmdkState *s = bs->opaque;
> int ret;
>
> - desc[DESC_SIZE] = '\0';
> + desc = g_malloc0(DESC_SIZE + 1);
> ret = bdrv_pread(bs->file->bs, s->desc_offset, desc, DESC_SIZE);
> if (ret < 0) {
> - return ret;
> + goto out;
> }
> + ret = 0;
Kevin, were you referring to this "ret = 0" in the cover letter? If so, it is
not useless, because ret was set to DESC_SIZE by bdrv_pread. :)
Fam
next prev parent reply other threads:[~2016-03-09 0:43 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-08 8:24 [Qemu-devel] [PATCH v2 0/3] vmdk: Move descriptor buffers to heap Fam Zheng
2016-03-08 8:24 ` [Qemu-devel] [PATCH v2 1/3] vmdk: Switch to heap arrays for vmdk_write_cid Fam Zheng
2016-03-08 8:24 ` [Qemu-devel] [PATCH v2 2/3] vmdk: Switch to heap arrays for vmdk_read_cid Fam Zheng
2016-03-08 8:24 ` [Qemu-devel] [PATCH v2 3/3] vmdk: Switch to heap arrays for vmdk_parent_open Fam Zheng
2016-03-09 0:43 ` Fam Zheng [this message]
2016-03-09 9:50 ` Kevin Wolf
2016-03-10 1:53 ` Fam Zheng
2016-03-08 12:36 ` [Qemu-devel] [PATCH v2 0/3] vmdk: Move descriptor buffers to heap Paolo Bonzini
2016-03-08 13:18 ` Kevin Wolf
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=20160309004344.GA17947@ad.usersys.redhat.com \
--to=famz@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.