Ejemplo n.º 1
0
static int sysbus_device_init(DeviceState *dev)
{
    SysBusDevice *sd = SYS_BUS_DEVICE(dev);
    SysBusDeviceClass *sbc = SYS_BUS_DEVICE_GET_CLASS(sd);

    return sbc->init(sd);
}
Ejemplo n.º 2
0
/* TODO remove once all sysbus devices have been converted to realize */
static void sysbus_realize(DeviceState *dev, Error **errp)
{
    SysBusDevice *sd = SYS_BUS_DEVICE(dev);
    SysBusDeviceClass *sbc = SYS_BUS_DEVICE_GET_CLASS(sd);

    if (!sbc->init) {
        return;
    }
    if (sbc->init(sd) < 0) {
        error_setg(errp, "Device initialization failed");
    }
}