public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: kvm-devel <kvm@vger.kernel.org>, Avi Kivity <avi@redhat.com>
Subject: [PATCH] qemu-kvm: Reindent pc_new_cpu
Date: Fri, 18 Sep 2009 19:28:36 +0200	[thread overview]
Message-ID: <4AB3C344.9000809@siemens.com> (raw)

...for better match with upstream.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---

PS: regs_modified = 1 is another sign that the initialization order in
qemu-kvm needs a rework.

 hw/pc.c |   28 +++++++++++++++-------------
 1 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/hw/pc.c b/hw/pc.c
index 5f892c7..d407c47 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -1097,19 +1097,21 @@ int cpu_is_bsp(CPUState *env)
 
 CPUState *pc_new_cpu(const char *cpu_model)
 {
-        CPUState *env = cpu_init(cpu_model);
-        if (!env) {
-            fprintf(stderr, "Unable to find x86 CPU definition\n");
-            exit(1);
-        }
-        env->kvm_cpu_state.regs_modified = 1;
-        if ((env->cpuid_features & CPUID_APIC) || smp_cpus > 1) {
-            env->cpuid_apic_id = env->cpu_index;
-            /* APIC reset callback resets cpu */
-            apic_init(env);
-        } else {
-            qemu_register_reset((QEMUResetHandler*)cpu_reset, env);
-        }
+    CPUState *env;
+
+    env = cpu_init(cpu_model);
+    if (!env) {
+        fprintf(stderr, "Unable to find x86 CPU definition\n");
+        exit(1);
+    }
+    env->kvm_cpu_state.regs_modified = 1;
+    if ((env->cpuid_features & CPUID_APIC) || smp_cpus > 1) {
+        env->cpuid_apic_id = env->cpu_index;
+        /* APIC reset callback resets cpu */
+        apic_init(env);
+    } else {
+        qemu_register_reset((QEMUResetHandler*)cpu_reset, env);
+    }
 
     /* kvm needs this to run after the apic is initialized. Otherwise,
      * it can access invalid state and crash.

             reply	other threads:[~2009-09-18 17:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-18 17:28 Jan Kiszka [this message]
2009-09-18 20:03 ` [PATCH] qemu-kvm: Reindent pc_new_cpu 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=4AB3C344.9000809@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    /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