[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] block: Fix build with tracing enabled
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH] block: Fix build with tracing enabled |
Date: |
Mon, 22 Apr 2013 09:57:11 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130402 Thunderbird/17.0.5 |
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 <address@hidden>
> ---
> 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 <address@hidden>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature