static int qemu_gluster_reopen_prepare(BDRVReopenState *state,

                                       BlockReopenQueue *queue, Error **errp)

{

    int ret = 0;

    BDRVGlusterReopenState *reop_s;

    GlusterConf *gconf = NULL;

    int open_flags = 0;



    assert(state != NULL);

    assert(state->bs != NULL);



    state->opaque = g_malloc0(sizeof(BDRVGlusterReopenState));

    reop_s = state->opaque;



    qemu_gluster_parse_flags(state->flags, &open_flags);



    gconf = g_malloc0(sizeof(GlusterConf));



    reop_s->glfs = qemu_gluster_init(gconf, state->bs->filename, errp);

    if (reop_s->glfs == NULL) {

        ret = -errno;

        goto exit;

    }



    reop_s->fd = glfs_open(reop_s->glfs, gconf->image, open_flags);

    if (reop_s->fd == NULL) {

        /* reops->glfs will be cleaned up in _abort */

        ret = -errno;

        goto exit;

    }



exit:

    /* state->opaque will be freed in either the _abort or _commit */

    qemu_gluster_gconf_free(gconf);

    return ret;

}

static int qemu_gluster_reopen_prepare(BDRVReopenState *state,

                                       BlockReopenQueue *queue, Error **errp)

{

    int ret = 0;

    BDRVGlusterReopenState *reop_s;

    GlusterConf *gconf = NULL;

    int open_flags = 0;



    assert(state != NULL);

    assert(state->bs != NULL);



    state->opaque = g_malloc0(sizeof(BDRVGlusterReopenState));

    reop_s = state->opaque;



    qemu_gluster_parse_flags(state->flags, &open_flags);



    gconf = g_malloc0(sizeof(GlusterConf));



    reop_s->glfs = qemu_gluster_init(gconf, state->bs->filename, errp);

    if (reop_s->glfs == NULL) {

        ret = -errno;

        goto exit;

    }



    reop_s->fd = glfs_open(reop_s->glfs, gconf->image, open_flags);

    if (reop_s->fd == NULL) {

        

        ret = -errno;

        goto exit;

    }



exit:

    

    qemu_gluster_gconf_free(gconf);

    return ret;

}

    state->opaque = g_malloc0(sizeof(BDRVGlusterReopenState));     gconf = g_malloc0(sizeof(GlusterConf));
static int FUNC_0(BDRVReopenState *VAR_0,

                                       BlockReopenQueue *VAR_1, Error **VAR_2)

{

    int VAR_3 = 0;

    BDRVGlusterReopenState *reop_s;

    GlusterConf *gconf = NULL;

    int VAR_4 = 0;



    assert(VAR_0 != NULL);

    assert(VAR_0->bs != NULL);



    VAR_0->opaque = g_malloc0(sizeof(BDRVGlusterReopenState));

    reop_s = VAR_0->opaque;



    qemu_gluster_parse_flags(VAR_0->flags, &VAR_4);



    gconf = g_malloc0(sizeof(GlusterConf));



    reop_s->glfs = qemu_gluster_init(gconf, VAR_0->bs->filename, VAR_2);

    if (reop_s->glfs == NULL) {

        VAR_3 = -errno;

        goto exit;

    }



    reop_s->fd = glfs_open(reop_s->glfs, gconf->image, VAR_4);

    if (reop_s->fd == NULL) {

        

        VAR_3 = -errno;

        goto exit;

    }



exit:

    

    qemu_gluster_gconf_free(gconf);

    return VAR_3;

}

static int FUNC_0(BDRVReopenState *VAR_0,
BlockReopenQueue *VAR_1, Error **VAR_2)
{ int VAR_3 = 0; BDRVGlusterReopenState *reop_s; GlusterConf *gconf = NULL; int VAR_4 = 0; assert(VAR_0 != NULL); assert(VAR_0->bs != NULL); VAR_0->opaque = g_malloc0(sizeof(BDRVGlusterReopenState)); reop_s = VAR_0->opaque; qemu_gluster_parse_flags(VAR_0->flags, &VAR_4); gconf = g_malloc0(sizeof(GlusterConf)); reop_s->glfs = qemu_gluster_init(gconf, VAR_0->bs->filename, VAR_2); if (reop_s->glfs == NULL) { VAR_3 = -errno; goto exit; } reop_s->fd = glfs_open(reop_s->glfs, gconf->image, VAR_4); if (reop_s->fd == NULL) { VAR_3 = -errno; goto exit; } exit:
qemu_gluster_gconf_free(gconf); return VAR_3; }