From: "Andreas Färber" <afaerber@suse.de>
To: qemu-devel@nongnu.org
Cc: "Kevin Wolf" <kwolf@redhat.com>, "Andreas Färber" <afaerber@suse.de>
Subject: [Qemu-devel] [PULL 06/17] ide: Pass size to ide_bus_new()
Date: Fri, 30 Aug 2013 21:29:32 +0200 [thread overview]
Message-ID: <1377890983-6481-7-git-send-email-afaerber@suse.de> (raw)
In-Reply-To: <1377890983-6481-1-git-send-email-afaerber@suse.de>
To be passed to qbus_create_inplace().
Reviewed-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
hw/ide/ahci.c | 2 +-
hw/ide/cmd646.c | 2 +-
hw/ide/internal.h | 3 ++-
hw/ide/isa.c | 2 +-
hw/ide/macio.c | 2 +-
hw/ide/mmio.c | 2 +-
hw/ide/piix.c | 2 +-
hw/ide/qdev.c | 3 ++-
hw/ide/via.c | 2 +-
9 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c
index bba150f..a71a4ca 100644
--- a/hw/ide/ahci.c
+++ b/hw/ide/ahci.c
@@ -1175,7 +1175,7 @@ void ahci_init(AHCIState *s, DeviceState *qdev, AddressSpace *as, int ports)
for (i = 0; i < s->ports; i++) {
AHCIDevice *ad = &s->dev[i];
- ide_bus_new(&ad->port, qdev, i, 1);
+ ide_bus_new(&ad->port, sizeof(ad->port), qdev, i, 1);
ide_init2(&ad->port, irqs[i]);
ad->hba = s;
diff --git a/hw/ide/cmd646.c b/hw/ide/cmd646.c
index d6ef799..0500a7a 100644
--- a/hw/ide/cmd646.c
+++ b/hw/ide/cmd646.c
@@ -289,7 +289,7 @@ static int pci_cmd646_ide_initfn(PCIDevice *dev)
irq = qemu_allocate_irqs(cmd646_set_irq, d, 2);
for (i = 0; i < 2; i++) {
- ide_bus_new(&d->bus[i], DEVICE(dev), i, 2);
+ ide_bus_new(&d->bus[i], sizeof(d->bus[i]), DEVICE(dev), i, 2);
ide_init2(&d->bus[i], irq[i]);
bmdma_init(&d->bus[i], &d->bmdma[i], d);
diff --git a/hw/ide/internal.h b/hw/ide/internal.h
index 048a052..5d1cf87 100644
--- a/hw/ide/internal.h
+++ b/hw/ide/internal.h
@@ -576,7 +576,8 @@ void ide_atapi_cmd(IDEState *s);
void ide_atapi_cmd_reply_end(IDEState *s);
/* hw/ide/qdev.c */
-void ide_bus_new(IDEBus *idebus, DeviceState *dev, int bus_id, int max_units);
+void ide_bus_new(IDEBus *idebus, size_t idebus_size, DeviceState *dev,
+ int bus_id, int max_units);
IDEDevice *ide_create_drive(IDEBus *bus, int unit, DriveInfo *drive);
#endif /* HW_IDE_INTERNAL_H */
diff --git a/hw/ide/isa.c b/hw/ide/isa.c
index bbc8c6b..afc24d4 100644
--- a/hw/ide/isa.c
+++ b/hw/ide/isa.c
@@ -70,7 +70,7 @@ static void isa_ide_realizefn(DeviceState *dev, Error **errp)
ISADevice *isadev = ISA_DEVICE(dev);
ISAIDEState *s = ISA_IDE(dev);
- ide_bus_new(&s->bus, dev, 0, 2);
+ ide_bus_new(&s->bus, sizeof(s->bus), dev, 0, 2);
ide_init_ioport(&s->bus, isadev, s->iobase, s->iobase2);
isa_init_irq(isadev, &s->irq, s->isairq);
ide_init2(&s->bus, s->irq);
diff --git a/hw/ide/macio.c b/hw/ide/macio.c
index ef4ba2b..da94580 100644
--- a/hw/ide/macio.c
+++ b/hw/ide/macio.c
@@ -547,7 +547,7 @@ static void macio_ide_initfn(Object *obj)
SysBusDevice *d = SYS_BUS_DEVICE(obj);
MACIOIDEState *s = MACIO_IDE(obj);
- ide_bus_new(&s->bus, DEVICE(obj), 0, 2);
+ ide_bus_new(&s->bus, sizeof(s->bus), DEVICE(obj), 0, 2);
memory_region_init_io(&s->mem, obj, &pmac_ide_ops, s, "pmac-ide", 0x1000);
sysbus_init_mmio(d, &s->mem);
sysbus_init_irq(d, &s->irq);
diff --git a/hw/ide/mmio.c b/hw/ide/mmio.c
index d251ff9..9f66a52 100644
--- a/hw/ide/mmio.c
+++ b/hw/ide/mmio.c
@@ -137,7 +137,7 @@ static void mmio_ide_initfn(Object *obj)
SysBusDevice *d = SYS_BUS_DEVICE(obj);
MMIOState *s = MMIO_IDE(obj);
- ide_bus_new(&s->bus, DEVICE(obj), 0, 2);
+ ide_bus_new(&s->bus, sizeof(s->bus), DEVICE(obj), 0, 2);
sysbus_init_irq(d, &s->irq);
}
diff --git a/hw/ide/piix.c b/hw/ide/piix.c
index e6e6c0b..ab36749 100644
--- a/hw/ide/piix.c
+++ b/hw/ide/piix.c
@@ -136,7 +136,7 @@ static void pci_piix_init_ports(PCIIDEState *d) {
int i;
for (i = 0; i < 2; i++) {
- ide_bus_new(&d->bus[i], DEVICE(d), i, 2);
+ ide_bus_new(&d->bus[i], sizeof(d->bus[i]), DEVICE(d), i, 2);
ide_init_ioport(&d->bus[i], NULL, port_info[i].iobase,
port_info[i].iobase2);
ide_init2(&d->bus[i], isa_get_irq(NULL, port_info[i].isairq));
diff --git a/hw/ide/qdev.c b/hw/ide/qdev.c
index 1d84e15..8be76ab 100644
--- a/hw/ide/qdev.c
+++ b/hw/ide/qdev.c
@@ -47,7 +47,8 @@ static const TypeInfo ide_bus_info = {
.class_init = ide_bus_class_init,
};
-void ide_bus_new(IDEBus *idebus, DeviceState *dev, int bus_id, int max_units)
+void ide_bus_new(IDEBus *idebus, size_t idebus_size, DeviceState *dev,
+ int bus_id, int max_units)
{
qbus_create_inplace(&idebus->qbus, TYPE_IDE_BUS, dev, NULL);
idebus->bus_id = bus_id;
diff --git a/hw/ide/via.c b/hw/ide/via.c
index e5fb297..99468c7 100644
--- a/hw/ide/via.c
+++ b/hw/ide/via.c
@@ -159,7 +159,7 @@ static void vt82c686b_init_ports(PCIIDEState *d) {
int i;
for (i = 0; i < 2; i++) {
- ide_bus_new(&d->bus[i], DEVICE(d), i, 2);
+ ide_bus_new(&d->bus[i], sizeof(d->bus[i]), DEVICE(d), i, 2);
ide_init_ioport(&d->bus[i], NULL, port_info[i].iobase,
port_info[i].iobase2);
ide_init2(&d->bus[i], isa_get_irq(NULL, port_info[i].isairq));
--
1.8.1.4
next prev parent reply other threads:[~2013-08-30 19:30 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-30 19:29 [Qemu-devel] [PULL 00/17] QOM devices patch queue 2013-08-30 Andreas Färber
2013-08-30 19:29 ` [Qemu-devel] [PULL 01/17] object: Fix typo in qom/object.h Andreas Färber
2013-08-30 19:29 ` [Qemu-devel] [PULL 02/17] virtio: Remove unnecessary OBJECT() casts Andreas Färber
2013-08-30 19:29 ` [Qemu-devel] [PULL 03/17] qom: Fix object_initialize_with_type() argument name in documentation Andreas Färber
2013-08-30 19:29 ` [Qemu-devel] [PULL 04/17] intel-hda: Pass size to hda_codec_bus_init() Andreas Färber
2013-08-30 19:29 ` [Qemu-devel] [PULL 05/17] ipack: Pass size to ipack_bus_new_inplace() Andreas Färber
2013-08-30 19:29 ` Andreas Färber [this message]
2013-08-30 19:29 ` [Qemu-devel] [PULL 07/17] pci: Pass size to pci_bus_new_inplace() Andreas Färber
2013-08-30 19:29 ` [Qemu-devel] [PULL 08/17] scsi: Pass size to scsi_bus_new() Andreas Färber
2013-08-30 19:29 ` [Qemu-devel] [PULL 09/17] usb: Pass size to usb_bus_new() Andreas Färber
2013-08-30 19:29 ` [Qemu-devel] [PULL 10/17] virtio-pci: Pass size to virtio_pci_bus_new() Andreas Färber
2013-08-30 19:29 ` [Qemu-devel] [PULL 11/17] s390-virtio-bus: Pass size to virtio_s390_bus_new() Andreas Färber
2013-08-30 19:29 ` [Qemu-devel] [PULL 12/17] virtio-ccw: Pass size to virtio_ccw_bus_new() Andreas Färber
2013-08-30 19:29 ` [Qemu-devel] [PULL 13/17] virtio-mmio: Pass size to virtio_mmio_bus_new() Andreas Färber
2013-08-30 19:29 ` [Qemu-devel] [PULL 14/17] qdev: Pass size to qbus_create_inplace() Andreas Färber
2013-08-30 19:29 ` [Qemu-devel] [PULL 15/17] qom: Pass available size to object_initialize() Andreas Färber
2013-08-30 19:29 ` [Qemu-devel] [PULL 16/17] qom: Assert instance size in object_initialize_with_type() Andreas Färber
2013-08-30 19:29 ` [Qemu-devel] [PULL 17/17] isa: Fix documentation of isa_register_portio_list() Andreas Färber
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=1377890983-6481-7-git-send-email-afaerber@suse.de \
--to=afaerber@suse.de \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).