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