From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44540) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vty6H-00073E-R4 for qemu-devel@nongnu.org; Fri, 20 Dec 2013 06:18:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vty6A-00038Q-GX for qemu-devel@nongnu.org; Fri, 20 Dec 2013 06:18:37 -0500 Received: from cantor2.suse.de ([195.135.220.15]:57153 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vty6A-000389-AE for qemu-devel@nongnu.org; Fri, 20 Dec 2013 06:18:30 -0500 Message-ID: <52B42781.1030800@suse.de> Date: Fri, 20 Dec 2013 12:18:25 +0100 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1383646565-13774-1-git-send-email-zxq_yx_007@163.com> <1383646565-13774-5-git-send-email-zxq_yx_007@163.com> <52B1E385.4030303@suse.de> <52B300A8.4030903@redhat.com> In-Reply-To: <52B300A8.4030903@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v3 4/4] ioapic: QOM'ify ioapic List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , xiaoqiang zhao Cc: qemu-devel@nongnu.org, Anthony Liguori Am 19.12.2013 15:20, schrieb Paolo Bonzini: > Il 18/12/2013 19:03, Andreas F=E4rber ha scritto: >>>> @@ -61,7 +69,6 @@ static void ioapic_common_realize(DeviceState *dev= , Error **errp) >>>> { >>>> IOAPICCommonState *s =3D IOAPIC_COMMON(dev); >>>> IOAPICCommonClass *info; >>>> - static int ioapic_no; >>>> =20 >>>> if (ioapic_no >=3D MAX_IOAPICS) { >>>> error_setg(errp, "Only %d ioapics allowed", MAX_IOAPICS); >> ... while the check for max. IOAPICs still happens in common code. >> >> Do we need to count KVM IOAPICs as well? Or can we consolidate this in= to >> the non-KVM version and keep it static there? >=20 > KVM only supports one IOAPIC. Creating a second fails with EEXIST. As it turns out, MAX_IOAPICS is 1, so covers both cases. No KVM ioctl actually happens on realize for using said EEXIST, so I moved the increment back to where it was, minimizing changes. If we want to redesign it, that can still be done in a follow-up patch. Thanks, Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg