static int virtio_ccw_load_config(DeviceState *d, QEMUFile *f)

{

    VirtioCcwDevice *dev = VIRTIO_CCW_DEVICE(d);

    CcwDevice *ccw_dev = CCW_DEVICE(d);

    CCWDeviceClass *ck = CCW_DEVICE_GET_CLASS(ccw_dev);

    SubchDev *s = ccw_dev->sch;

    VirtIODevice *vdev = virtio_ccw_get_vdev(s);

    int len;



    s->driver_data = dev;

    subch_device_load(s, f);

    /* Re-fill subch_id after loading the subchannel states.*/

    if (ck->refill_ids) {

        ck->refill_ids(ccw_dev);

    }

    len = qemu_get_be32(f);

    if (len != 0) {

        dev->indicators = get_indicator(qemu_get_be64(f), len);

    } else {

        qemu_get_be64(f);

        dev->indicators = NULL;

    }

    len = qemu_get_be32(f);

    if (len != 0) {

        dev->indicators2 = get_indicator(qemu_get_be64(f), len);

    } else {

        qemu_get_be64(f);

        dev->indicators2 = NULL;

    }

    len = qemu_get_be32(f);

    if (len != 0) {

        dev->summary_indicator = get_indicator(qemu_get_be64(f), len);

    } else {

        qemu_get_be64(f);

        dev->summary_indicator = NULL;

    }

    qemu_get_be16s(f, &vdev->config_vector);

    dev->routes.adapter.ind_offset = qemu_get_be64(f);

    dev->thinint_isc = qemu_get_byte(f);

    dev->revision = qemu_get_be32(f);

    if (s->thinint_active) {

        return css_register_io_adapter(CSS_IO_ADAPTER_VIRTIO,

                                       dev->thinint_isc, true, false,

                                       &dev->routes.adapter.adapter_id);

    }



    return 0;

}

static int virtio_ccw_load_config(DeviceState *d, QEMUFile *f)

{

    VirtioCcwDevice *dev = VIRTIO_CCW_DEVICE(d);

    CcwDevice *ccw_dev = CCW_DEVICE(d);

    CCWDeviceClass *ck = CCW_DEVICE_GET_CLASS(ccw_dev);

    SubchDev *s = ccw_dev->sch;

    VirtIODevice *vdev = virtio_ccw_get_vdev(s);

    int len;



    s->driver_data = dev;

    subch_device_load(s, f);

    

    if (ck->refill_ids) {

        ck->refill_ids(ccw_dev);

    }

    len = qemu_get_be32(f);

    if (len != 0) {

        dev->indicators = get_indicator(qemu_get_be64(f), len);

    } else {

        qemu_get_be64(f);

        dev->indicators = NULL;

    }

    len = qemu_get_be32(f);

    if (len != 0) {

        dev->indicators2 = get_indicator(qemu_get_be64(f), len);

    } else {

        qemu_get_be64(f);

        dev->indicators2 = NULL;

    }

    len = qemu_get_be32(f);

    if (len != 0) {

        dev->summary_indicator = get_indicator(qemu_get_be64(f), len);

    } else {

        qemu_get_be64(f);

        dev->summary_indicator = NULL;

    }

    qemu_get_be16s(f, &vdev->config_vector);

    dev->routes.adapter.ind_offset = qemu_get_be64(f);

    dev->thinint_isc = qemu_get_byte(f);

    dev->revision = qemu_get_be32(f);

    if (s->thinint_active) {

        return css_register_io_adapter(CSS_IO_ADAPTER_VIRTIO,

                                       dev->thinint_isc, true, false,

                                       &dev->routes.adapter.adapter_id);

    }



    return 0;

}

static int FUNC_0(DeviceState *VAR_0, QEMUFile *VAR_1)

{

    VirtioCcwDevice *dev = VIRTIO_CCW_DEVICE(VAR_0);

    CcwDevice *ccw_dev = CCW_DEVICE(VAR_0);

    CCWDeviceClass *ck = CCW_DEVICE_GET_CLASS(ccw_dev);

    SubchDev *s = ccw_dev->sch;

    VirtIODevice *vdev = virtio_ccw_get_vdev(s);

    int VAR_2;



    s->driver_data = dev;

    subch_device_load(s, VAR_1);

    

    if (ck->refill_ids) {

        ck->refill_ids(ccw_dev);

    }

    VAR_2 = qemu_get_be32(VAR_1);

    if (VAR_2 != 0) {

        dev->indicators = get_indicator(qemu_get_be64(VAR_1), VAR_2);

    } else {

        qemu_get_be64(VAR_1);

        dev->indicators = NULL;

    }

    VAR_2 = qemu_get_be32(VAR_1);

    if (VAR_2 != 0) {

        dev->indicators2 = get_indicator(qemu_get_be64(VAR_1), VAR_2);

    } else {

        qemu_get_be64(VAR_1);

        dev->indicators2 = NULL;

    }

    VAR_2 = qemu_get_be32(VAR_1);

    if (VAR_2 != 0) {

        dev->summary_indicator = get_indicator(qemu_get_be64(VAR_1), VAR_2);

    } else {

        qemu_get_be64(VAR_1);

        dev->summary_indicator = NULL;

    }

    qemu_get_be16s(VAR_1, &vdev->config_vector);

    dev->routes.adapter.ind_offset = qemu_get_be64(VAR_1);

    dev->thinint_isc = qemu_get_byte(VAR_1);

    dev->revision = qemu_get_be32(VAR_1);

    if (s->thinint_active) {

        return css_register_io_adapter(CSS_IO_ADAPTER_VIRTIO,

                                       dev->thinint_isc, true, false,

                                       &dev->routes.adapter.adapter_id);

    }



    return 0;

}

static int FUNC_0(DeviceState *VAR_0, QEMUFile *VAR_1)
{ VirtioCcwDevice *dev = VIRTIO_CCW_DEVICE(VAR_0); CcwDevice *ccw_dev = CCW_DEVICE(VAR_0); CCWDeviceClass *ck = CCW_DEVICE_GET_CLASS(ccw_dev); SubchDev *s = ccw_dev->sch; VirtIODevice *vdev = virtio_ccw_get_vdev(s); int VAR_2; s->driver_data = dev; subch_device_load(s, VAR_1); if (ck->refill_ids) { ck->refill_ids(ccw_dev); } VAR_2 = qemu_get_be32(VAR_1); if (VAR_2 != 0) { dev->indicators = get_indicator(qemu_get_be64(VAR_1), VAR_2); } else { qemu_get_be64(VAR_1); dev->indicators = NULL; } VAR_2 = qemu_get_be32(VAR_1); if (VAR_2 != 0) { dev->indicators2 = get_indicator(qemu_get_be64(VAR_1), VAR_2); } else { qemu_get_be64(VAR_1); dev->indicators2 = NULL; } VAR_2 = qemu_get_be32(VAR_1); if (VAR_2 != 0) { dev->summary_indicator = get_indicator(qemu_get_be64(VAR_1), VAR_2); } else { qemu_get_be64(VAR_1); dev->summary_indicator = NULL; } qemu_get_be16s(VAR_1, &vdev->config_vector); dev->routes.adapter.ind_offset = qemu_get_be64(VAR_1); dev->thinint_isc = qemu_get_byte(VAR_1); dev->revision = qemu_get_be32(VAR_1); if (s->thinint_active) { return css_register_io_adapter(CSS_IO_ADAPTER_VIRTIO,
dev->thinint_isc, true, false,
&dev->routes.adapter.adapter_id); } return 0; }