On Mon, 11 Jul 2016 23:28:51 -0300
Eduardo Habkost <ehabk...@redhat.com> 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;
+    }
+}

Reply via email to