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