qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/2] trace: fix "-trace file=..."


From: Eric Blake
Subject: Re: [PATCH 1/2] trace: fix "-trace file=..."
Date: Tue, 9 Feb 2021 13:35:12 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0

On 2/9/21 8:57 AM, Paolo Bonzini wrote:
> Because trace_opt_parse always deletes the options it has parsed,
> trace_init_file's call to qemu_find_opts_singleton always
> creates an empty -trace option group.  Therefore, the subsequent
> qemu_opt_get(opts, "file") always returns NULL.
> 
> To fix this, save the last "-trace file=..." option in a global
> variable and use it later in trace_init_file.
> 
> This is similar to what was done before commit 92eecfff32 ("trace:
> remove argument from trace_init_file", 2020-11-11), except contained
> within trace/control.c and without memory leaks.
> 
> Fixes: 92eecfff32 ("trace: remove argument from trace_init_file", 2020-11-11)
> Cc: stefanha@redhat.com
> Reported-by: armbru@redhat.com
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  trace/control.c | 13 +++++++------
>  1 file changed, 7 insertions(+), 6 deletions(-)
Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org




reply via email to

[Prev in Thread] Current Thread [Next in Thread]