From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:41451) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TlO59-000087-Jv for qemu-devel@nongnu.org; Wed, 19 Dec 2012 13:09:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TlO58-0008Ig-1k for qemu-devel@nongnu.org; Wed, 19 Dec 2012 13:09:27 -0500 Received: from e06smtp12.uk.ibm.com ([195.75.94.108]:37244) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TlO57-0008Hx-PI for qemu-devel@nongnu.org; Wed, 19 Dec 2012 13:09:25 -0500 Received: from /spool/local by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 19 Dec 2012 18:08:56 -0000 Received: from d06av12.portsmouth.uk.ibm.com (d06av12.portsmouth.uk.ibm.com [9.149.37.247]) by b06cxnps3075.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id qBJI9DG02163128 for ; Wed, 19 Dec 2012 18:09:13 GMT Received: from d06av12.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av12.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id qBJI9KtO005032 for ; Wed, 19 Dec 2012 11:09:20 -0700 Date: Wed, 19 Dec 2012 19:09:18 +0100 From: Cornelia Huck Message-ID: <20121219190918.18133e01@gondolin> In-Reply-To: <1355910821-21302-7-git-send-email-fred.konrad@greensocs.com> References: <1355910821-21302-1-git-send-email-fred.konrad@greensocs.com> <1355910821-21302-7-git-send-email-fred.konrad@greensocs.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH V8 06/15] virtio-s390-bus : Add virtio-s390-bus. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: fred.konrad@greensocs.com Cc: peter.maydell@linaro.org, aliguori@us.ibm.com, e.voevodin@samsung.com, mark.burton@greensocs.com, qemu-devel@nongnu.org, agraf@suse.de, stefanha@redhat.com, afaerber@suse.de On Wed, 19 Dec 2012 10:53:32 +0100 fred.konrad@greensocs.com wrote: > From: KONRAD Frederic > > Introduce virtio-s390-bus, which extends virtio-bus. It is used with s390 > transport device. > > Signed-off-by: KONRAD Frederic > --- > hw/s390-virtio-bus.c | 28 ++++++++++++++++++++++++++++ > hw/s390-virtio-bus.h | 13 +++++++++++++ > 2 files changed, 41 insertions(+) > > diff --git a/hw/s390-virtio-bus.c b/hw/s390-virtio-bus.c > index e0ac2d1..720dbb9 100644 > --- a/hw/s390-virtio-bus.c > +++ b/hw/s390-virtio-bus.c > @@ -33,6 +33,7 @@ > #include "kvm.h" > > #include "hw/s390-virtio-bus.h" > +#include "hw/virtio-bus.h" > > /* #define DEBUG_S390 */ > > @@ -556,8 +557,35 @@ static TypeInfo s390_virtio_bridge_info = { > .class_init = s390_virtio_bridge_class_init, > }; > > +/* virtio-s390-bus */ > + > +VirtioBusState *virtio_s390_bus_new(VirtIOS390Device *dev) > +{ > + DeviceState *qdev = DEVICE(dev); > + BusState *qbus = qbus_create(TYPE_VIRTIO_S390_BUS, qdev, NULL); > + VirtioBusState *bus = VIRTIO_BUS(qbus); > + qbus->allow_hotplug = 0; > + qbus->max_dev = 1; > + return bus; > +} > + > +static void virtio_s390_bus_class_init(ObjectClass *klass, void *data) > +{ > + VirtioBusClass *k = VIRTIO_BUS_CLASS(klass); > + k->notify = virtio_s390_notify; > + k->get_features = virtio_s390_get_features; > +} > + > +static const TypeInfo virtio_s390_bus_info = { > + .name = TYPE_VIRTIO_S390_BUS, > + .parent = TYPE_VIRTIO_BUS, > + .instance_size = sizeof(VirtioBusState), > + .class_init = virtio_s390_bus_class_init, > +}; > + > static void s390_virtio_register_types(void) > { > + type_register_static(&virtio_s390_bus_info); > type_register_static(&s390_virtio_bus_info); > type_register_static(&virtio_s390_device_info); > type_register_static(&s390_virtio_serial); > diff --git a/hw/s390-virtio-bus.h b/hw/s390-virtio-bus.h > index a83afe7..7c5a945 100644 > --- a/hw/s390-virtio-bus.h > +++ b/hw/s390-virtio-bus.h > @@ -22,6 +22,7 @@ > #include "virtio-rng.h" > #include "virtio-serial.h" > #include "virtio-scsi.h" > +#include "virtio-bus.h" > > #define VIRTIO_DEV_OFFS_TYPE 0 /* 8 bits */ > #define VIRTIO_DEV_OFFS_NUM_VQ 1 /* 8 bits */ > @@ -57,8 +58,20 @@ > #define S390_VIRTIO_BUS(obj) \ > OBJECT_CHECK(VirtIOS390Bus, (obj), TYPE_S390_VIRTIO_BUS) > > +/* virtio-s390-bus */ > + > +#define TYPE_VIRTIO_S390_BUS "virtio-s390-bus" > +#define VIRTIO_S390_BUS_GET_CLASS(obj) \ > + OBJECT_GET_CLASS(VirtioBusClass, obj, TYPE_VIRTIO_S390_BUS) > +#define VIRTIO_PCI_BUS_CLASS(klass) \ > + OBJECT_CLASS_CHECK(VirtioBusClass, klass, TYPE_VIRTIO_S390_BUS) > +#define VIRTIO_PCI_BUS(obj) \ > + OBJECT_CHECK(VirtioBusState, (obj), TYPE_VIRTIO_S390_BUS) PCI? This looks wrong. > + > typedef struct VirtIOS390Device VirtIOS390Device; > > +VirtioBusState *virtio_s390_bus_new(VirtIOS390Device *dev); > + > typedef struct VirtIOS390DeviceClass { > DeviceClass qdev; > int (*init)(VirtIOS390Device *dev);