* [PATCH] clean up cpu hotplug code
@ 2009-06-02 5:12 Glauber Costa
0 siblings, 0 replies; 3+ messages in thread
From: Glauber Costa @ 2009-06-02 5:12 UTC (permalink / raw)
To: kvm; +Cc: avi
There's nothing kvm specific in get_cpu function. Remove it from
kvm ifdef. Buy us a cleaner code, and may help us with any attempt
of integrating this on the future.
Signed-off-by: Glauber Costa <glommer@redhat.com>
---
hw/acpi.c | 12 +++---------
1 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/hw/acpi.c b/hw/acpi.c
index f4062ac..2b16437 100644
--- a/hw/acpi.c
+++ b/hw/acpi.c
@@ -770,9 +770,7 @@ static void disable_processor(struct gpe_regs *g, int cpu)
g->cpus_sts[cpu/8] &= ~(1 << (cpu%8));
}
-#if defined(TARGET_I386) || defined(TARGET_X86_64)
-#ifdef USE_KVM
-static CPUState *qemu_kvm_cpu_env(int index)
+static CPUState *qemu_get_cpu_env(int index)
{
CPUState *penv;
@@ -786,18 +784,14 @@ static CPUState *qemu_kvm_cpu_env(int index)
return NULL;
}
-#endif
+#if defined(TARGET_I386) || defined(TARGET_X86_64)
void qemu_system_cpu_hot_add(int cpu, int state)
{
CPUState *env;
- if (state
-#ifdef USE_KVM
- && (!qemu_kvm_cpu_env(cpu))
-#endif
- ) {
+ if (state i&& (!qemu_kvm_cpu_env(cpu))) {
env = pc_new_cpu(cpu, model, 1);
if (!env) {
fprintf(stderr, "cpu %d creation failed\n", cpu);
--
1.6.0.6
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] clean up cpu hotplug code
2009-06-02 5:42 Glauber Costa
@ 2009-06-02 12:01 ` Avi Kivity
0 siblings, 0 replies; 3+ messages in thread
From: Avi Kivity @ 2009-06-02 12:01 UTC (permalink / raw)
To: Glauber Costa; +Cc: kvm
Glauber Costa wrote:
> There's nothing kvm specific in get_cpu function. Remove it from
> kvm ifdef. Buy us a cleaner code, and may help us with any attempt
> of integrating this on the future.
>
> Signed-off-by: Glauber Costa <glommer@redhat.com>
> ---
> hw/acpi.c | 12 +++---------
> 1 files changed, 3 insertions(+), 9 deletions(-)
>
> diff --git a/hw/acpi.c b/hw/acpi.c
> index f4062ac..7f23e4e 100644
> --- a/hw/acpi.c
> +++ b/hw/acpi.c
> @@ -770,9 +770,7 @@ static void disable_processor(struct gpe_regs *g, int cpu)
> g->cpus_sts[cpu/8] &= ~(1 << (cpu%8));
> }
>
> -#if defined(TARGET_I386) || defined(TARGET_X86_64)
> -#ifdef USE_KVM
> -static CPUState *qemu_kvm_cpu_env(int index)
> +static CPUState *qemu_get_cpu_env(int index)
> {
> CPUState *penv;
>
> @@ -786,18 +784,14 @@ static CPUState *qemu_kvm_cpu_env(int index)
>
> return NULL;
> }
> -#endif
>
Want this cause an undefined function warning on non-x86 targets?
If you send two identical patches, please version them and note the changes.
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] clean up cpu hotplug code
@ 2009-06-02 5:42 Glauber Costa
2009-06-02 12:01 ` Avi Kivity
0 siblings, 1 reply; 3+ messages in thread
From: Glauber Costa @ 2009-06-02 5:42 UTC (permalink / raw)
To: kvm; +Cc: avi
There's nothing kvm specific in get_cpu function. Remove it from
kvm ifdef. Buy us a cleaner code, and may help us with any attempt
of integrating this on the future.
Signed-off-by: Glauber Costa <glommer@redhat.com>
---
hw/acpi.c | 12 +++---------
1 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/hw/acpi.c b/hw/acpi.c
index f4062ac..7f23e4e 100644
--- a/hw/acpi.c
+++ b/hw/acpi.c
@@ -770,9 +770,7 @@ static void disable_processor(struct gpe_regs *g, int cpu)
g->cpus_sts[cpu/8] &= ~(1 << (cpu%8));
}
-#if defined(TARGET_I386) || defined(TARGET_X86_64)
-#ifdef USE_KVM
-static CPUState *qemu_kvm_cpu_env(int index)
+static CPUState *qemu_get_cpu_env(int index)
{
CPUState *penv;
@@ -786,18 +784,14 @@ static CPUState *qemu_kvm_cpu_env(int index)
return NULL;
}
-#endif
+#if defined(TARGET_I386) || defined(TARGET_X86_64)
void qemu_system_cpu_hot_add(int cpu, int state)
{
CPUState *env;
- if (state
-#ifdef USE_KVM
- && (!qemu_kvm_cpu_env(cpu))
-#endif
- ) {
+ if (state && (!qemu_get_cpu_env(cpu))) {
env = pc_new_cpu(cpu, model, 1);
if (!env) {
fprintf(stderr, "cpu %d creation failed\n", cpu);
--
1.6.0.6
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-06-02 12:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-02 5:12 [PATCH] clean up cpu hotplug code Glauber Costa
2009-06-02 5:42 Glauber Costa
2009-06-02 12:01 ` Avi Kivity
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.