Received: from eggs.gnu.org ([208.118.235.92]:41943) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SoTkt-0008MI-23 for qemu-devel@nongnu.org; Tue, 10 Jul 2012 02:17:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SoTkr-0001Q6-6u for qemu-devel@nongnu.org; Tue, 10 Jul 2012 02:17:02 -0400 Received: from mail-yw0-f45.google.com ([209.85.213.45]:35454) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SoTkq-0001Pq-WE for qemu-devel@nongnu.org; Tue, 10 Jul 2012 02:17:01 -0400 Received: by yhoo21 with SMTP id o21so12995878yho.4 for ; Mon, 09 Jul 2012 23:16:59 -0700 (PDT) From: Liu Ping Fan Date: Tue, 10 Jul 2012 14:16:07 +0800 Message-Id: <1341900967-4344-6-git-send-email-qemulist@gmail.com> In-Reply-To: <1341900967-4344-1-git-send-email-qemulist@gmail.com> References: <1341900967-4344-1-git-send-email-qemulist@gmail.com> Subject: [Qemu-devel] [PATCH 5/5] apic: create apic as a child of cpu, not system_bus any longer List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Blue Swirl , Jan Kiszka , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Anthony Liguori Signed-off-by: Liu Ping Fan --- hw/pc.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/pc.c b/hw/pc.c index c7e9ab3..8df58c9 100644 --- a/hw/pc.c +++ b/hw/pc.c @@ -886,17 +886,17 @@ DeviceState *cpu_get_current_apic(void) } } -static DeviceState *apic_init(void *env, uint8_t apic_id) +static DeviceState *apic_init(void *cpu, void *env, uint8_t apic_id) { DeviceState *dev; static int apic_mapped; if (kvm_irqchip_in_kernel()) { - dev = qdev_create(NULL, "kvm-apic"); + dev = qdev_create_kid(OBJECT(cpu), "kvm-apic"); } else if (xen_enabled()) { - dev = qdev_create(NULL, "xen-apic"); + dev = qdev_create_kid(OBJECT(cpu), "xen-apic"); } else { - dev = qdev_create(NULL, "apic"); + dev = qdev_create_kid(OBJECT(cpu), "apic"); } qdev_prop_set_uint8(dev, "id", apic_id); @@ -945,7 +945,7 @@ static X86CPU *pc_new_cpu(const char *cpu_model) } env = &cpu->env; if ((env->cpuid_features & CPUID_APIC) || smp_cpus > 1) { - env->apic_state = apic_init(env, env->cpuid_apic_id); + env->apic_state = apic_init(cpu, env, env->cpuid_apic_id); } qemu_register_reset(pc_cpu_reset, cpu); pc_cpu_reset(cpu); -- 1.7.4.4