summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlauber Costa <glommer@redhat.com>2009-07-15 01:31:23 -0400
committerMarcelo Tosatti <mtosatti@redhat.com>2009-07-21 16:58:33 -0300
commitea906fb1e826a20ad4e576d713146d891b6d82d7 (patch)
tree283234e5b3cda456afa1eb4b0a751f509b71e8dd /kvm-all.c
parentremove kvm types from handle unhandled (diff)
downloadqemu-kvm-ea906fb1e826a20ad4e576d713146d891b6d82d7.tar.gz
qemu-kvm-ea906fb1e826a20ad4e576d713146d891b6d82d7.tar.bz2
qemu-kvm-ea906fb1e826a20ad4e576d713146d891b6d82d7.zip
reuse kvm_vm_ioctl
Start using kvm_vm_ioctl's code. For type safety, delete vm_fd from kvm_context entirely, so the compiler can play along with us helping to detect errors I might have made. Also, we were slightly different from qemu upstream in handling error code from ioctl, since we were always testing for -1, while kvm_vm_ioctl returns -errno. We already did this in most of the call sites, so this patch has the big advantage of simplifying call sites. Diffstat says: 4 files changed, 58 insertions(+), 134 deletions(-) Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'kvm-all.c')
-rw-r--r--kvm-all.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/kvm-all.c b/kvm-all.c
index 67908a74c..9373d991c 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -809,6 +809,7 @@ int kvm_ioctl(KVMState *s, int type, ...)
return ret;
}
+#endif
int kvm_vm_ioctl(KVMState *s, int type, ...)
{
@@ -827,6 +828,7 @@ int kvm_vm_ioctl(KVMState *s, int type, ...)
return ret;
}
+#ifdef KVM_UPSTREAM
int kvm_vcpu_ioctl(CPUState *env, int type, ...)
{
int ret;