From 4ff87573df3606856a92c14eef3393a63d736d11 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 25 Mar 2016 12:30:16 +0100 Subject: memory: remove qemu_get_ram_fd, qemu_set_ram_fd, qemu_ram_block_host_ptr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove direct uses of ram_addr_t and optimize memory_region_{get,set}_fd now that a MemoryRegion knows its RAMBlock directly. Reviewed-by: Marc-André Lureau Signed-off-by: Paolo Bonzini --- include/exec/memory.h | 11 +++++++++++ include/exec/ram_addr.h | 3 --- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/exec/memory.h b/include/exec/memory.h index f649697ee9..16784941b5 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -666,6 +666,17 @@ static inline bool memory_region_is_rom(MemoryRegion *mr) */ int memory_region_get_fd(MemoryRegion *mr); +/** + * memory_region_set_fd: Mark a RAM memory region as backed by a + * file descriptor. + * + * This function is typically used after memory_region_init_ram_ptr(). + * + * @mr: the memory region being queried. + * @fd: the file descriptor that backs @mr. + */ +void memory_region_set_fd(MemoryRegion *mr, int fd); + /** * memory_region_get_ram_ptr: Get a pointer into a RAM memory region. * diff --git a/include/exec/ram_addr.h b/include/exec/ram_addr.h index 5b6e1b8b86..2a9465da11 100644 --- a/include/exec/ram_addr.h +++ b/include/exec/ram_addr.h @@ -105,9 +105,6 @@ RAMBlock *qemu_ram_alloc_resizeable(ram_addr_t size, ram_addr_t max_size, uint64_t length, void *host), MemoryRegion *mr, Error **errp); -int qemu_get_ram_fd(ram_addr_t addr); -void qemu_set_ram_fd(ram_addr_t addr, int fd); -void *qemu_get_ram_block_host_ptr(ram_addr_t addr); void qemu_ram_free(RAMBlock *block); int qemu_ram_resize(RAMBlock *block, ram_addr_t newsize, Error **errp); -- cgit v1.2.3