From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mzy08-0003Qo-17 for qemu-devel@nongnu.org; Mon, 19 Oct 2009 15:34:40 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mzy03-0003NB-5Y for qemu-devel@nongnu.org; Mon, 19 Oct 2009 15:34:39 -0400 Received: from [199.232.76.173] (port=58812 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mzy02-0003Mw-Uu for qemu-devel@nongnu.org; Mon, 19 Oct 2009 15:34:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58536) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mzy02-000546-Bv for qemu-devel@nongnu.org; Mon, 19 Oct 2009 15:34:34 -0400 Message-ID: <4ADCBF44.7090401@redhat.com> Date: Mon, 19 Oct 2009 21:34:28 +0200 From: Gerd Hoffmann MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 4/9] Add S390x virtio machine bus References: <1255963059-10298-1-git-send-email-agraf@suse.de> <1255963059-10298-2-git-send-email-agraf@suse.de> <1255963059-10298-3-git-send-email-agraf@suse.de> <1255963059-10298-4-git-send-email-agraf@suse.de> <1255963059-10298-5-git-send-email-agraf@suse.de> In-Reply-To: <1255963059-10298-5-git-send-email-agraf@suse.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: Carsten Otte , qemu-devel , hare@suse.de > +VirtIOS390Bus *s390_virtio_bus_init(ram_addr_t *ram_size) > +{ > + VirtIOS390Bus *bus; > + > + bus = (VirtIOS390Bus *)qbus_create(&s390_virtio_bus_info, NULL, "s390-virtio"); While a cast works the political correct way to do this is using DO_UPCAST. Also I'd suggest to add a sysbus -> s390-virtio bus bridge device, so your bus gets properly hooked up in the device tree. Have a look at the (quite simple) "isabus-bridge" device in isa-bus.c, which is used with 'qemu -M isapc'. You'll see the s390-virtio bus and all virtio devices attached to it in 'info qtree' then. > + bus = (VirtIOS390Bus *)dev->qdev.parent_bus; DO_UPCAST(). > +VirtIOS390Device *s390_virtio_bus_console(VirtIOS390Bus *bus) > +{ > + return bus->console; > +} What this is needed for? cheers, Gerd