Re: [Qemu-devel] [PATCH] qom: removal of link property need to release its target

2012-08-23 Thread liu ping fan
On Thu, Aug 23, 2012 at 12:36 AM, Anthony Liguori anth...@codemonkey.ws wrote: Paolo Bonzini pbonz...@redhat.com writes: Il 22/08/2012 05:02, Liu Ping Fan ha scritto: From: Liu Ping Fan pingf...@linux.vnet.ibm.com Currently, link property's target is only managed by

Re: [Qemu-devel] [PATCH] qom: removal of link property need to release its target

2012-08-23 Thread Paolo Bonzini
Il 23/08/2012 00:40, Anthony Liguori ha scritto: I don't really like the notion of a forced eject where we delete a device when the guest is using it and not cooperative. I don't see the benefit at all. Forcing detachment of a BlockDriverState from a device followed by EIO being reported

Re: [Qemu-devel] [PATCH] qom: removal of link property need to release its target

2012-08-22 Thread Paolo Bonzini
Il 22/08/2012 05:02, Liu Ping Fan ha scritto: From: Liu Ping Fan pingf...@linux.vnet.ibm.com Currently, link property's target is only managed by object_set_link_property(). This will raise such issue that when the property is finalized, its target has no opportunity to release. Fix this

Re: [Qemu-devel] [PATCH] qom: removal of link property need to release its target

2012-08-22 Thread Anthony Liguori
Paolo Bonzini pbonz...@redhat.com writes: Il 22/08/2012 05:02, Liu Ping Fan ha scritto: From: Liu Ping Fan pingf...@linux.vnet.ibm.com Currently, link property's target is only managed by object_set_link_property(). This will raise such issue that when the property is finalized, its target

Re: [Qemu-devel] [PATCH] qom: removal of link property need to release its target

2012-08-22 Thread Andreas Färber
Am 22.08.2012 05:02, schrieb Liu Ping Fan: From: Liu Ping Fan pingf...@linux.vnet.ibm.com Currently, link property's target is only managed by object_set_link_property(). This will raise such issue that when the property is finalized, its target has no opportunity to release. Fix this

Re: [Qemu-devel] [PATCH] qom: removal of link property need to release its target

2012-08-22 Thread Paolo Bonzini
Il 22/08/2012 18:36, Anthony Liguori ha scritto: We can fix this by adding an extra reference in add_link but this creates yet another problem with hotplug. Specificially, qdev_free() asserts that ref 0 because there is now a reference being held by the bus. I think that's correct.

Re: [Qemu-devel] [PATCH] qom: removal of link property need to release its target

2012-08-22 Thread Anthony Liguori
Hi Paolo, Paolo Bonzini pbonz...@redhat.com writes: Il 22/08/2012 18:36, Anthony Liguori ha scritto: We can fix this by adding an extra reference in add_link but this creates yet another problem with hotplug. Specificially, qdev_free() asserts that ref 0 because there is now a reference

Re: [Qemu-devel] [PATCH] qom: removal of link property need to release its target

2012-08-22 Thread Paolo Bonzini
Il 22/08/2012 23:41, Anthony Liguori ha scritto: (1) should drop the floating reference and the reference held by the container. That's what I meant by calling object_unparent in qmp_device_del. (2) should simply remove the device from the bus (further releasing a reference). (3)

[Qemu-devel] [PATCH] qom: removal of link property need to release its target

2012-08-21 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com Currently, link property's target is only managed by object_set_link_property(). This will raise such issue that when the property is finalized, its target has no opportunity to release. Fix this issue by introduce object_finalize_link_property()