From: Glauber Costa <glommer@redhat.com>
To: kvm@vger.kernel.org
Cc: avi@redhat.com
Subject: [PATCH 03/10] remove unneded opaque.
Date: Fri, 9 Oct 2009 15:03:11 -0300 [thread overview]
Message-ID: <1255111398-15251-4-git-send-email-glommer@redhat.com> (raw)
In-Reply-To: <1255111398-15251-3-git-send-email-glommer@redhat.com>
kvm_debug() and kvm_arch_halt() both take an opaque field for no reason,
since it is totally unused. kvm_halt() itself is just a wrapper around
kvm_arch_halt(), and is removed.
Signed-off-by: Glauber Costa <glommer@redhat.com>
---
qemu-kvm-ia64.c | 2 +-
qemu-kvm-x86.c | 2 +-
qemu-kvm.c | 13 +++----------
qemu-kvm.h | 2 +-
4 files changed, 6 insertions(+), 13 deletions(-)
diff --git a/qemu-kvm-ia64.c b/qemu-kvm-ia64.c
index d26c2a9..a11fde8 100644
--- a/qemu-kvm-ia64.c
+++ b/qemu-kvm-ia64.c
@@ -30,7 +30,7 @@ int kvm_arch_init_vcpu(CPUState *cenv)
return 0;
}
-int kvm_arch_halt(void *opaque, kvm_vcpu_context_t vcpu)
+int kvm_arch_halt(kvm_vcpu_context_t vcpu)
{
CPUState *env = cpu_single_env;
env->hflags |= HF_HALTED_MASK;
diff --git a/qemu-kvm-x86.c b/qemu-kvm-x86.c
index e8ec59d..7546fcb 100644
--- a/qemu-kvm-x86.c
+++ b/qemu-kvm-x86.c
@@ -1357,7 +1357,7 @@ int kvm_arch_init_vcpu(CPUState *cenv)
return 0;
}
-int kvm_arch_halt(void *opaque, kvm_vcpu_context_t vcpu)
+int kvm_arch_halt(kvm_vcpu_context_t vcpu)
{
CPUState *env = cpu_single_env;
diff --git a/qemu-kvm.c b/qemu-kvm.c
index 4ad6856..b92a68e 100644
--- a/qemu-kvm.c
+++ b/qemu-kvm.c
@@ -97,11 +97,10 @@ int kvm_abi = EXPECTED_KVM_API_VERSION;
int kvm_page_size;
#ifdef KVM_CAP_SET_GUEST_DEBUG
-static int kvm_debug(void *opaque, void *data,
+static int kvm_debug(CPUState *env,
struct kvm_debug_exit_arch *arch_info)
{
int handle = kvm_arch_debug(arch_info);
- CPUState *env = data;
if (handle) {
kvm_debug_cpu_requested = env;
@@ -816,9 +815,8 @@ int handle_debug(kvm_vcpu_context_t vcpu, void *env)
{
#ifdef KVM_CAP_SET_GUEST_DEBUG
struct kvm_run *run = vcpu->run;
- kvm_context_t kvm = vcpu->kvm;
- return kvm_debug(kvm->opaque, env, &run->debug.arch);
+ return kvm_debug(env, &run->debug.arch);
#else
return 0;
#endif
@@ -895,11 +893,6 @@ int handle_io_window(kvm_context_t kvm)
return 1;
}
-int handle_halt(kvm_vcpu_context_t vcpu)
-{
- return kvm_arch_halt(vcpu->kvm->opaque, vcpu);
-}
-
int handle_shutdown(kvm_context_t kvm, CPUState *env)
{
/* stop the current vcpu from going back to guest mode */
@@ -1019,7 +1012,7 @@ int kvm_run(kvm_vcpu_context_t vcpu, void *env)
r = handle_mmio(vcpu);
break;
case KVM_EXIT_HLT:
- r = handle_halt(vcpu);
+ r = kvm_arch_halt(vcpu);
break;
case KVM_EXIT_IRQ_WINDOW_OPEN:
break;
diff --git a/qemu-kvm.h b/qemu-kvm.h
index e957e96..e51dd2c 100644
--- a/qemu-kvm.h
+++ b/qemu-kvm.h
@@ -1109,7 +1109,7 @@ struct ioperm_data {
};
void qemu_kvm_cpu_stop(CPUState *env);
-int kvm_arch_halt(void *opaque, kvm_vcpu_context_t vcpu);
+int kvm_arch_halt(kvm_vcpu_context_t vcpu);
int handle_tpr_access(void *opaque, kvm_vcpu_context_t vcpu, uint64_t rip,
int is_write);
int kvm_has_sync_mmu(void);
--
1.6.2.5
next prev parent reply other threads:[~2009-10-09 18:03 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-09 18:03 [PATCH 00/10] Clean up vcpu context structure Glauber Costa
2009-10-09 18:03 ` [PATCH 01/10] use a more upstream friendly version of irqchip-in-kernel test Glauber Costa
2009-10-09 18:03 ` [PATCH 02/10] drop kvm_mmio_read and write Glauber Costa
2009-10-09 18:03 ` Glauber Costa [this message]
2009-10-09 18:03 ` [PATCH 04/10] remove kvm_context from vpcu structure Glauber Costa
2009-10-09 18:03 ` [PATCH 05/10] Use kvm_run inside CPUState Glauber Costa
2009-10-09 18:03 ` [PATCH 06/10] make some functions static Glauber Costa
2009-10-09 18:03 ` [PATCH 07/10] use env as parameter for functions that access kvm_run Glauber Costa
2009-10-09 18:03 ` [PATCH 08/10] use env in kvm_arch_run Glauber Costa
2009-10-09 18:03 ` [PATCH 09/10] remove kvm_run from vcpu_context Glauber Costa
2009-10-09 18:03 ` [PATCH 10/10] remove id field from vcpu context structure Glauber Costa
2009-10-12 9:24 ` [PATCH 00/10] Clean up " Avi Kivity
2009-10-13 17:04 ` Marcelo Tosatti
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1255111398-15251-4-git-send-email-glommer@redhat.com \
--to=glommer@redhat.com \
--cc=avi@redhat.com \
--cc=kvm@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox