From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:50980) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tsx47-0004yX-Id for qemu-devel@nongnu.org; Wed, 09 Jan 2013 09:55:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tsx46-0007TW-EB for qemu-devel@nongnu.org; Wed, 09 Jan 2013 09:55:39 -0500 Received: from greensocs.com ([87.106.252.221]:33097 helo=s15328186.onlinehome-server.info) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tsx46-0007SA-7r for qemu-devel@nongnu.org; Wed, 09 Jan 2013 09:55:38 -0500 Message-ID: <50ED84E5.5070704@greensocs.com> Date: Wed, 09 Jan 2013 15:55:33 +0100 From: =?UTF-8?B?S09OUkFEIEZyw6lkw6lyaWM=?= MIME-Version: 1.0 References: <1357584074-10852-1-git-send-email-fred.konrad@greensocs.com> <1357584074-10852-4-git-send-email-fred.konrad@greensocs.com> <50ED2C56.50209@greensocs.com> <50ED34DF.7090008@greensocs.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 03/61] virtio-pci-bus : introduce virtio-pci-bus. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: kwolf@redhat.com, aliguori@us.ibm.com, e.voevodin@samsung.com, mst@redhat.com, mark.burton@greensocs.com, qemu-devel@nongnu.org, agraf@suse.de, amit.shah@redhat.com, aneesh.kumar@linux.vnet.ibm.com, stefanha@redhat.com, cornelia.huck@de.ibm.com, pbonzini@redhat.com, afaerber@suse.de On 09/01/2013 15:53, Peter Maydell wrote: > On 9 January 2013 09:14, KONRAD Fr=C3=A9d=C3=A9ric wrote: >> On 09/01/2013 09:37, KONRAD Fr=C3=A9d=C3=A9ric wrote: >>> On 08/01/2013 19:08, Peter Maydell wrote: >>>> This isn't quite right, I think (somebody correct me if I'm wrong!) >>>> The virtio-pci-bus subclass doesn't have any state of its own, so it >>>> doesn't need a struct, but it does still want a type, so virtio-pci.= h >>>> should >>>> have a >>>> typedef VirtioBusClass VirtioPCIBusClass; >>>> typedef VirtioBusState VirtioPCIBusState; >>>> and we then use VirtioPCIBusClass/State where appropriate >>>> (notably in the typeinfo for class/instance size and in the get-clas= s/ >>>> class-check/etc macros). >>>> >>>> This lets us easily add state later if we need to by turning the >>>> typedef into a typedef'd struct without having to hunt down all >>>> the places that now need to say 'VirtioPCIBus*' rather than >>>> 'VirtioBus*'. >>> Ok, I'll make the change. >> Though, I'm not really sure we will add something here.. >> The virtio-pci-bus is only added to implement VirtioBusClass functions= . >> There are no differences between pci, s390, or mmio. > It's just consistency, and as I say it avoids surprises later. We're > basically inventing our own object system in C here, which means > that there's no guard preventing you from doing something in a > way which is inconsistent with our object system but still valid > and functioning C; but it's better style not to do that. > > -- PMM ok then, I'll change it. And for s390 too.