Received: from eggs.gnu.org ([2001:4830:134:3::10]:38936) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMwlA-0001j9-Qw for qemu-devel@nongnu.org; Tue, 12 Jul 2016 08:25:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bMwl8-0008MI-Um for qemu-devel@nongnu.org; Tue, 12 Jul 2016 08:25:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38921) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMwl8-0008M5-P7 for qemu-devel@nongnu.org; Tue, 12 Jul 2016 08:25:54 -0400 Date: Tue, 12 Jul 2016 09:25:51 -0300 From: Eduardo Habkost Message-ID: <20160712122551.GA3727@thinpad.lan.raisama.net> References: <1467786055-85835-1-git-send-email-imammedo@redhat.com> <1467786055-85835-5-git-send-email-imammedo@redhat.com> <20160712022851.GD19132@thinpad.lan.raisama.net> <20160712140113.0052795a@nial.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160712140113.0052795a@nial.brq.redhat.com> Subject: Re: [Qemu-devel] [PATCH v3 04/19] pc: cpu: consolidate apic-id validity checks in pc_cpu_pre_plug() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov Cc: qemu-devel@nongnu.org, pkrempa@redhat.com, mst@redhat.com, armbru@redhat.com, eduardo.otubo@profitbricks.com, marcel@redhat.com, pbonzini@redhat.com, rth@twiddle.net On Tue, Jul 12, 2016 at 02:01:13PM +0200, Igor Mammedov wrote: > On Mon, 11 Jul 2016 23:28:51 -0300 > Eduardo Habkost 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 With this change: Reviewed-by: Eduardo Habkost -- Eduardo