# HG changeset patch # User Jerone Young <[EMAIL PROTECTED]> # Date 1193849564 18000 # Node ID 4d8d1bd969dc9a1f2ad3b983d7e63172bee64fd4 # Parent 70351a5f6af9602918e3e2475ca97574a83dbcac Move kvm_set_tss_addr to kvmctl-x86.c
Signed-off-by: Jerone Young <[EMAIL PROTECTED]> diff --git a/libkvm/libkvm-x86.c b/libkvm/libkvm-x86.c --- a/libkvm/libkvm-x86.c +++ b/libkvm/libkvm-x86.c @@ -182,3 +182,22 @@ int kvm_alloc_userspace_memory(kvm_conte #endif + +int kvm_set_tss_addr(kvm_context_t kvm, unsigned long addr) +{ +#ifdef KVM_CAP_SET_TSS_ADDR + int r; + + r = ioctl(kvm->fd, KVM_CHECK_EXTENSION, KVM_CAP_SET_TSS_ADDR); + if (r > 0) { + r = ioctl(kvm->vm_fd, KVM_SET_TSS_ADDR, addr); + if (r == -1) { + fprintf(stderr, "kvm_set_tss_addr: %m\n"); + return -errno; + } + return 0; + } +#endif + return -ENOSYS; +} + diff --git a/libkvm/libkvm-x86.h b/libkvm/libkvm-x86.h --- a/libkvm/libkvm-x86.h +++ b/libkvm/libkvm-x86.h @@ -13,5 +13,6 @@ int kvm_alloc_kernel_memory(kvm_context_ void **vm_mem); int kvm_alloc_userspace_memory(kvm_context_t kvm, unsigned long memory, void **vm_mem); +int kvm_set_tss_addr(kvm_context_t kvm, unsigned long addr); #endif diff --git a/libkvm/libkvm.c b/libkvm/libkvm.c --- a/libkvm/libkvm.c +++ b/libkvm/libkvm.c @@ -328,23 +328,6 @@ int kvm_create_vm(kvm_context_t kvm) return 0; } -int kvm_set_tss_addr(kvm_context_t kvm, unsigned long addr) -{ -#ifdef KVM_CAP_SET_TSS_ADDR - int r; - - r = ioctl(kvm->fd, KVM_CHECK_EXTENSION, KVM_CAP_SET_TSS_ADDR); - if (r > 0) { - r = ioctl(kvm->vm_fd, KVM_SET_TSS_ADDR, addr); - if (r == -1) { - fprintf(stderr, "kvm_set_tss_addr: %m\n"); - return -errno; - } - return 0; - } -#endif - return -ENOSYS; -} static int kvm_init_tss(kvm_context_t kvm) { diff --git a/libkvm/libkvm.h b/libkvm/libkvm.h --- a/libkvm/libkvm.h +++ b/libkvm/libkvm.h @@ -446,7 +446,6 @@ int kvm_dump_vcpu(kvm_context_t kvm, int */ void kvm_show_regs(kvm_context_t kvm, int vcpu); -int kvm_set_tss_addr(kvm_context_t kvm, unsigned long addr); void *kvm_create_phys_mem(kvm_context_t, unsigned long phys_start, unsigned long len, int log, int writable); ------------------------------------------------------------------------- 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