iscsi_aio_ioctl_cb(struct iscsi_context *iscsi, int status,

                     void *command_data, void *opaque)

{

    IscsiAIOCB *acb = opaque;



    if (acb->canceled) {

        qemu_aio_release(acb);

        return;

    }



    acb->status = 0;

    if (status < 0) {

        error_report("Failed to ioctl(SG_IO) to iSCSI lun. %s",

                     iscsi_get_error(iscsi));

        acb->status = -EIO;

    }



    acb->ioh->driver_status = 0;

    acb->ioh->host_status   = 0;

    acb->ioh->resid         = 0;



#define SG_ERR_DRIVER_SENSE    0x08



    if (status == SCSI_STATUS_CHECK_CONDITION && acb->task->datain.size >= 2) {

        int ss;



        acb->ioh->driver_status |= SG_ERR_DRIVER_SENSE;



        acb->ioh->sb_len_wr = acb->task->datain.size - 2;

        ss = (acb->ioh->mx_sb_len >= acb->ioh->sb_len_wr) ?

             acb->ioh->mx_sb_len : acb->ioh->sb_len_wr;

        memcpy(acb->ioh->sbp, &acb->task->datain.data[2], ss);

    }



    iscsi_schedule_bh(iscsi_readv_writev_bh_cb, acb);

}

iscsi_aio_ioctl_cb(struct iscsi_context *iscsi, int status,

                     void *command_data, void *opaque)

{

    IscsiAIOCB *acb = opaque;



    if (acb->canceled) {

        qemu_aio_release(acb);

        return;

    }



    acb->status = 0;

    if (status < 0) {

        error_report("Failed to ioctl(SG_IO) to iSCSI lun. %s",

                     iscsi_get_error(iscsi));

        acb->status = -EIO;

    }



    acb->ioh->driver_status = 0;

    acb->ioh->host_status   = 0;

    acb->ioh->resid         = 0;



#define SG_ERR_DRIVER_SENSE    0x08



    if (status == SCSI_STATUS_CHECK_CONDITION && acb->task->datain.size >= 2) {

        int ss;



        acb->ioh->driver_status |= SG_ERR_DRIVER_SENSE;



        acb->ioh->sb_len_wr = acb->task->datain.size - 2;

        ss = (acb->ioh->mx_sb_len >= acb->ioh->sb_len_wr) ?

             acb->ioh->mx_sb_len : acb->ioh->sb_len_wr;

        memcpy(acb->ioh->sbp, &acb->task->datain.data[2], ss);

    }



    iscsi_schedule_bh(iscsi_readv_writev_bh_cb, acb);

}

    if (acb->canceled) {     if (acb->canceled) {     if (acb->canceled) {     if (acb->canceled) {     if (acb->canceled) {     if (acb->canceled) {
FUNC_0(struct iscsi_context *VAR_0, int VAR_1,

                     void *VAR_2, void *VAR_3)

{

    IscsiAIOCB *acb = VAR_3;



    if (acb->canceled) {

        qemu_aio_release(acb);

        return;

    }



    acb->VAR_1 = 0;

    if (VAR_1 < 0) {

        error_report("Failed to ioctl(SG_IO) to iSCSI lun. %s",

                     iscsi_get_error(VAR_0));

        acb->VAR_1 = -EIO;

    }



    acb->ioh->driver_status = 0;

    acb->ioh->host_status   = 0;

    acb->ioh->resid         = 0;



#define SG_ERR_DRIVER_SENSE    0x08



    if (VAR_1 == SCSI_STATUS_CHECK_CONDITION && acb->task->datain.size >= 2) {

        int VAR_4;



        acb->ioh->driver_status |= SG_ERR_DRIVER_SENSE;



        acb->ioh->sb_len_wr = acb->task->datain.size - 2;

        VAR_4 = (acb->ioh->mx_sb_len >= acb->ioh->sb_len_wr) ?

             acb->ioh->mx_sb_len : acb->ioh->sb_len_wr;

        memcpy(acb->ioh->sbp, &acb->task->datain.data[2], VAR_4);

    }



    iscsi_schedule_bh(iscsi_readv_writev_bh_cb, acb);

}

FUNC_0(struct iscsi_context *VAR_0, int VAR_1,
void *VAR_2, void *VAR_3)
{ IscsiAIOCB *acb = VAR_3; if (acb->canceled) { qemu_aio_release(acb); return; } acb->VAR_1 = 0; if (VAR_1 < 0) { error_report("Failed to ioctl(SG_IO) to iSCSI lun. %s",
iscsi_get_error(VAR_0)); acb->VAR_1 = -EIO; } acb->ioh->driver_status = 0; acb->ioh->host_status   = 0; acb->ioh->resid         = 0; #define SG_ERR_DRIVER_SENSE    0x08
if (VAR_1 == SCSI_STATUS_CHECK_CONDITION && acb->task->datain.size >= 2) { int VAR_4; acb->ioh->driver_status |= SG_ERR_DRIVER_SENSE; acb->ioh->sb_len_wr = acb->task->datain.size - 2; VAR_4 = (acb->ioh->mx_sb_len >= acb->ioh->sb_len_wr) ?
acb->ioh->mx_sb_len : acb->ioh->sb_len_wr; memcpy(acb->ioh->sbp, &acb->task->datain.data[2], VAR_4); } iscsi_schedule_bh(iscsi_readv_writev_bh_cb, acb); }