int qdev_init(DeviceState *dev)

{

    int rc;



    assert(dev->state == DEV_STATE_CREATED);

    rc = dev->info->init(dev, dev->info);

    if (rc < 0) {

        qdev_free(dev);

        return rc;

    }

    qemu_register_reset(qdev_reset, dev);

    if (dev->info->vmsd) {

        vmstate_register_with_alias_id(dev, -1, dev->info->vmsd, dev,

                                       dev->instance_id_alias,

                                       dev->alias_required_for_version);

    }

    dev->state = DEV_STATE_INITIALIZED;

    return 0;

}

int qdev_init(DeviceState *dev)

{

    int rc;



    assert(dev->state == DEV_STATE_CREATED);

    rc = dev->info->init(dev, dev->info);

    if (rc < 0) {

        qdev_free(dev);

        return rc;

    }

    qemu_register_reset(qdev_reset, dev);

    if (dev->info->vmsd) {

        vmstate_register_with_alias_id(dev, -1, dev->info->vmsd, dev,

                                       dev->instance_id_alias,

                                       dev->alias_required_for_version);

    }

    dev->state = DEV_STATE_INITIALIZED;

    return 0;

}

int FUNC_0(DeviceState *VAR_0)

{

    int VAR_1;



    assert(VAR_0->state == DEV_STATE_CREATED);

    VAR_1 = VAR_0->info->init(VAR_0, VAR_0->info);

    if (VAR_1 < 0) {

        qdev_free(VAR_0);

        return VAR_1;

    }

    qemu_register_reset(qdev_reset, VAR_0);

    if (VAR_0->info->vmsd) {

        vmstate_register_with_alias_id(VAR_0, -1, VAR_0->info->vmsd, VAR_0,

                                       VAR_0->instance_id_alias,

                                       VAR_0->alias_required_for_version);

    }

    VAR_0->state = DEV_STATE_INITIALIZED;

    return 0;

}

int FUNC_0(DeviceState *VAR_0)
{ int VAR_1; assert(VAR_0->state == DEV_STATE_CREATED); VAR_1 = VAR_0->info->init(VAR_0, VAR_0->info); if (VAR_1 < 0) { qdev_free(VAR_0); return VAR_1; } qemu_register_reset(qdev_reset, VAR_0); if (VAR_0->info->vmsd) { vmstate_register_with_alias_id(VAR_0, -1, VAR_0->info->vmsd, VAR_0,
VAR_0->instance_id_alias,
VAR_0->alias_required_for_version); } VAR_0->state = DEV_STATE_INITIALIZED; return 0; }