[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 8/8] qemu_ram_resize: document assumptions
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PATCH v3 8/8] qemu_ram_resize: document assumptions |
Date: |
Wed, 7 Jan 2015 21:49:26 +0200 |
Document that when using qemu_ram_resize for anything mapped into guest
address space, it's the job of the resize function to update guest
visible state.
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
exec.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/exec.c b/exec.c
index 71af138..58ac6d6 100644
--- a/exec.c
+++ b/exec.c
@@ -1301,6 +1301,13 @@ static int memory_try_enable_merging(void *addr, size_t
len)
return qemu_madvise(addr, len, QEMU_MADV_MERGEABLE);
}
+/* Only legal before guest might have detected the memory size: e.g. on
+ * incoming migration, or right after reset.
+ *
+ * As memory core doesn't know how is memory accessed, it is up to
+ * resize callback to update device state and/or add assertions to detect
+ * misuse, if necessary.
+ */
int qemu_ram_resize(ram_addr_t base, ram_addr_t newsize, Error **errp)
{
RAMBlock *block = find_ram_block(base);
--
MST
- [Qemu-devel] [PATCH v3 0/8] acpi: make ROMs resizeable, Michael S. Tsirkin, 2015/01/07
- [Qemu-devel] [PATCH v3 2/8] exec: cpu_physical_memory_set/clear_dirty_range, Michael S. Tsirkin, 2015/01/07
- [Qemu-devel] [PATCH v3 1/8] memory: add memory_region_set_size, Michael S. Tsirkin, 2015/01/07
- [Qemu-devel] [PATCH v3 3/8] exec: split length -> used_length/max_length, Michael S. Tsirkin, 2015/01/07
- [Qemu-devel] [PATCH v3 4/8] exec: qemu_ram_alloc_resizeable, qemu_ram_resize, Michael S. Tsirkin, 2015/01/07
- [Qemu-devel] [PATCH v3 5/8] arch_init: support resizing on incoming migration, Michael S. Tsirkin, 2015/01/07
- [Qemu-devel] [PATCH v3 6/8] memory: API to allocate resizeable RAM MR, Michael S. Tsirkin, 2015/01/07
- [Qemu-devel] [PATCH v3 7/8] acpi-build: make ROMs RAM blocks resizeable, Michael S. Tsirkin, 2015/01/07
- [Qemu-devel] [PATCH v3 8/8] qemu_ram_resize: document assumptions,
Michael S. Tsirkin <=
- Re: [Qemu-devel] [PATCH v3 0/8] acpi: make ROMs resizeable, Paolo Bonzini, 2015/01/07