qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH qemu] RFC: memory/hmp: Print owners/parents in "


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH qemu] RFC: memory/hmp: Print owners/parents in "info mtree"
Date: Thu, 19 Apr 2018 12:33:25 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0

On 19/04/2018 04:41, Alexey Kardashevskiy wrote:
> it just seems to
> be a real case and majority of object_get_canonical_path_component() users
> do not test the returned pointer.
> 
> ===================
> diff --git a/qom/object.c b/qom/object.c
> index 4677951..0c2d5c2 100644
> --- a/qom/object.c
> +++ b/qom/object.c
> @@ -1645,7 +1645,9 @@ gchar *object_get_canonical_path_component(Object *obj)
>      GHashTableIter iter;
> 
>      g_assert(obj);
> -    g_assert(obj->parent != NULL);

I agree but why wouldn't the caller have crashed anyway on this assertion?

> as QMP crashes QEMU with this:
> 
> {"execute": "qom-get", "arguments": {"path":
> "/machine/unattached/device[3]/smram[0]", "property": "container"}}
> 
> with the patch it returns:
> 
> {'return': '/<no-parent>/mem-container-smram[0]'}

The root cause of this is that the accelerator object is not added to
the QOM object tree.

Paolo



reply via email to

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