From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: [PATCH 1/4] i8254: Factor out base class for KVM reuse Date: Tue, 31 Jan 2012 15:59:36 -0600 Message-ID: <4F286448.8010002@us.ibm.com> References: <1e206a3b5dbd396606099fdbd9abd8c00bbdda31.1328035554.git.jan.kiszka@siemens.com> <4F285FBA.5050607@codemonkey.ws> <4F2861F4.1000604@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, Marcelo Tosatti , Avi Kivity , qemu-devel To: Jan Kiszka Return-path: In-Reply-To: <4F2861F4.1000604@web.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org Sender: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org List-Id: kvm.vger.kernel.org On 01/31/2012 03:49 PM, Jan Kiszka wrote: > On 2012-01-31 22:40, Anthony Liguori wrote: >> On 01/31/2012 12:46 PM, Jan Kiszka wrote: >>> Applying the concept used for the *PICs once again: establish a base >>> class for the i8254 that can be used both by the current user space >>> emulation and the upcoming KVM in-kernel version. We share most of the >>> public interface of the i8254, specifically to the pcspk, vmstate, reset >>> and certain init parts. >>> >>> Signed-off-by: Jan Kiszka >> >> Now that we have QOM bits, there's no need to factor out a common base >> class. >> >> Just make the methods that you want to override virtual with the default >> implementation and then make a KVMPIT that inherits from the PIT and >> then overrides whatever virtual functions it needs to. > > That doesn't sound like the proper design for this purpose. It's hard to say really. There's a lot more in the common class that I expected (like initialization of the ISA regions. I would expect the base class to look a lot more like an interface such that the KVM PIT implementation was trivialized more than it is. But I can argue it both ways so if you feel strongly here, I won't object. Regards, Anthony Liguori Rather, we > have an abstract base class that both implementations are derived from. > If I'm not using QOM properly to achieve this, please tell me. > > Thanks, > Jan From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:33992) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RsLkB-0007s9-7O for qemu-devel@nongnu.org; Tue, 31 Jan 2012 17:00:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RsLk6-0004Vi-OT for qemu-devel@nongnu.org; Tue, 31 Jan 2012 17:00:02 -0500 Received: from e39.co.us.ibm.com ([32.97.110.160]:54655) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RsLk6-0004Pe-EA for qemu-devel@nongnu.org; Tue, 31 Jan 2012 16:59:58 -0500 Received: from /spool/local by e39.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 31 Jan 2012 14:59:52 -0700 Received: from d03relay03.boulder.ibm.com (d03relay03.boulder.ibm.com [9.17.195.228]) by d03dlp01.boulder.ibm.com (Postfix) with ESMTP id 6B4ED1FF0049 for ; Tue, 31 Jan 2012 14:59:48 -0700 (MST) Received: from d03av05.boulder.ibm.com (d03av05.boulder.ibm.com [9.17.195.85]) by d03relay03.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q0VLxfgd070006 for ; Tue, 31 Jan 2012 14:59:42 -0700 Received: from d03av05.boulder.ibm.com (loopback [127.0.0.1]) by d03av05.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q0VLxbpq023705 for ; Tue, 31 Jan 2012 14:59:37 -0700 Message-ID: <4F286448.8010002@us.ibm.com> Date: Tue, 31 Jan 2012 15:59:36 -0600 From: Anthony Liguori MIME-Version: 1.0 References: <1e206a3b5dbd396606099fdbd9abd8c00bbdda31.1328035554.git.jan.kiszka@siemens.com> <4F285FBA.5050607@codemonkey.ws> <4F2861F4.1000604@web.de> In-Reply-To: <4F2861F4.1000604@web.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/4] i8254: Factor out base class for KVM reuse List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: kvm@vger.kernel.org, Marcelo Tosatti , Avi Kivity , qemu-devel On 01/31/2012 03:49 PM, Jan Kiszka wrote: > On 2012-01-31 22:40, Anthony Liguori wrote: >> On 01/31/2012 12:46 PM, Jan Kiszka wrote: >>> Applying the concept used for the *PICs once again: establish a base >>> class for the i8254 that can be used both by the current user space >>> emulation and the upcoming KVM in-kernel version. We share most of the >>> public interface of the i8254, specifically to the pcspk, vmstate, reset >>> and certain init parts. >>> >>> Signed-off-by: Jan Kiszka >> >> Now that we have QOM bits, there's no need to factor out a common base >> class. >> >> Just make the methods that you want to override virtual with the default >> implementation and then make a KVMPIT that inherits from the PIT and >> then overrides whatever virtual functions it needs to. > > That doesn't sound like the proper design for this purpose. It's hard to say really. There's a lot more in the common class that I expected (like initialization of the ISA regions. I would expect the base class to look a lot more like an interface such that the KVM PIT implementation was trivialized more than it is. But I can argue it both ways so if you feel strongly here, I won't object. Regards, Anthony Liguori Rather, we > have an abstract base class that both implementations are derived from. > If I'm not using QOM properly to achieve this, please tell me. > > Thanks, > Jan