aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGleb Natapov <gleb@redhat.com>2009-06-02 16:47:40 +0300
committerAvi Kivity <avi@redhat.com>2009-06-04 15:58:19 +0300
commit3d0223025efb8e971085445af55d5e804d3c1733 (patch)
tree6d0a55ec13e512e836089295a8962c93efabbe0d /target-ppc
parentkvm: Add irqfd support (diff)
downloadqemu-kvm-3d0223025efb8e971085445af55d5e804d3c1733.tar.gz
qemu-kvm-3d0223025efb8e971085445af55d5e804d3c1733.tar.bz2
qemu-kvm-3d0223025efb8e971085445af55d5e804d3c1733.zip
Do not use cpu_index in interface between libkvm and qemu
On vcpu creation cookie is returned which is used in future communication. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'target-ppc')
-rw-r--r--target-ppc/libkvm.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/target-ppc/libkvm.c b/target-ppc/libkvm.c
index 2dfff3b79..da93026f1 100644
--- a/target-ppc/libkvm.c
+++ b/target-ppc/libkvm.c
@@ -23,9 +23,11 @@
#include <stdio.h>
#include <inttypes.h>
-int handle_dcr(struct kvm_run *run, kvm_context_t kvm, int vcpu)
+int handle_dcr(kvm_vcpu_context_t vcpu)
{
int ret = 0;
+ struct kvm_run *run = vcpu->run;
+ kvm_context_t kvm = vcpu->kvm;
if (run->dcr.is_write)
ret = kvm->callbacks->powerpc_dcr_write(vcpu,
@@ -39,17 +41,17 @@ int handle_dcr(struct kvm_run *run, kvm_context_t kvm, int vcpu)
return ret;
}
-void kvm_show_code(kvm_context_t kvm, int vcpu)
+void kvm_show_code(kvm_vcpu_context_t vcpu)
{
fprintf(stderr, "%s: Operation not supported\n", __FUNCTION__);
}
-void kvm_show_regs(kvm_context_t kvm, int vcpu)
+void kvm_show_regs(kvm_vcpu_context_t vcpu)
{
struct kvm_regs regs;
int i;
- if (kvm_get_regs(kvm, vcpu, &regs))
+ if (kvm_get_regs(vcpu, &regs))
return;
fprintf(stderr,"guest vcpu #%d\n", vcpu);
@@ -84,13 +86,13 @@ int kvm_arch_create(kvm_context_t kvm, unsigned long phys_mem_bytes,
return 0;
}
-int kvm_arch_run(struct kvm_run *run, kvm_context_t kvm, int vcpu)
+int kvm_arch_run(kvm_vcpu_context_t vcpu)
{
int ret = 0;
- switch (run->exit_reason){
+ switch (vcpu->run->exit_reason){
case KVM_EXIT_DCR:
- ret = handle_dcr(run, kvm, vcpu);
+ ret = handle_dcr(vcpu);
break;
default:
ret = 1;