From: Hu Tao <hutao@cn.fujitsu.com>
To: qemu-devel <qemu-devel@nongnu.org>
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
"Peter Crosthwaite" <peter.crosthwaite@xilinx.com>,
"Andreas Färber" <afaerber@suse.de>,
"Igor Mammedov" <imammedo@redhat.com>,
"Anthony Liguori" <aliguori@us.ibm.com>
Subject: [Qemu-devel] [PATCH 24/26] ioapic: use realize for ioapic
Date: Sat, 22 Jun 2013 16:50:36 +0800 [thread overview]
Message-ID: <cb7c35da2a25c95075c71af12be2f1143f92bb7d.1371804804.git.hutao@cn.fujitsu.com> (raw)
In-Reply-To: <cover.1371804804.git.hutao@cn.fujitsu.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Andreas Färber" <afaerber@suse.de>
Cc: Anthony Liguori <aliguori@us.ibm.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
---
hw/intc/ioapic_common.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/hw/intc/ioapic_common.c b/hw/intc/ioapic_common.c
index 5c5bb3c..6077024 100644
--- a/hw/intc/ioapic_common.c
+++ b/hw/intc/ioapic_common.c
@@ -57,14 +57,15 @@ static int ioapic_dispatch_post_load(void *opaque, int version_id)
return 0;
}
-static int ioapic_init_common(SysBusDevice *dev)
+static void ioapic_common_realize(DeviceState *dev, Error **errp)
{
IOAPICCommonState *s = IOAPIC_COMMON(dev);
IOAPICCommonClass *info;
static int ioapic_no;
if (ioapic_no >= MAX_IOAPICS) {
- return -1;
+ error_setg (errp, "invalid ioapic number: %d", ioapic_no);
+ return;
}
info = IOAPIC_COMMON_GET_CLASS(s);
@@ -72,8 +73,6 @@ static int ioapic_init_common(SysBusDevice *dev)
sysbus_init_mmio(&s->busdev, &s->io_memory);
ioapic_no++;
-
- return 0;
}
static const VMStateDescription vmstate_ioapic_common = {
@@ -95,10 +94,9 @@ static const VMStateDescription vmstate_ioapic_common = {
static void ioapic_common_class_init(ObjectClass *klass, void *data)
{
- SysBusDeviceClass *sc = SYS_BUS_DEVICE_CLASS(klass);
DeviceClass *dc = DEVICE_CLASS(klass);
- sc->init = ioapic_init_common;
+ dc->realize = ioapic_common_realize;
dc->vmsd = &vmstate_ioapic_common;
dc->no_user = 1;
}
--
1.8.3.1
next prev parent reply other threads:[~2013-06-22 8:52 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-22 8:50 [Qemu-devel] [PATCH 00/26] use realizefn for SysBusDevice, part 1 Hu Tao
2013-06-22 8:50 ` [Qemu-devel] [PATCH 01/26] ohci: use realize for ohci Hu Tao
2013-06-24 5:54 ` Peter Crosthwaite
2013-06-24 6:11 ` Hu Tao
2013-06-24 6:17 ` Peter Crosthwaite
2013-06-25 1:54 ` Hu Tao
2013-06-24 14:01 ` Eduardo Habkost
2013-06-22 8:50 ` [Qemu-devel] [PATCH 02/26] ohci: QOM'ify some more Hu Tao
2013-06-22 8:50 ` [Qemu-devel] [PATCH 03/26] i440fx-pcihost: use realize for i440fx-pcihost Hu Tao
2013-06-22 8:50 ` [Qemu-devel] [PATCH 04/26] i440fx: use type-safe cast instead of directly access of parent dev Hu Tao
2013-06-22 8:50 ` [Qemu-devel] [PATCH 05/26] q35: use realize for q35 host Hu Tao
2013-06-22 8:50 ` [Qemu-devel] [PATCH 06/26] q35: use type-safe cast instead of directly access of parent dev Hu Tao
2013-06-22 8:50 ` [Qemu-devel] [PATCH 07/26] fdc: use realize for fdc Hu Tao
2013-06-22 8:50 ` [Qemu-devel] [PATCH 08/26] fdc: QOM'ify some more Hu Tao
2013-06-22 8:50 ` [Qemu-devel] [PATCH 09/26] pflash_cfi01: use realize for pflash_cfi01 Hu Tao
2013-06-22 8:50 ` [Qemu-devel] [PATCH 10/26] pflash-cfi01: QOM'ify some more Hu Tao
2013-06-22 8:50 ` [Qemu-devel] [PATCH 11/26] pflash_cfi02: use realize for pflash_cfi02 Hu Tao
2013-06-22 8:50 ` [Qemu-devel] [PATCH 12/26] pflash-cfi02: QOM'ify some more Hu Tao
2013-06-22 8:50 ` [Qemu-devel] [PATCH 13/26] ahci: use realize for ahci Hu Tao
2013-06-22 8:50 ` [Qemu-devel] [PATCH 14/26] ahci: QOM'ify some more Hu Tao
2013-06-22 8:50 ` [Qemu-devel] [PATCH 15/26] fwcfg: use realize for fwcfg Hu Tao
2013-06-22 8:50 ` [Qemu-devel] [PATCH 16/26] fwcfg: QOM'ify some more Hu Tao
2013-06-22 8:50 ` [Qemu-devel] [PATCH 17/26] scsi esp: use realize for scsi esp Hu Tao
2013-06-22 8:50 ` [Qemu-devel] [PATCH 18/26] scsi esp: QOM'ify some more Hu Tao
2013-06-22 8:50 ` [Qemu-devel] [PATCH 19/26] hpet: use realize for hpet Hu Tao
2013-06-22 8:50 ` [Qemu-devel] [PATCH 20/26] hpet: QOM'ify some more Hu Tao
2013-06-22 8:50 ` [Qemu-devel] [PATCH 21/26] kvmclock: use realize for kvmclock Hu Tao
2013-06-24 10:14 ` Igor Mammedov
2013-06-25 1:55 ` Hu Tao
2013-06-24 14:01 ` Eduardo Habkost
2013-06-25 2:20 ` Hu Tao
2013-06-25 17:45 ` Eduardo Habkost
2013-06-30 14:36 ` Andreas Färber
2013-07-01 9:31 ` Hu Tao
2013-07-01 10:20 ` Andreas Färber
2013-06-22 8:50 ` [Qemu-devel] [PATCH 22/26] kvmclock: QOM'ify some more Hu Tao
2013-06-24 13:33 ` Eduardo Habkost
2013-06-22 8:50 ` [Qemu-devel] [PATCH 23/26] kvmvapic realize Hu Tao
2013-06-22 8:50 ` Hu Tao [this message]
2013-06-22 8:50 ` [Qemu-devel] [PATCH 25/26] isa bus: use realize for isa bus Hu Tao
2013-06-30 14:57 ` Andreas Färber
2013-07-01 5:30 ` Hu Tao
2013-06-22 8:50 ` [Qemu-devel] [PATCH 26/26] ehci: use realize for ehci Hu Tao
2013-06-22 10:38 ` Andreas Färber
2013-06-30 14:41 ` Andreas Färber
2013-06-30 16:45 ` [Qemu-devel] [PATCH 00/26] use realizefn for SysBusDevice, part 1 Andreas Färber
2013-07-01 5:31 ` Hu Tao
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=cb7c35da2a25c95075c71af12be2f1143f92bb7d.1371804804.git.hutao@cn.fujitsu.com \
--to=hutao@cn.fujitsu.com \
--cc=afaerber@suse.de \
--cc=aliguori@us.ibm.com \
--cc=imammedo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.crosthwaite@xilinx.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).