static int vmdk_reopen_prepare(BDRVReopenState *state,

                               BlockReopenQueue *queue, Error **errp)

{

    BDRVVmdkState *s;

    int ret = -1;

    int i;

    VmdkExtent *e;



    assert(state != NULL);

    assert(state->bs != NULL);



    if (queue == NULL) {

        error_setg(errp, "No reopen queue for VMDK extents");

        goto exit;

    }



    s = state->bs->opaque;



    assert(s != NULL);



    for (i = 0; i < s->num_extents; i++) {

        e = &s->extents[i];

        if (e->file != state->bs->file) {

            bdrv_reopen_queue(queue, e->file, state->flags);

        }

    }

    ret = 0;



exit:

    return ret;

}

static int vmdk_reopen_prepare(BDRVReopenState *state,

                               BlockReopenQueue *queue, Error **errp)

{

    BDRVVmdkState *s;

    int ret = -1;

    int i;

    VmdkExtent *e;



    assert(state != NULL);

    assert(state->bs != NULL);



    if (queue == NULL) {

        error_setg(errp, "No reopen queue for VMDK extents");

        goto exit;

    }



    s = state->bs->opaque;



    assert(s != NULL);



    for (i = 0; i < s->num_extents; i++) {

        e = &s->extents[i];

        if (e->file != state->bs->file) {

            bdrv_reopen_queue(queue, e->file, state->flags);

        }

    }

    ret = 0;



exit:

    return ret;

}

static int FUNC_0(BDRVReopenState *VAR_0,

                               BlockReopenQueue *VAR_1, Error **VAR_2)

{

    BDRVVmdkState *s;

    int VAR_3 = -1;

    int VAR_4;

    VmdkExtent *e;



    assert(VAR_0 != NULL);

    assert(VAR_0->bs != NULL);



    if (VAR_1 == NULL) {

        error_setg(VAR_2, "No reopen VAR_1 for VMDK extents");

        goto exit;

    }



    s = VAR_0->bs->opaque;



    assert(s != NULL);



    for (VAR_4 = 0; VAR_4 < s->num_extents; VAR_4++) {

        e = &s->extents[VAR_4];

        if (e->file != VAR_0->bs->file) {

            bdrv_reopen_queue(VAR_1, e->file, VAR_0->flags);

        }

    }

    VAR_3 = 0;



exit:

    return VAR_3;

}

static int FUNC_0(BDRVReopenState *VAR_0,
BlockReopenQueue *VAR_1, Error **VAR_2)
{ BDRVVmdkState *s; int VAR_3 = -1; int VAR_4; VmdkExtent *e; assert(VAR_0 != NULL); assert(VAR_0->bs != NULL); if (VAR_1 == NULL) { error_setg(VAR_2, "No reopen VAR_1 for VMDK extents"); goto exit; } s = VAR_0->bs->opaque; assert(s != NULL); for (VAR_4 = 0; VAR_4 < s->num_extents; VAR_4++) { e = &s->extents[VAR_4]; if (e->file != VAR_0->bs->file) { bdrv_reopen_queue(VAR_1, e->file, VAR_0->flags); } } VAR_3 = 0; exit:
return VAR_3; }