Am 19.12.2013 15:20, schrieb Paolo Bonzini: > Il 18/12/2013 19:03, Andreas Färber ha scritto: >>>> @@ -61,7 +69,6 @@ static void ioapic_common_realize(DeviceState *dev, >>>> Error **errp) >>>> { >>>> IOAPICCommonState *s = IOAPIC_COMMON(dev); >>>> IOAPICCommonClass *info; >>>> - static int ioapic_no; >>>> >>>> if (ioapic_no >= 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 into >> the non-KVM version and keep it static there? > > 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 -- SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg