From 0ad969fb3311b6f4a8cd6553cb17ac852bf2514c Mon Sep 17 00:00:00 2001 From: Uri Lublin Date: Tue, 8 Jan 2008 10:33:39 +0200 Subject: [PATCH] Phys_mem_bitmap: remove obsolete unused functions Obsoleted by ca3d8e095246e848a5ecd7600ff84106335b19e4. Signed-off-by: Uri Lublin Signed-off-by: Avi Kivity --- kvm/libkvm/libkvm.c | 51 --------------------------------------------------- qemu-kvm.c | 11 ----------- 2 files changed, 62 deletions(-) diff --git a/kvm/libkvm/libkvm.c b/kvm/libkvm/libkvm.c index 2bab780d6d..45f58d69f0 100644 --- a/kvm/libkvm/libkvm.c +++ b/kvm/libkvm/libkvm.c @@ -637,57 +637,6 @@ int kvm_get_dirty_pages_range(kvm_context_t kvm, unsigned long phys_addr, return 0; } -int kvm_get_mem_map(kvm_context_t kvm, unsigned long phys_addr, void *buf) -{ - int slot; - - slot = get_slot(phys_addr); -#ifdef KVM_GET_MEM_MAP - return kvm_get_map(kvm, KVM_GET_MEM_MAP, slot, buf); -#else /* not KVM_GET_MEM_MAP ==> fake it: all pages exist */ - unsigned long i, n, m, npages; - unsigned char v; - - if (slot >= KVM_MAX_NUM_MEM_REGIONS) { - errno = -EINVAL; - return -1; - } - npages = slots[slot].len / PAGE_SIZE; - n = npages / 8; - m = npages % 8; - memset(buf, 0xff, n); /* all pages exist */ - v = 0; - for (i=0; i<=m; i++) /* last byte may not be "aligned" */ - v |= 1<<(7-i); - if (v) - *(unsigned char*)(buf+n) = v; - return 0; -#endif /* KVM_GET_MEM_MAP */ -} - -int kvm_get_mem_map_range(kvm_context_t kvm, unsigned long phys_addr, - unsigned long len, void *buf, void *opaque, - int (*cb)(unsigned long addr,unsigned long len, - void* bitmap, void* opaque)) -{ - int i; - int r; - unsigned long end_addr = phys_addr + len; - - for (i = 0; i < KVM_MAX_NUM_MEM_REGIONS; ++i) { - if (slots[i].len && slots[i].phys_addr >= phys_addr && - (slots[i].phys_addr + slots[i].len) <= end_addr) { - r = kvm_get_mem_map(kvm, slots[i].phys_addr, buf); - if (r) - return r; - r = cb(slots[i].phys_addr, slots[i].len, buf, opaque); - if (r) - return r; - } - } - return 0; -} - #ifdef KVM_CAP_IRQCHIP int kvm_set_irq_level(kvm_context_t kvm, int irq, int level) diff --git a/qemu-kvm.c b/qemu-kvm.c index 61142bdb86..dd8468691f 100644 --- a/qemu-kvm.c +++ b/qemu-kvm.c @@ -722,17 +722,6 @@ int kvm_update_dirty_pages_log(void) return r; } -int kvm_get_phys_ram_bitmap_cb(unsigned long start, unsigned long len, - void *local_bitmap, void *qemu_bitmap) -{ - unsigned int bsize = ((len/TARGET_PAGE_SIZE) + 7) / 8; - unsigned int offset = ((start/TARGET_PAGE_SIZE) + 7) / 8; - - memcpy(qemu_bitmap + offset, local_bitmap, bsize); - - return 0; -} - int kvm_get_phys_ram_page_bitmap(unsigned char *bitmap) { unsigned int bsize = BITMAP_SIZE(phys_ram_size); -- 2.11.4.GIT