static int execute_command(BlockDriverState *bdrv,

                           SCSIGenericReq *r, int direction,

			   BlockDriverCompletionFunc *complete)

{

    SCSIGenericState *s = DO_UPCAST(SCSIGenericState, qdev, r->req.dev);



    r->io_header.interface_id = 'S';

    r->io_header.dxfer_direction = direction;

    r->io_header.dxferp = r->buf;

    r->io_header.dxfer_len = r->buflen;

    r->io_header.cmdp = r->req.cmd.buf;

    r->io_header.cmd_len = r->req.cmd.len;

    r->io_header.mx_sb_len = sizeof(s->sensebuf);

    r->io_header.sbp = s->sensebuf;

    r->io_header.timeout = MAX_UINT;

    r->io_header.usr_ptr = r;

    r->io_header.flags |= SG_FLAG_DIRECT_IO;



    r->req.aiocb = bdrv_aio_ioctl(bdrv, SG_IO, &r->io_header, complete, r);

    if (r->req.aiocb == NULL) {

        BADF("execute_command: read failed !\n");

        return -1;

    }



    return 0;

}

static int execute_command(BlockDriverState *bdrv,

                           SCSIGenericReq *r, int direction,

			   BlockDriverCompletionFunc *complete)

{

    SCSIGenericState *s = DO_UPCAST(SCSIGenericState, qdev, r->req.dev);



    r->io_header.interface_id = 'S';

    r->io_header.dxfer_direction = direction;

    r->io_header.dxferp = r->buf;

    r->io_header.dxfer_len = r->buflen;

    r->io_header.cmdp = r->req.cmd.buf;

    r->io_header.cmd_len = r->req.cmd.len;

    r->io_header.mx_sb_len = sizeof(s->sensebuf);

    r->io_header.sbp = s->sensebuf;

    r->io_header.timeout = MAX_UINT;

    r->io_header.usr_ptr = r;

    r->io_header.flags |= SG_FLAG_DIRECT_IO;



    r->req.aiocb = bdrv_aio_ioctl(bdrv, SG_IO, &r->io_header, complete, r);

    if (r->req.aiocb == NULL) {

        BADF("execute_command: read failed !\n");

        return -1;

    }



    return 0;

}

        return -1;
static int FUNC_0(BlockDriverState *VAR_0,

                           SCSIGenericReq *VAR_1, int VAR_2,

			   BlockDriverCompletionFunc *VAR_3)

{

    SCSIGenericState *s = DO_UPCAST(SCSIGenericState, qdev, VAR_1->req.dev);



    VAR_1->io_header.interface_id = 'S';

    VAR_1->io_header.dxfer_direction = VAR_2;

    VAR_1->io_header.dxferp = VAR_1->buf;

    VAR_1->io_header.dxfer_len = VAR_1->buflen;

    VAR_1->io_header.cmdp = VAR_1->req.cmd.buf;

    VAR_1->io_header.cmd_len = VAR_1->req.cmd.len;

    VAR_1->io_header.mx_sb_len = sizeof(s->sensebuf);

    VAR_1->io_header.sbp = s->sensebuf;

    VAR_1->io_header.timeout = MAX_UINT;

    VAR_1->io_header.usr_ptr = VAR_1;

    VAR_1->io_header.flags |= SG_FLAG_DIRECT_IO;



    VAR_1->req.aiocb = bdrv_aio_ioctl(VAR_0, SG_IO, &VAR_1->io_header, VAR_3, VAR_1);

    if (VAR_1->req.aiocb == NULL) {

        BADF("FUNC_0: read failed !\n");

        return -1;

    }



    return 0;

}

static int FUNC_0(BlockDriverState *VAR_0,
SCSIGenericReq *VAR_1, int VAR_2,
BlockDriverCompletionFunc *VAR_3)
{ SCSIGenericState *s = DO_UPCAST(SCSIGenericState, qdev, VAR_1->req.dev); VAR_1->io_header.interface_id = 'S'; VAR_1->io_header.dxfer_direction = VAR_2; VAR_1->io_header.dxferp = VAR_1->buf; VAR_1->io_header.dxfer_len = VAR_1->buflen; VAR_1->io_header.cmdp = VAR_1->req.cmd.buf; VAR_1->io_header.cmd_len = VAR_1->req.cmd.len; VAR_1->io_header.mx_sb_len = sizeof(s->sensebuf); VAR_1->io_header.sbp = s->sensebuf; VAR_1->io_header.timeout = MAX_UINT; VAR_1->io_header.usr_ptr = VAR_1; VAR_1->io_header.flags |= SG_FLAG_DIRECT_IO; VAR_1->req.aiocb = bdrv_aio_ioctl(VAR_0, SG_IO, &VAR_1->io_header, VAR_3, VAR_1); if (VAR_1->req.aiocb == NULL) { BADF("FUNC_0: read failed !\n"); return -1; } return 0; }