diff options
author | Max Bruning <max@joyent.com> | 2011-08-11 08:33:15 -0700 |
---|---|---|
committer | Max Bruning <max@joyent.com> | 2011-08-11 08:33:15 -0700 |
commit | 9c7ad59df4f8356c3e771f5d55d604013ade9389 (patch) | |
tree | 7c29f250ef81f2366c95d685957a04dec20a0fc3 | |
parent | 9f54119bdf8b68482bc8f7437edd04e58ba6be44 (diff) | |
download | illumos-kvm-9c7ad59df4f8356c3e771f5d55d604013ade9389.tar.gz |
HVM-553 Qemu isn't cleaning up properly on kvm_run failure with errno 22 (EINVAL)
-rw-r--r-- | kvm_x86.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -57,6 +57,7 @@ extern caddr_t smmap64(caddr_t addr, size_t len, int prot, int flags, int fd, off_t pos); +extern int memcntl(caddr_t, size_t, int, caddr_t, int, int); extern int lwp_sigmask(int, uint_t, uint_t, uint_t, uint_t); extern uint64_t cpu_freq_hz; @@ -4924,6 +4925,10 @@ kvm_arch_prepare_memory_region(struct kvm *kvm, * pages in the map. We'll touch the pages so they get * allocated here. */ + i = memcntl(userspace_addr, (size_t)(npages * PAGESIZE), + MC_LOCK, 0, PROT_READ | PROT_WRITE, 0); + if (i != 0) + return (i); for (i = 0; i < npages; i++) { if (copyout(empty_zero_page, userspace_addr + (i * PAGESIZE), sizeof (empty_zero_page))) { |