[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] qapi: Fix regression with '-netdev ?'
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH] qapi: Fix regression with '-netdev ?' |
Date: |
Wed, 14 Oct 2015 16:28:58 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
On 10/14/2015 10:30 AM, Eric Blake wrote:
> Commit e36c714e causes 'qemu -netdev ?' to dump core, because the
> call to visit_end_union() is no longer conditional on whether
> *obj was allocated.
>
> Reported by Marc-André Lureau <address@hidden>
> Signed-off-by: Eric Blake <address@hidden>
> ---
> scripts/qapi-visit.py | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/scripts/qapi-visit.py b/scripts/qapi-visit.py
> index 9e99c3a..74748a2 100644
> --- a/scripts/qapi-visit.py
> +++ b/scripts/qapi-visit.py
> @@ -297,7 +297,9 @@ void visit_type_%(c_name)s(Visitor *v, %(c_name)s **obj,
> const char *name, Error
> out_obj:
> error_propagate(errp, err);
> err = NULL;
> - visit_end_union(v, !!(*obj)->u.data, &err);
> + if (*obj) {
> + visit_end_union(v, !!(*obj)->u.data, &err);
> + }
And of course, I managed to post a version that depends on patches not
in the tree yet. v2 coming up.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature