From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:42758) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rd06K-0006j0-9Y for qemu-devel@nongnu.org; Tue, 20 Dec 2011 08:51:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rd06F-0000De-U0 for qemu-devel@nongnu.org; Tue, 20 Dec 2011 08:51:28 -0500 Received: from mail-iy0-f173.google.com ([209.85.210.173]:51709) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rd06F-0000DP-MX for qemu-devel@nongnu.org; Tue, 20 Dec 2011 08:51:23 -0500 Received: by iagj37 with SMTP id j37so11598704iag.4 for ; Tue, 20 Dec 2011 05:51:23 -0800 (PST) Sender: Paolo Bonzini Message-ID: <4EF092D2.6080009@redhat.com> Date: Tue, 20 Dec 2011 14:51:14 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <4EEFB72E.7030508@codemonkey.ws> <4EEFC970.9030205@web.de> <4EEFD69F.6080700@codemonkey.ws> <4EEFD786.8030609@web.de> <4EEFD90A.1000204@codemonkey.ws> <4EF05BC4.8010905@redhat.com> <4EF09078.2030508@codemonkey.ws> In-Reply-To: <4EF09078.2030508@codemonkey.ws> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v5 06/16] apic: Introduce backend/frontend infrastructure for KVM reuse List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Anthony Liguori , kvm@vger.kernel.org, "Michael S. Tsirkin" , Marcelo Tosatti , qemu-devel , Blue Swirl , Jan Kiszka , Avi Kivity On 12/20/2011 02:41 PM, Anthony Liguori wrote: > On 12/20/2011 03:56 AM, Avi Kivity wrote: >> On 12/20/2011 02:38 AM, Anthony Liguori wrote: >>>> That was v1 of my patches. Avi didn't like it, I tried it like this, >>>> and >>>> in the end I had to agree. So, no, I don't think we want such a model. >>> >>> >>> Yes, we do :-) >>> >>> The in-kernel APIC is a different implementation of the APIC device. >>> It's not an "accelerator" for the userspace APIC. >> >> A different implementation but not a different device. Device == spec. > > If it was hardware, it'd be a fully compatible clone. The way we would > model this is via inheritance. I see your fully compatible clone, and I raise my bridge with a different implementation underneath. It's the same old debate on is-a vs has-a. In QOM parlance Jan implemented this: abstract class Object abstract class Device class APIC: { backend: link } abstract class APICBackend class QEMU_APICBackend class KVM_APICBackend and you're proposing this: abstract class Object abstract class Device abstract class APIC class QEMU_APIC class KVM_APIC Both can be right, both can be wrong. Paolo