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: Alexey Kardashevskiy
Subject: Re: [Qemu-devel] [PATCH qemu] RFC: memory/hmp: Print owners/parents in "info mtree"
Date: Fri, 20 Apr 2018 16:31:19 +1000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0

On 19/4/18 8:33 pm, Paolo Bonzini wrote:
> 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?


Not sure I am following. It did crash, this is why I replaced the assert to
make qom-get working.


>> 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.

ookay.


-- 
Alexey



reply via email to

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