qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Possible reference leak in device_set_realized(...)
@ 2015-12-31 18:13 Ilya Lesokhin
  2016-01-01 22:37 ` Paolo Bonzini
  0 siblings, 1 reply; 4+ messages in thread
From: Ilya Lesokhin @ 2015-12-31 18:13 UTC (permalink / raw)
  To: qemu-devel@nongnu.org; +Cc: Haggai Eran, Knut Omang

[-- Attachment #1: Type: text/plain, Size: 1192 bytes --]

Hi,
I’m working on SRIOV support for VFIO and I’m suffering from a reference leak.
I’m using Knut Omang’s patches for SRIOV[1].

When the VF’s are enabled I call
pci_create(…) and then object_property_set_bool(OBJECT(&dev->qdev), true, "realized", &local_err);
and when the VF’s are disabled I call
object_property_set_bool(OBJECT(&dev->exp.sriov_pf.vf[i]->qdev), false, "realized", &local_err);
Following that sequence of events, the VFIO instance_finalize function is never called.

It seems that the leaked reference is created by object_property_add_child(…) which called by device_set_realized(…)
When the realized property is set.
Looking at the code of device_set_realized(…) I don’t see anything that might remove the reference taken by
object_property_add_child(…), when realized is set to false.

Does anyone know how this reference is supposed to be released?
Is object_finalize_child_property(…) supposed to be triggered somehow?

I was able to overcome this issue by calling object_unparent on my device but I’m not sure that the correct way of fixing it.

Thanks,
Ilya

[1] https://github.com/knuto/qemu/tree/sriov_patches_v6

[-- Attachment #2: Type: text/html, Size: 4436 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-01-12 12:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-31 18:13 [Qemu-devel] Possible reference leak in device_set_realized(...) Ilya Lesokhin
2016-01-01 22:37 ` Paolo Bonzini
2016-01-12 10:44   ` Knut Omang
2016-01-12 12:00     ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).