static void qed_copy_from_backing_file(BDRVQEDState *s, uint64_t pos,

                                       uint64_t len, uint64_t offset,

                                       BlockDriverCompletionFunc *cb,

                                       void *opaque)

{

    CopyFromBackingFileCB *copy_cb;



    /* Skip copy entirely if there is no work to do */

    if (len == 0) {

        cb(opaque, 0);

        return;

    }



    copy_cb = gencb_alloc(sizeof(*copy_cb), cb, opaque);

    copy_cb->s = s;

    copy_cb->offset = offset;

    copy_cb->iov.iov_base = qemu_blockalign(s->bs, len);

    copy_cb->iov.iov_len = len;

    qemu_iovec_init_external(&copy_cb->qiov, &copy_cb->iov, 1);



    qed_read_backing_file(s, pos, &copy_cb->qiov,

                          qed_copy_from_backing_file_write, copy_cb);

}

static void qed_copy_from_backing_file(BDRVQEDState *s, uint64_t pos,

                                       uint64_t len, uint64_t offset,

                                       BlockDriverCompletionFunc *cb,

                                       void *opaque)

{

    CopyFromBackingFileCB *copy_cb;



    

    if (len == 0) {

        cb(opaque, 0);

        return;

    }



    copy_cb = gencb_alloc(sizeof(*copy_cb), cb, opaque);

    copy_cb->s = s;

    copy_cb->offset = offset;

    copy_cb->iov.iov_base = qemu_blockalign(s->bs, len);

    copy_cb->iov.iov_len = len;

    qemu_iovec_init_external(&copy_cb->qiov, &copy_cb->iov, 1);



    qed_read_backing_file(s, pos, &copy_cb->qiov,

                          qed_copy_from_backing_file_write, copy_cb);

}

    qed_read_backing_file(s, pos, &copy_cb->qiov,
static void FUNC_0(BDRVQEDState *VAR_0, uint64_t VAR_1,

                                       uint64_t VAR_2, uint64_t VAR_3,

                                       BlockDriverCompletionFunc *VAR_4,

                                       void *VAR_5)

{

    CopyFromBackingFileCB *copy_cb;



    

    if (VAR_2 == 0) {

        VAR_4(VAR_5, 0);

        return;

    }



    copy_cb = gencb_alloc(sizeof(*copy_cb), VAR_4, VAR_5);

    copy_cb->VAR_0 = VAR_0;

    copy_cb->VAR_3 = VAR_3;

    copy_cb->iov.iov_base = qemu_blockalign(VAR_0->bs, VAR_2);

    copy_cb->iov.iov_len = VAR_2;

    qemu_iovec_init_external(&copy_cb->qiov, &copy_cb->iov, 1);



    qed_read_backing_file(VAR_0, VAR_1, &copy_cb->qiov,

                          qed_copy_from_backing_file_write, copy_cb);

}

static void FUNC_0(BDRVQEDState *VAR_0, uint64_t VAR_1,
uint64_t VAR_2, uint64_t VAR_3,
BlockDriverCompletionFunc *VAR_4,
void *VAR_5)
{ CopyFromBackingFileCB *copy_cb; if (VAR_2 == 0) { VAR_4(VAR_5, 0); return; } copy_cb = gencb_alloc(sizeof(*copy_cb), VAR_4, VAR_5); copy_cb->VAR_0 = VAR_0; copy_cb->VAR_3 = VAR_3; copy_cb->iov.iov_base = qemu_blockalign(VAR_0->bs, VAR_2); copy_cb->iov.iov_len = VAR_2; qemu_iovec_init_external(&copy_cb->qiov, &copy_cb->iov, 1); qed_read_backing_file(VAR_0, VAR_1, &copy_cb->qiov,
qed_copy_from_backing_file_write, copy_cb); }