[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 04/19] pc: cpu: consolidate apic-id validity
From: |
Igor Mammedov |
Subject: |
Re: [Qemu-devel] [PATCH v3 04/19] pc: cpu: consolidate apic-id validity checks in pc_cpu_pre_plug() |
Date: |
Tue, 12 Jul 2016 14:01:13 +0200 |
On Mon, 11 Jul 2016 23:28:51 -0300
Eduardo Habkost <address@hidden> wrote:
> On Wed, Jul 06, 2016 at 08:20:40AM +0200, Igor Mammedov wrote:
> [...]
> > +static void pc_cpu_pre_plug(HotplugHandler *hotplug_dev,
> > + DeviceState *dev, Error **errp)
> > +{
> > + int idx;
> > + X86CPU *cpu = X86_CPU(dev);
> > + PCMachineState *pcms = PC_MACHINE(hotplug_dev);
> > + CPUArchId *cpu_slot = pc_find_cpu_slot(pcms, CPU(dev), &idx);
>
> Why are you passing &idx to pc_find_cpu_slot() here, if you don't
> use it for anything?
>
+static void pc_cpu_pre_plug(HotplugHandler *hotplug_dev,
+ DeviceState *dev, Error **errp)
+{
[...]
+ if (cpu_slot->cpu) {
+ error_setg(errp, "CPU[%ld] with APIC ID %" PRIu32 " exists",
+ cpu_slot - pcms->possible_cpus->cpus,
it should have been used here, so I'll fix this place to use idx
and along the way print APIC ID in hex
+ cpu->apic_id);
+ return;
+ }
+}
- Re: [Qemu-devel] [PATCH v3 01/19] target-i386: cpu: use uint32_t for X86CPU.apic_id, (continued)
- [Qemu-devel] [PATCH v3 02/19] pc: add x86_topo_ids_from_apicid(), Igor Mammedov, 2016/07/06
- [Qemu-devel] [PATCH v3 03/19] pc: extract CPU lookup into a separate function, Igor Mammedov, 2016/07/06
- [Qemu-devel] [PATCH v3 04/19] pc: cpu: consolidate apic-id validity checks in pc_cpu_pre_plug(), Igor Mammedov, 2016/07/06
- Re: [Qemu-devel] [PATCH v3 04/19] pc: cpu: consolidate apic-id validity checks in pc_cpu_pre_plug(), Bandan Das, 2016/07/13
- Re: [Qemu-devel] [PATCH v3 04/19] pc: cpu: consolidate apic-id validity checks in pc_cpu_pre_plug(), Eduardo Habkost, 2016/07/20
- [Qemu-devel] [PATCH v3 05/19] target-i386: cpu: replace custom apic-id setter/getter with static property, Igor Mammedov, 2016/07/06
- [Qemu-devel] [PATCH v3 06/19] target-i386: add socket/core/thread properties to X86CPU, Igor Mammedov, 2016/07/06
- [Qemu-devel] [PATCH v3 07/19] pc: set APIC ID based on socket/core/thread ids if it's not been set yet, Igor Mammedov, 2016/07/06