Re: [PATCH 1/5] qom: adopt rwlock to protect accessing dev from removing it

2012-07-26 Thread liu ping fan
On Wed, Jul 25, 2012 at 5:08 PM, Paolo Bonzini pbonz...@redhat.com wrote: Il 25/07/2012 05:31, Liu Ping Fan ha scritto: From: Liu Ping Fan pingf...@linux.vnet.ibm.com rwlock: qemu_device_tree_mutex rd side: --device_del(destruction of device will be postphoned until unplug ack

Re: [PATCH 1/5] qom: adopt rwlock to protect accessing dev from removing it

2012-07-26 Thread Avi Kivity
On 07/26/2012 03:56 PM, liu ping fan wrote: On Wed, Jul 25, 2012 at 5:08 PM, Paolo Bonzini pbonz...@redhat.com wrote: Il 25/07/2012 05:31, Liu Ping Fan ha scritto: From: Liu Ping Fan pingf...@linux.vnet.ibm.com rwlock: qemu_device_tree_mutex rd side: --device_del(destruction of device

Re: [PATCH 1/5] qom: adopt rwlock to protect accessing dev from removing it

2012-07-26 Thread liu ping fan
On Thu, Jul 26, 2012 at 9:00 PM, Avi Kivity a...@redhat.com wrote: On 07/26/2012 03:56 PM, liu ping fan wrote: On Wed, Jul 25, 2012 at 5:08 PM, Paolo Bonzini pbonz...@redhat.com wrote: Il 25/07/2012 05:31, Liu Ping Fan ha scritto: From: Liu Ping Fan pingf...@linux.vnet.ibm.com rwlock:

Re: [PATCH 1/5] qom: adopt rwlock to protect accessing dev from removing it

2012-07-26 Thread Avi Kivity
On 07/26/2012 04:14 PM, liu ping fan wrote: From the description above, I don't see why it can't be a mutex. Searching in the device tree (or MemoryRegion view) can be often in parallel, especially in mmio-dispatch code path In mmio dispatch we have a pointer to the object, we don't need to

Re: [PATCH 1/5] qom: adopt rwlock to protect accessing dev from removing it

2012-07-26 Thread liu ping fan
On Thu, Jul 26, 2012 at 9:15 PM, Avi Kivity a...@redhat.com wrote: On 07/26/2012 04:14 PM, liu ping fan wrote: From the description above, I don't see why it can't be a mutex. Searching in the device tree (or MemoryRegion view) can be often in parallel, especially in mmio-dispatch code path

Re: [PATCH 1/5] qom: adopt rwlock to protect accessing dev from removing it

2012-07-26 Thread Avi Kivity
On 07/26/2012 04:21 PM, liu ping fan wrote: On Thu, Jul 26, 2012 at 9:15 PM, Avi Kivity a...@redhat.com wrote: On 07/26/2012 04:14 PM, liu ping fan wrote: From the description above, I don't see why it can't be a mutex. Searching in the device tree (or MemoryRegion view) can be often in

Re: [PATCH 1/5] qom: adopt rwlock to protect accessing dev from removing it

2012-07-25 Thread Paolo Bonzini
Il 25/07/2012 05:31, Liu Ping Fan ha scritto: From: Liu Ping Fan pingf...@linux.vnet.ibm.com rwlock: qemu_device_tree_mutex rd side: --device_del(destruction of device will be postphoned until unplug ack from guest), --pci hot-unplug --iteration (qdev_reset_all) wr side:

[PATCH 1/5] qom: adopt rwlock to protect accessing dev from removing it

2012-07-24 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com rwlock: qemu_device_tree_mutex rd side: --device_del(destruction of device will be postphoned until unplug ack from guest), --pci hot-unplug --iteration (qdev_reset_all) wr side: --device_add Signed-off-by: Liu Ping Fan