# HG changeset patch # User Jerone Young <[EMAIL PROTECTED]> # Date 1193849564 18000 # Node ID a809d39bd74d33d221dd98cc6afa02d9a35889a4 # Parent 4d8d1bd969dc9a1f2ad3b983d7e63172bee64fd4 imported patch move_kvm_set_init_tss
diff --git a/libkvm/libkvm-x86.c b/libkvm/libkvm-x86.c --- a/libkvm/libkvm-x86.c +++ b/libkvm/libkvm-x86.c @@ -3,6 +3,7 @@ #include <stropts.h> #include <sys/mman.h> #include <stdio.h> +#include <errno.h> int kvm_alloc_kernel_memory(kvm_context_t kvm, unsigned long memory, void **vm_mem) @@ -201,3 +202,25 @@ int kvm_set_tss_addr(kvm_context_t kvm, return -ENOSYS; } +static int kvm_init_tss(kvm_context_t kvm) +{ +#ifdef KVM_CAP_SET_TSS_ADDR + int r; + + r = ioctl(kvm->fd, KVM_CHECK_EXTENSION, KVM_CAP_SET_TSS_ADDR); + if (r > 0) { + /* + * this address is 3 pages before the bios, and the bios should present + * as unavaible memory + */ + r = kvm_set_tss_addr(kvm, 0xfffbd000); + if (r < 0) { + printf("kvm_init_tss: unable to set tss addr\n"); + return r; + } + + } +#endif + return 0; +} + diff --git a/libkvm/libkvm.c b/libkvm/libkvm.c --- a/libkvm/libkvm.c +++ b/libkvm/libkvm.c @@ -328,28 +328,6 @@ int kvm_create_vm(kvm_context_t kvm) return 0; } - -static int kvm_init_tss(kvm_context_t kvm) -{ -#ifdef KVM_CAP_SET_TSS_ADDR - int r; - - r = ioctl(kvm->fd, KVM_CHECK_EXTENSION, KVM_CAP_SET_TSS_ADDR); - if (r > 0) { - /* - * this address is 3 pages before the bios, and the bios should present - * as unavaible memory - */ - r = kvm_set_tss_addr(kvm, 0xfffbd000); - if (r < 0) { - printf("kvm_init_tss: unable to set tss addr\n"); - return r; - } - - } -#endif - return 0; -} static int kvm_create_default_phys_mem(kvm_context_t kvm, unsigned long phys_mem_bytes, ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel