From: Eric Blake <eblake@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: stefanha@redhat.com, qemu-devel@nongnu.org,
anthony@codemonkey.ws, afaerber@suse.de
Subject: Re: [Qemu-devel] [PATCH] block: Fix build with tracing enabled
Date: Mon, 22 Apr 2013 09:57:11 -0600 [thread overview]
Message-ID: <51755DD7.6040102@redhat.com> (raw)
In-Reply-To: <1366645720-11384-1-git-send-email-kwolf@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1286 bytes --]
On 04/22/2013 09:48 AM, Kevin Wolf wrote:
> filename was still uninitialised when it's used as a parameter to a
> tracing function, so let's move the initialisation. Also, commit c2ad1b0c
> forgot to add a NULL check, which this patch adds while we're at it.
>
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
> block.c | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/block.c b/block.c
> index 819eb4e..aa9a533 100644
> --- a/block.c
> +++ b/block.c
> @@ -676,7 +676,13 @@ static int bdrv_open_common(BlockDriverState *bs, BlockDriverState *file,
> assert(bs->file == NULL);
> assert(options != NULL && bs->options != options);
>
> - trace_bdrv_open_common(bs, filename, flags, drv->format_name);
> + if (file != NULL) {
> + filename = file->filename;
> + } else {
> + filename = qdict_get_try_str(options, "filename");
> + }
> +
> + trace_bdrv_open_common(bs, filename ?: "", flags, drv->format_name);
Yet another case of a non-C99 gcc extension; but as this is not the
first use, I'll overlook it, and give:
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 621 bytes --]
next prev parent reply other threads:[~2013-04-22 15:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-22 15:48 [Qemu-devel] [PATCH] block: Fix build with tracing enabled Kevin Wolf
2013-04-22 15:52 ` Andreas Färber
2013-04-22 15:57 ` Eric Blake [this message]
2013-04-23 7:05 ` Stefan Hajnoczi
2013-04-24 18:25 ` Anthony Liguori
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=51755DD7.6040102@redhat.com \
--to=eblake@redhat.com \
--cc=afaerber@suse.de \
--cc=anthony@codemonkey.ws \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/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.