static int aio_read_f(BlockBackend *blk, int argc, char **argv)

{

    int nr_iov, c;

    struct aio_ctx *ctx = g_new0(struct aio_ctx, 1);



    ctx->blk = blk;

    while ((c = getopt(argc, argv, "CP:qv")) != -1) {

        switch (c) {

        case 'C':

            ctx->Cflag = 1;

            break;

        case 'P':

            ctx->Pflag = 1;

            ctx->pattern = parse_pattern(optarg);

            if (ctx->pattern < 0) {

                g_free(ctx);

                return 0;

            }

            break;

        case 'q':

            ctx->qflag = 1;

            break;

        case 'v':

            ctx->vflag = 1;

            break;

        default:

            g_free(ctx);

            return qemuio_command_usage(&aio_read_cmd);

        }

    }



    if (optind > argc - 2) {

        g_free(ctx);

        return qemuio_command_usage(&aio_read_cmd);

    }



    ctx->offset = cvtnum(argv[optind]);

    if (ctx->offset < 0) {

        print_cvtnum_err(ctx->offset, argv[optind]);

        g_free(ctx);

        return 0;

    }

    optind++;



    if (ctx->offset & 0x1ff) {

        printf("offset %" PRId64 " is not sector aligned\n",

               ctx->offset);


        g_free(ctx);

        return 0;

    }



    nr_iov = argc - optind;

    ctx->buf = create_iovec(blk, &ctx->qiov, &argv[optind], nr_iov, 0xab);

    if (ctx->buf == NULL) {


        g_free(ctx);

        return 0;

    }



    gettimeofday(&ctx->t1, NULL);

    block_acct_start(blk_get_stats(blk), &ctx->acct, ctx->qiov.size,

                     BLOCK_ACCT_READ);

    blk_aio_readv(blk, ctx->offset >> 9, &ctx->qiov,

                  ctx->qiov.size >> 9, aio_read_done, ctx);

    return 0;

}
static int aio_read_f(BlockBackend *blk, int argc, char **argv)

{

    int nr_iov, c;

    struct aio_ctx *ctx = g_new0(struct aio_ctx, 1);



    ctx->blk = blk;

    while ((c = getopt(argc, argv, "CP:qv")) != -1) {

        switch (c) {

        case 'C':

            ctx->Cflag = 1;

            break;

        case 'P':

            ctx->Pflag = 1;

            ctx->pattern = parse_pattern(optarg);

            if (ctx->pattern < 0) {

                g_free(ctx);

                return 0;

            }

            break;

        case 'q':

            ctx->qflag = 1;

            break;

        case 'v':

            ctx->vflag = 1;

            break;

        default:

            g_free(ctx);

            return qemuio_command_usage(&aio_read_cmd);

        }

    }



    if (optind > argc - 2) {

        g_free(ctx);

        return qemuio_command_usage(&aio_read_cmd);

    }



    ctx->offset = cvtnum(argv[optind]);

    if (ctx->offset < 0) {

        print_cvtnum_err(ctx->offset, argv[optind]);

        g_free(ctx);

        return 0;

    }

    optind++;



    if (ctx->offset & 0x1ff) {

        printf("offset %" PRId64 " is not sector aligned\n",

               ctx->offset);


        g_free(ctx);

        return 0;

    }



    nr_iov = argc - optind;

    ctx->buf = create_iovec(blk, &ctx->qiov, &argv[optind], nr_iov, 0xab);

    if (ctx->buf == NULL) {


        g_free(ctx);

        return 0;

    }



    gettimeofday(&ctx->t1, NULL);

    block_acct_start(blk_get_stats(blk), &ctx->acct, ctx->qiov.size,

                     BLOCK_ACCT_READ);

    blk_aio_readv(blk, ctx->offset >> 9, &ctx->qiov,

                  ctx->qiov.size >> 9, aio_read_done, ctx);

    return 0;

}
static int FUNC_0(BlockBackend *VAR_0, int VAR_1, char **VAR_2)

{

    int VAR_3, VAR_4;

    struct aio_ctx *VAR_5 = g_new0(struct aio_ctx, 1);



    VAR_5->VAR_0 = VAR_0;

    while ((VAR_4 = getopt(VAR_1, VAR_2, "CP:qv")) != -1) {

        switch (VAR_4) {

        case 'C':

            VAR_5->Cflag = 1;

            break;

        case 'P':

            VAR_5->Pflag = 1;

            VAR_5->pattern = parse_pattern(optarg);

            if (VAR_5->pattern < 0) {

                g_free(VAR_5);

                return 0;

            }

            break;

        case 'q':

            VAR_5->qflag = 1;

            break;

        case 'v':

            VAR_5->vflag = 1;

            break;

        default:

            g_free(VAR_5);

            return qemuio_command_usage(&aio_read_cmd);

        }

    }



    if (optind > VAR_1 - 2) {

        g_free(VAR_5);

        return qemuio_command_usage(&aio_read_cmd);

    }



    VAR_5->offset = cvtnum(VAR_2[optind]);

    if (VAR_5->offset < 0) {

        print_cvtnum_err(VAR_5->offset, VAR_2[optind]);

        g_free(VAR_5);

        return 0;

    }

    optind++;



    if (VAR_5->offset & 0x1ff) {

        printf("offset %" PRId64 " is not sector aligned\n",

               VAR_5->offset);


        g_free(VAR_5);

        return 0;

    }



    VAR_3 = VAR_1 - optind;

    VAR_5->buf = create_iovec(VAR_0, &VAR_5->qiov, &VAR_2[optind], VAR_3, 0xab);

    if (VAR_5->buf == NULL) {


        g_free(VAR_5);

        return 0;

    }



    gettimeofday(&VAR_5->t1, NULL);

    block_acct_start(blk_get_stats(VAR_0), &VAR_5->acct, VAR_5->qiov.size,

                     BLOCK_ACCT_READ);

    blk_aio_readv(VAR_0, VAR_5->offset >> 9, &VAR_5->qiov,

                  VAR_5->qiov.size >> 9, aio_read_done, VAR_5);

    return 0;

}
static int FUNC_0(BlockBackend *VAR_0, int VAR_1, char **VAR_2)
{ int VAR_3, VAR_4; struct aio_ctx *VAR_5 = g_new0(struct aio_ctx, 1); VAR_5->VAR_0 = VAR_0; while ((VAR_4 = getopt(VAR_1, VAR_2, "CP:qv")) != -1) { switch (VAR_4) { case 'C':
VAR_5->Cflag = 1; break; case 'P':
VAR_5->Pflag = 1; VAR_5->pattern = parse_pattern(optarg); if (VAR_5->pattern < 0) { g_free(VAR_5); return 0; } break; case 'q':
VAR_5->qflag = 1; break; case 'v':
VAR_5->vflag = 1; break; default:
g_free(VAR_5); return qemuio_command_usage(&aio_read_cmd); } } if (optind > VAR_1 - 2) { g_free(VAR_5); return qemuio_command_usage(&aio_read_cmd); } VAR_5->offset = cvtnum(VAR_2[optind]); if (VAR_5->offset < 0) { print_cvtnum_err(VAR_5->offset, VAR_2[optind]); g_free(VAR_5); return 0; } optind++; if (VAR_5->offset & 0x1ff) { printf("offset %" PRId64 " is not sector aligned\n",
VAR_5->offset); g_free(VAR_5); return 0; } VAR_3 = VAR_1 - optind; VAR_5->buf = create_iovec(VAR_0, &VAR_5->qiov, &VAR_2[optind], VAR_3, 0xab); if (VAR_5->buf == NULL) { g_free(VAR_5); return 0; } gettimeofday(&VAR_5->t1, NULL); block_acct_start(blk_get_stats(VAR_0), &VAR_5->acct, VAR_5->qiov.size,
BLOCK_ACCT_READ); blk_aio_readv(VAR_0, VAR_5->offset >> 9, &VAR_5->qiov,
VAR_5->qiov.size >> 9, aio_read_done, VAR_5); return 0; }