On 07/02/2017 21:01, Marc-André Lureau wrote:
> Hi
>
> ----- Original Message -----
>>
>>
>> On 02/02/2017 15:51, Marc-André Lureau wrote:
>>> This should eventually free all objects that are only referenced by
>>> their parents.
>>>
>>> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
>>> ---
>>> vl.c | 1 +
>>> 1 file changed, 1 insertion(+)
>>>
>>> diff --git a/vl.c b/vl.c
>>> index 0b72b12878..945df1d17f 100644
>>> --- a/vl.c
>>> +++ b/vl.c
>>> @@ -4640,6 +4640,7 @@ int main(int argc, char **argv, char **envp)
>>> audio_cleanup();
>>> monitor_cleanup();
>>> qemu_chr_cleanup();
>>> + object_unref(object_get_root());
>>
>> This seems dangerous. I'm pretty sure that a lot of non-hot-unpluggable
>> devices would leak or crash.
>
> make check is ok. Any suggestion what else to check?
Not sure... I would have to try with some logging to see what this
does. But it doesn't seem safe, most devices are really not meant to be
hot-removed.
> This patch was added so that /chardevs container is cleaned up (with
> the following patches). Perhaps I could be more conservative and only
> unref (oops unparent) /chardevs.
Yeah, that would work.
Paolo