[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 25/40] memory: add ref/unref
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH 25/40] memory: add ref/unref |
Date: |
Wed, 8 May 2013 11:05:08 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Tue, May 07, 2013 at 04:17:03PM +0200, Paolo Bonzini wrote:
> Signed-off-by: Paolo Bonzini <address@hidden>
> ---
> include/exec/memory.h | 34 ++++++++++++++++++++++++++++++++++
> memory.c | 14 ++++++++++++++
> 2 files changed, 48 insertions(+), 0 deletions(-)
>
> diff --git a/include/exec/memory.h b/include/exec/memory.h
> index 5c20bac..ebac085 100644
> --- a/include/exec/memory.h
> +++ b/include/exec/memory.h
> @@ -253,6 +253,40 @@ struct MemoryListener {
> void memory_region_init(MemoryRegion *mr,
> const char *name,
> uint64_t size);
> +
> +/**
> + * memory_region_ref: Add 1 to a memory region's reference count
> + *
> + * Whenever memory regions are accessed outside the BQL, they need to be
> + * preserved against hot-unplug. MemoryRegions actually do not have their
> + * own reference count; they piggyback on a QOM object, their "owner".
> + * This function adds a reference to the owner.
> + *
> + * All MemoryRegions must have an owner if they can disappear, even if the
> + * device they belong to operates exclusively under the BQL. This is because
> + * the region could be returned at any time by memory_region_find, and this
> + * is usually under guest control.
> + *
> + * @mr: the #MemoryRegion to be initialized
s/to be initialized//
> + * @name: used for debugging; not visible to the user or ABI
> + * @size: size of the region; any subregions beyond this size will be clipped
Copy-pasted. These can be deleted.
> + */
> +void memory_region_ref(MemoryRegion *mr);
> +
> +/**
> + * memory_region_ref: Remove 1 to a memory region's reference count
s/memory_region_ref/memory_region_unref/
> + *
> + * Whenever memory regions are accessed outside the BQL, they need to be
> + * preserved against hot-unplug. MemoryRegions actually do not have their
> + * own reference count; they piggyback on a QOM object, their "owner".
> + * This function removes a reference to the owner and possibly destroys it.
> + *
> + * @mr: the #MemoryRegion to be initialized
> + * @name: used for debugging; not visible to the user or ABI
> + * @size: size of the region; any subregions beyond this size will be clipped
Same here.
- Re: [Qemu-devel] [PATCH 20/40] pci: use memory core for iommu support, (continued)
- [Qemu-devel] [PATCH 19/40] dma: eliminate old-style IOMMU support, Paolo Bonzini, 2013/05/07
- [Qemu-devel] [PATCH 21/40] spapr_vio: take care of creating our own AddressSpace/DMAContext, Paolo Bonzini, 2013/05/07
- [Qemu-devel] [PATCH 26/40] memory: add ref/unref calls, Paolo Bonzini, 2013/05/07
- [Qemu-devel] [PATCH 28/40] sysbus: set owner for MMIO regions, Paolo Bonzini, 2013/05/07
- [Qemu-devel] [PATCH 27/40] pci: set owner for BARs, Paolo Bonzini, 2013/05/07
- [Qemu-devel] [PATCH 29/40] acpi: add memory_region_set_owner calls, Paolo Bonzini, 2013/05/07
- [Qemu-devel] [PATCH 16/40] spapr: convert TCE API to use an opaque type, Paolo Bonzini, 2013/05/07
- [Qemu-devel] [PATCH 25/40] memory: add ref/unref, Paolo Bonzini, 2013/05/07
- Re: [Qemu-devel] [PATCH 25/40] memory: add ref/unref,
Stefan Hajnoczi <=
- [Qemu-devel] [PATCH 23/40] memory: give name to every AddressSpace, Paolo Bonzini, 2013/05/07
- [Qemu-devel] [PATCH 04/40] memory: Rename readable flag to romd_mode, Paolo Bonzini, 2013/05/07
[Qemu-devel] [PATCH 06/40] memory: make memory_global_sync_dirty_bitmap take an AddressSpace, Paolo Bonzini, 2013/05/07
[Qemu-devel] [PATCH 08/40] memory: limit sections in the radix tree to the actual address space size, Paolo Bonzini, 2013/05/07