summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorneel <neel@FreeBSD.org>2012-10-04 02:27:14 +0000
committerneel <neel@FreeBSD.org>2012-10-04 02:27:14 +0000
commit18dd2c0d511c600e708ac8f756e8e51151b43656 (patch)
tree15ee06b08211ba25bab098239ee01704254807a8 /lib
parentcdb0dba22bd5328fdb484a5ef8405149b9522c02 (diff)
downloadFreeBSD-src-18dd2c0d511c600e708ac8f756e8e51151b43656.zip
FreeBSD-src-18dd2c0d511c600e708ac8f756e8e51151b43656.tar.gz
Change vm_malloc() to map pages in the guest physical address space in 4KB
chunks. This breaks the assumption that the entire memory segment is contiguously allocated in the host physical address space. This also paves the way to satisfy the 4KB page allocations by requesting free pages from the VM subsystem as opposed to hard-partitioning host memory at boot time.
Diffstat (limited to 'lib')
-rw-r--r--lib/libvmmapi/vmmapi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libvmmapi/vmmapi.c b/lib/libvmmapi/vmmapi.c
index 78ed368..8364dd5 100644
--- a/lib/libvmmapi/vmmapi.c
+++ b/lib/libvmmapi/vmmapi.c
@@ -111,9 +111,10 @@ vm_destroy(struct vmctx *vm)
{
assert(vm != NULL);
- DESTROY(vm->name);
if (vm->fd >= 0)
close(vm->fd);
+ DESTROY(vm->name);
+
free(vm);
}
@@ -151,7 +152,6 @@ vm_get_memory_seg(struct vmctx *ctx, vm_paddr_t gpa,
bzero(&seg, sizeof(seg));
seg.gpa = gpa;
error = ioctl(ctx->fd, VM_GET_MEMORY_SEG, &seg);
- *ret_hpa = seg.hpa;
*ret_len = seg.len;
return (error);
}
OpenPOWER on IntegriCloud