create_iovec(BlockBackend *blk, QEMUIOVector *qiov, char **argv, int nr_iov,

             int pattern)

{

    size_t *sizes = g_new0(size_t, nr_iov);

    size_t count = 0;

    void *buf = NULL;

    void *p;

    int i;



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

        char *arg = argv[i];

        int64_t len;



        len = cvtnum(arg);

        if (len < 0) {

            print_cvtnum_err(len, arg);

            goto fail;

        }



        if (len > SIZE_MAX) {

            printf("Argument '%s' exceeds maximum size %llu\n", arg,

                   (unsigned long long)SIZE_MAX);

            goto fail;

        }



        sizes[i] = len;

        count += len;

    }



    qemu_iovec_init(qiov, nr_iov);



    buf = p = qemu_io_alloc(blk, count, pattern);



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

        qemu_iovec_add(qiov, p, sizes[i]);

        p += sizes[i];

    }



fail:

    g_free(sizes);

    return buf;

}

create_iovec(BlockBackend *blk, QEMUIOVector *qiov, char **argv, int nr_iov,

             int pattern)

{

    size_t *sizes = g_new0(size_t, nr_iov);

    size_t count = 0;

    void *buf = NULL;

    void *p;

    int i;



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

        char *arg = argv[i];

        int64_t len;



        len = cvtnum(arg);

        if (len < 0) {

            print_cvtnum_err(len, arg);

            goto fail;

        }



        if (len > SIZE_MAX) {

            printf("Argument '%s' exceeds maximum size %llu\n", arg,

                   (unsigned long long)SIZE_MAX);

            goto fail;

        }



        sizes[i] = len;

        count += len;

    }



    qemu_iovec_init(qiov, nr_iov);



    buf = p = qemu_io_alloc(blk, count, pattern);



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

        qemu_iovec_add(qiov, p, sizes[i]);

        p += sizes[i];

    }



fail:

    g_free(sizes);

    return buf;

}

        if (len > SIZE_MAX) {             printf("Argument '%s' exceeds maximum size %llu\n", arg,                    (unsigned long long)SIZE_MAX);
FUNC_0(BlockBackend *VAR_0, QEMUIOVector *VAR_1, char **VAR_2, int VAR_3,

             int VAR_4)

{

    size_t *sizes = g_new0(size_t, VAR_3);

    size_t count = 0;

    void *VAR_5 = NULL;

    void *VAR_6;

    int VAR_7;



    for (VAR_7 = 0; VAR_7 < VAR_3; VAR_7++) {

        char *VAR_8 = VAR_2[VAR_7];

        int64_t len;



        len = cvtnum(VAR_8);

        if (len < 0) {

            print_cvtnum_err(len, VAR_8);

            goto fail;

        }



        if (len > SIZE_MAX) {

            printf("Argument '%s' exceeds maximum size %llu\n", VAR_8,

                   (unsigned long long)SIZE_MAX);

            goto fail;

        }



        sizes[VAR_7] = len;

        count += len;

    }



    qemu_iovec_init(VAR_1, VAR_3);



    VAR_5 = VAR_6 = qemu_io_alloc(VAR_0, count, VAR_4);



    for (VAR_7 = 0; VAR_7 < VAR_3; VAR_7++) {

        qemu_iovec_add(VAR_1, VAR_6, sizes[VAR_7]);

        VAR_6 += sizes[VAR_7];

    }



fail:

    g_free(sizes);

    return VAR_5;

}

FUNC_0(BlockBackend *VAR_0, QEMUIOVector *VAR_1, char **VAR_2, int VAR_3,
int VAR_4)
{ size_t *sizes = g_new0(size_t, VAR_3); size_t count = 0; void *VAR_5 = NULL; void *VAR_6; int VAR_7; for (VAR_7 = 0; VAR_7 < VAR_3; VAR_7++) { char *VAR_8 = VAR_2[VAR_7]; int64_t len; len = cvtnum(VAR_8); if (len < 0) { print_cvtnum_err(len, VAR_8); goto fail; } if (len > SIZE_MAX) { printf("Argument '%s' exceeds maximum size %llu\n", VAR_8,
(unsigned long long)SIZE_MAX); goto fail; } sizes[VAR_7] = len; count += len; } qemu_iovec_init(VAR_1, VAR_3); VAR_5 = VAR_6 = qemu_io_alloc(VAR_0, count, VAR_4); for (VAR_7 = 0; VAR_7 < VAR_3; VAR_7++) { qemu_iovec_add(VAR_1, VAR_6, sizes[VAR_7]); VAR_6 += sizes[VAR_7]; } fail:
g_free(sizes); return VAR_5; }