From: "KONRAD Frédéric" <fred.konrad@greensocs.com>
To: Cornelia Huck <cornelia.huck@de.ibm.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
Subject: Re: [Qemu-devel] [RFC PATCH V8 06/15] virtio-s390-bus : Add virtio-s390-bus.
Date: Thu, 20 Dec 2012 09:03:45 +0100 [thread overview]
Message-ID: <50D2C661.50108@greensocs.com> (raw)
In-Reply-To: <20121219190918.18133e01@gondolin>
On 19/12/2012 19:09, Cornelia Huck wrote:
> On Wed, 19 Dec 2012 10:53:32 +0100
> fred.konrad@greensocs.com wrote:
>
>> From: KONRAD Frederic <fred.konrad@greensocs.com>
>>
>> Introduce virtio-s390-bus, which extends virtio-bus. It is used with s390
>> transport device.
>>
>> Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
>> ---
>> 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.
oops, yes sorry for that.
It didn't complain as I don't use the VirtioBusClass for the moment.
I fixed it.
Thanks.
>
>> +
>> typedef struct VirtIOS390Device VirtIOS390Device;
>>
>> +VirtioBusState *virtio_s390_bus_new(VirtIOS390Device *dev);
>> +
>> typedef struct VirtIOS390DeviceClass {
>> DeviceClass qdev;
>> int (*init)(VirtIOS390Device *dev);
next prev parent reply other threads:[~2012-12-20 8:03 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-19 9:53 [Qemu-devel] [RFC PATCH V8 00/15] Virtio refactoring fred.konrad
2012-12-19 9:53 ` [Qemu-devel] [RFC PATCH V8 01/15] qdev : add a maximum device allowed field for the bus fred.konrad
2013-01-02 14:08 ` Anthony Liguori
2013-01-02 14:16 ` Andreas Färber
2013-01-02 14:30 ` KONRAD Frédéric
2013-01-03 14:03 ` KONRAD Frédéric
2012-12-19 9:53 ` [Qemu-devel] [RFC PATCH V8 02/15] virtio-bus : Introduce virtio-bus fred.konrad
2013-01-02 14:12 ` Anthony Liguori
2013-01-03 9:57 ` KONRAD Frédéric
2012-12-19 9:53 ` [Qemu-devel] [RFC PATCH V8 03/15] virtio-pci-bus : Introduce virtio-pci-bus fred.konrad
2013-01-02 14:12 ` Anthony Liguori
2012-12-19 9:53 ` [Qemu-devel] [RFC PATCH V8 04/15] virtio-pci : Refactor virtio-pci device fred.konrad
2012-12-19 19:53 ` Blue Swirl
2013-01-02 14:14 ` Anthony Liguori
2013-01-02 14:17 ` KONRAD Frédéric
2012-12-19 9:53 ` [Qemu-devel] [RFC PATCH V8 05/15] virtio-device : Refactor virtio-device fred.konrad
2013-01-02 14:15 ` Anthony Liguori
2012-12-19 9:53 ` [Qemu-devel] [RFC PATCH V8 06/15] virtio-s390-bus : Add virtio-s390-bus fred.konrad
2012-12-19 18:09 ` Cornelia Huck
2012-12-20 8:03 ` KONRAD Frédéric [this message]
2012-12-19 9:53 ` [Qemu-devel] [RFC PATCH V8 07/15] virtio-s390-device : create a virtio-s390-bus during init fred.konrad
2012-12-19 9:53 ` [Qemu-devel] [RFC PATCH V8 08/15] virtio-blk : Add the virtio-blk device fred.konrad
2012-12-19 20:00 ` Blue Swirl
2012-12-19 23:22 ` Peter Maydell
2012-12-19 9:53 ` [Qemu-devel] [RFC PATCH V8 09/15] virtio-blk-pci : Switch to new API fred.konrad
2013-01-02 14:18 ` Anthony Liguori
2012-12-19 9:53 ` [Qemu-devel] [RFC PATCH V8 10/15] virtio-blk-s390 : Switch to the " fred.konrad
2012-12-19 9:53 ` [Qemu-devel] [RFC PATCH V8 11/15] virtio-blk : cleanup : use QOM cast fred.konrad
2012-12-19 9:53 ` [Qemu-devel] [RFC PATCH V8 12/15] virtio-blk : cleanup : remove qdev field fred.konrad
2012-12-19 9:53 ` [Qemu-devel] [RFC PATCH V8 13/15] virtio : Remove the function pointer fred.konrad
2012-12-19 19:50 ` Blue Swirl
2012-12-20 8:02 ` KONRAD Frédéric
2012-12-19 9:53 ` [Qemu-devel] [RFC PATCH V8 14/15] virtio : Remove VirtIOBindings fred.konrad
2012-12-19 19:54 ` Blue Swirl
2012-12-19 9:53 ` [Qemu-devel] [RFC PATCH V8 15/15] virtio : cleanup : init and exit function fred.konrad
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50D2C661.50108@greensocs.com \
--to=fred.konrad@greensocs.com \
--cc=afaerber@suse.de \
--cc=agraf@suse.de \
--cc=aliguori@us.ibm.com \
--cc=cornelia.huck@de.ibm.com \
--cc=e.voevodin@samsung.com \
--cc=mark.burton@greensocs.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.