Received: from eggs.gnu.org ([2001:4830:134:3::10]:37925) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bK6v5-0001i6-7e for qemu-devel@nongnu.org; Mon, 04 Jul 2016 12:40:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bK6v0-0000ef-6r for qemu-devel@nongnu.org; Mon, 04 Jul 2016 12:40:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55102) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bK6v0-0000ea-0n for qemu-devel@nongnu.org; Mon, 04 Jul 2016 12:40:22 -0400 References: <1466495274-5011-1-git-send-email-peterx@redhat.com> <1466495274-5011-4-git-send-email-peterx@redhat.com> <20160704181623-mutt-send-email-mst@redhat.com> <50cdf1cf-957a-a1d6-e29c-ccab8ff59230@redhat.com> <20160704193423-mutt-send-email-mst@redhat.com> From: Paolo Bonzini Message-ID: <462a8b79-60dc-0024-8b7c-afbce45ee1dd@redhat.com> Date: Mon, 4 Jul 2016 18:40:15 +0200 MIME-Version: 1.0 In-Reply-To: <20160704193423-mutt-send-email-mst@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v10 03/26] x86-iommu: q35: generalize find_add_as() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: Peter Xu , ehabkost@redhat.com, rkrcmar@redhat.com, jasowang@redhat.com, qemu-devel@nongnu.org, alex.williamson@redhat.com, jan.kiszka@web.de, wexu@redhat.com, marcel@redhat.com, imammedo@redhat.com, davidkiarie4@gmail.com, rth@twiddle.net On 04/07/2016 18:35, Michael S. Tsirkin wrote: >> > >> > Not sure what you mean. Each IOMMU subclass can define its own >> > find_add_as implementation, what's wrong with that? >> > >> > Paolo > > this: > > @@ -2060,6 +2060,7 @@ static void vtd_class_init(ObjectClass *klass, void *data) > dc->vmsd = &vtd_vmstate; > dc->props = vtd_properties; > x86_class->realize = vtd_realize; > + x86_class->find_add_as = vtd_find_add_as; > } > > I think this > means that if there are two classes inheriting x86_class, > they will conflict over-writing vtd_find_add_as in the > parent. No, x86_class is really just (X86IOMMUClass *)klass, and klass is local. Paolo