* [Qemu-devel] [PATCH] block: Fix build with tracing enabled
@ 2013-04-22 15:48 Kevin Wolf
2013-04-22 15:52 ` Andreas Färber
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Kevin Wolf @ 2013-04-22 15:48 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf, anthony, afaerber, stefanha
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);
if (use_bdrv_whitelist && !bdrv_is_whitelisted(drv)) {
return -ENOTSUP;
@@ -698,12 +704,6 @@ static int bdrv_open_common(BlockDriverState *bs, BlockDriverState *file,
bdrv_enable_copy_on_read(bs);
}
- if (file != NULL) {
- filename = file->filename;
- } else {
- filename = qdict_get_try_str(options, "filename");
- }
-
if (filename != NULL) {
pstrcpy(bs->filename, sizeof(bs->filename), filename);
} else {
--
1.8.1.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] block: Fix build with tracing enabled
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
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Andreas Färber @ 2013-04-22 15:52 UTC (permalink / raw)
To: Kevin Wolf; +Cc: anthony, qemu-devel, stefanha
Am 22.04.2013 17:48, schrieb Kevin Wolf:
> 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>
Tested-by: Andreas Färber <afaerber@suse.de>
and queued a copy on qom-cpu until it gets applied.
Thanks,
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] block: Fix build with tracing enabled
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
2013-04-23 7:05 ` Stefan Hajnoczi
2013-04-24 18:25 ` Anthony Liguori
3 siblings, 0 replies; 5+ messages in thread
From: Eric Blake @ 2013-04-22 15:57 UTC (permalink / raw)
To: Kevin Wolf; +Cc: stefanha, qemu-devel, anthony, afaerber
[-- 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 --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] block: Fix build with tracing enabled
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
@ 2013-04-23 7:05 ` Stefan Hajnoczi
2013-04-24 18:25 ` Anthony Liguori
3 siblings, 0 replies; 5+ messages in thread
From: Stefan Hajnoczi @ 2013-04-23 7:05 UTC (permalink / raw)
To: Kevin Wolf; +Cc: qemu-devel, anthony, afaerber
On Mon, Apr 22, 2013 at 05:48:40PM +0200, 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(-)
Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block
Stefan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] block: Fix build with tracing enabled
2013-04-22 15:48 [Qemu-devel] [PATCH] block: Fix build with tracing enabled Kevin Wolf
` (2 preceding siblings ...)
2013-04-23 7:05 ` Stefan Hajnoczi
@ 2013-04-24 18:25 ` Anthony Liguori
3 siblings, 0 replies; 5+ messages in thread
From: Anthony Liguori @ 2013-04-24 18:25 UTC (permalink / raw)
To: Kevin Wolf, qemu-devel; +Cc: stefanha, afaerber, anthony
Applied. Thanks.
Regards,
Anthony Liguori
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-04-24 18:25 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2013-04-23 7:05 ` Stefan Hajnoczi
2013-04-24 18:25 ` Anthony Liguori
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).