Re: [PATCH 06/15] memory: use refcnt to manage MemoryRegion

2012-08-12 Thread Avi Kivity
On 08/10/2012 09:44 AM, liu ping fan wrote: In the previous discussion, you have suggest add dev-ref++ in core_region_add. But I think, if we can move it to higher layer -- memory_region_{add,del}_subregion, so we can avoid to duplicate do this in other xx_region_add. Why would other memory

Re: [PATCH 06/15] memory: use refcnt to manage MemoryRegion

2012-08-10 Thread liu ping fan
On Thu, Aug 9, 2012 at 4:38 PM, Avi Kivity a...@redhat.com wrote: On 08/09/2012 10:27 AM, liu ping fan wrote: On Wed, Aug 8, 2012 at 5:20 PM, Avi Kivity a...@redhat.com wrote: On 08/08/2012 09:25 AM, Liu Ping Fan wrote: From: Liu Ping Fan pingf...@linux.vnet.ibm.com Using refcnt for mr, so

Re: [PATCH 06/15] memory: use refcnt to manage MemoryRegion

2012-08-09 Thread liu ping fan
On Wed, Aug 8, 2012 at 5:20 PM, Avi Kivity a...@redhat.com wrote: On 08/08/2012 09:25 AM, Liu Ping Fan wrote: From: Liu Ping Fan pingf...@linux.vnet.ibm.com Using refcnt for mr, so we can separate mr's life cycle management from refered object. When mr-ref 0-1, inc the refered object.

Re: [PATCH 06/15] memory: use refcnt to manage MemoryRegion

2012-08-09 Thread Avi Kivity
On 08/09/2012 10:27 AM, liu ping fan wrote: On Wed, Aug 8, 2012 at 5:20 PM, Avi Kivity a...@redhat.com wrote: On 08/08/2012 09:25 AM, Liu Ping Fan wrote: From: Liu Ping Fan pingf...@linux.vnet.ibm.com Using refcnt for mr, so we can separate mr's life cycle management from refered object.

[PATCH 06/15] memory: use refcnt to manage MemoryRegion

2012-08-08 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com Using refcnt for mr, so we can separate mr's life cycle management from refered object. When mr-ref 0-1, inc the refered object. When mr-ref 1-0, dec the refered object. The refered object can be DeviceStae, another mr, or other opaque.

Re: [PATCH 06/15] memory: use refcnt to manage MemoryRegion

2012-08-08 Thread Avi Kivity
On 08/08/2012 09:25 AM, Liu Ping Fan wrote: From: Liu Ping Fan pingf...@linux.vnet.ibm.com Using refcnt for mr, so we can separate mr's life cycle management from refered object. When mr-ref 0-1, inc the refered object. When mr-ref 1-0, dec the refered object. The refered object can