static int fdctrl_connect_drives(FDCtrl *fdctrl)

{

    unsigned int i;

    FDrive *drive;



    for (i = 0; i < MAX_FD; i++) {

        drive = &fdctrl->drives[i];

        drive->fdctrl = fdctrl;



        if (drive->bs) {

            if (bdrv_get_on_error(drive->bs, 0) != BLOCK_ERR_STOP_ENOSPC) {

                error_report("fdc doesn't support drive option werror");

                return -1;

            }

            if (bdrv_get_on_error(drive->bs, 1) != BLOCK_ERR_REPORT) {

                error_report("fdc doesn't support drive option rerror");

                return -1;

            }

        }



        fd_init(drive);

        fd_revalidate(drive);

        if (drive->bs) {

            bdrv_set_dev_ops(drive->bs, &fdctrl_block_ops, drive);

        }

    }

    return 0;

}

static int fdctrl_connect_drives(FDCtrl *fdctrl)

{

    unsigned int i;

    FDrive *drive;



    for (i = 0; i < MAX_FD; i++) {

        drive = &fdctrl->drives[i];

        drive->fdctrl = fdctrl;



        if (drive->bs) {

            if (bdrv_get_on_error(drive->bs, 0) != BLOCK_ERR_STOP_ENOSPC) {

                error_report("fdc doesn't support drive option werror");

                return -1;

            }

            if (bdrv_get_on_error(drive->bs, 1) != BLOCK_ERR_REPORT) {

                error_report("fdc doesn't support drive option rerror");

                return -1;

            }

        }



        fd_init(drive);

        fd_revalidate(drive);

        if (drive->bs) {

            bdrv_set_dev_ops(drive->bs, &fdctrl_block_ops, drive);

        }

    }

    return 0;

}

        fd_revalidate(drive);
static int FUNC_0(FDCtrl *VAR_0)

{

    unsigned int VAR_1;

    FDrive *drive;



    for (VAR_1 = 0; VAR_1 < MAX_FD; VAR_1++) {

        drive = &VAR_0->drives[VAR_1];

        drive->VAR_0 = VAR_0;



        if (drive->bs) {

            if (bdrv_get_on_error(drive->bs, 0) != BLOCK_ERR_STOP_ENOSPC) {

                error_report("fdc doesn't support drive option werror");

                return -1;

            }

            if (bdrv_get_on_error(drive->bs, 1) != BLOCK_ERR_REPORT) {

                error_report("fdc doesn't support drive option rerror");

                return -1;

            }

        }



        fd_init(drive);

        fd_revalidate(drive);

        if (drive->bs) {

            bdrv_set_dev_ops(drive->bs, &fdctrl_block_ops, drive);

        }

    }

    return 0;

}

static int FUNC_0(FDCtrl *VAR_0)
{ unsigned int VAR_1; FDrive *drive; for (VAR_1 = 0; VAR_1 < MAX_FD; VAR_1++) { drive = &VAR_0->drives[VAR_1]; drive->VAR_0 = VAR_0; if (drive->bs) { if (bdrv_get_on_error(drive->bs, 0) != BLOCK_ERR_STOP_ENOSPC) { error_report("fdc doesn't support drive option werror"); return -1; } if (bdrv_get_on_error(drive->bs, 1) != BLOCK_ERR_REPORT) { error_report("fdc doesn't support drive option rerror"); return -1; } } fd_init(drive); fd_revalidate(drive); if (drive->bs) { bdrv_set_dev_ops(drive->bs, &fdctrl_block_ops, drive); } } return 0; }