[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 25/26] ioapic: use realize for ioapic
From: |
Andreas Färber |
Subject: |
Re: [Qemu-devel] [PATCH v2 25/26] ioapic: use realize for ioapic |
Date: |
Sun, 21 Jul 2013 12:35:33 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 |
Am 01.07.2013 12:18, schrieb Hu Tao:
> Signed-off-by: Hu Tao <address@hidden>
> ---
> hw/intc/ioapic_common.c | 12 +++++-------
> 1 file changed, 5 insertions(+), 7 deletions(-)
>
> diff --git a/hw/intc/ioapic_common.c b/hw/intc/ioapic_common.c
> index 5c5bb3c..5dc1f1e 100644
> --- a/hw/intc/ioapic_common.c
> +++ b/hw/intc/ioapic_common.c
> @@ -57,23 +57,22 @@ 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);
Since the ioapic number was not chosen by the user, I have changed this
similar to the preceding error message, referring to the maximum instead.
Andreas
> + return;
> }
>
> info = IOAPIC_COMMON_GET_CLASS(s);
> info->init(s, ioapic_no);
>
> - sysbus_init_mmio(&s->busdev, &s->io_memory);
> + sysbus_init_mmio(SYS_BUS_DEVICE(s), &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;
> }
>
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
- [Qemu-devel] [PATCH qom-next] scsi: Improve error propagation for scsi_bus_legacy_handle_cmdline(), (continued)
- [Qemu-devel] [PATCH v2 17/26] fwcfg: use realize for fwcfg, Hu Tao, 2013/07/01
- [Qemu-devel] [PATCH v2 21/26] hpet: use realize for hpet, Hu Tao, 2013/07/01
- [Qemu-devel] [PATCH v2 23/26] kvmclock: use realize for kvmclock, Hu Tao, 2013/07/01
- [Qemu-devel] [PATCH v2 20/26] hpet: QOM'ify some more, Hu Tao, 2013/07/01
- [Qemu-devel] [PATCH v2 22/26] kvmclock: QOM'ify some more, Hu Tao, 2013/07/01
- [Qemu-devel] [PATCH v2 26/26] isa bus: remove isabus_bridge_init since it does nothing, Hu Tao, 2013/07/01
- [Qemu-devel] [PATCH v2 25/26] ioapic: use realize for ioapic, Hu Tao, 2013/07/01
- Re: [Qemu-devel] [PATCH v2 25/26] ioapic: use realize for ioapic,
Andreas Färber <=
- [Qemu-devel] [PATCH v2 24/26] kvmvapic realize, Hu Tao, 2013/07/01
- Re: [Qemu-devel] [PATCH v2 00/26] use realizefn for SysBusDevice, part 1, Andreas Färber, 2013/07/21