|
From: | Gerd Hoffmann |
Subject: | Re: [Qemu-devel] [PATCH 4/9] Add S390x virtio machine bus |
Date: | Mon, 19 Oct 2009 21:34:28 +0200 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.4pre) Gecko/20090922 Fedora/3.0-2.7.b4.fc11 Lightning/1.0pre Thunderbird/3.0b4 |
+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
[Prev in Thread] | Current Thread | [Next in Thread] |