static int vmdk_open_desc_file(BlockDriverState *bs, int flags, char *buf,

                               Error **errp)

{

    int ret;

    char ct[128];

    BDRVVmdkState *s = bs->opaque;



    if (vmdk_parse_description(buf, "createType", ct, sizeof(ct))) {

        error_setg(errp, "invalid VMDK image descriptor");

        ret = -EINVAL;

        goto exit;

    }

    if (strcmp(ct, "monolithicFlat") &&

        strcmp(ct, "vmfs") &&

        strcmp(ct, "vmfsSparse") &&

        strcmp(ct, "twoGbMaxExtentSparse") &&

        strcmp(ct, "twoGbMaxExtentFlat")) {

        error_setg(errp, "Unsupported image type '%s'", ct);

        ret = -ENOTSUP;

        goto exit;

    }

    s->create_type = g_strdup(ct);

    s->desc_offset = 0;

    ret = vmdk_parse_extents(buf, bs, bs->file->exact_filename, errp);

exit:

    return ret;

}

static int vmdk_open_desc_file(BlockDriverState *bs, int flags, char *buf,

                               Error **errp)

{

    int ret;

    char ct[128];

    BDRVVmdkState *s = bs->opaque;



    if (vmdk_parse_description(buf, "createType", ct, sizeof(ct))) {

        error_setg(errp, "invalid VMDK image descriptor");

        ret = -EINVAL;

        goto exit;

    }

    if (strcmp(ct, "monolithicFlat") &&

        strcmp(ct, "vmfs") &&

        strcmp(ct, "vmfsSparse") &&

        strcmp(ct, "twoGbMaxExtentSparse") &&

        strcmp(ct, "twoGbMaxExtentFlat")) {

        error_setg(errp, "Unsupported image type '%s'", ct);

        ret = -ENOTSUP;

        goto exit;

    }

    s->create_type = g_strdup(ct);

    s->desc_offset = 0;

    ret = vmdk_parse_extents(buf, bs, bs->file->exact_filename, errp);

exit:

    return ret;

}

static int FUNC_0(BlockDriverState *VAR_0, int VAR_1, char *VAR_2,

                               Error **VAR_3)

{

    int VAR_4;

    char VAR_5[128];

    BDRVVmdkState *s = VAR_0->opaque;



    if (vmdk_parse_description(VAR_2, "createType", VAR_5, sizeof(VAR_5))) {

        error_setg(VAR_3, "invalid VMDK image descriptor");

        VAR_4 = -EINVAL;

        goto exit;

    }

    if (strcmp(VAR_5, "monolithicFlat") &&

        strcmp(VAR_5, "vmfs") &&

        strcmp(VAR_5, "vmfsSparse") &&

        strcmp(VAR_5, "twoGbMaxExtentSparse") &&

        strcmp(VAR_5, "twoGbMaxExtentFlat")) {

        error_setg(VAR_3, "Unsupported image type '%s'", VAR_5);

        VAR_4 = -ENOTSUP;

        goto exit;

    }

    s->create_type = g_strdup(VAR_5);

    s->desc_offset = 0;

    VAR_4 = vmdk_parse_extents(VAR_2, VAR_0, VAR_0->file->exact_filename, VAR_3);

exit:

    return VAR_4;

}

static int FUNC_0(BlockDriverState *VAR_0, int VAR_1, char *VAR_2,
Error **VAR_3)
{ int VAR_4; char VAR_5[128]; BDRVVmdkState *s = VAR_0->opaque; if (vmdk_parse_description(VAR_2, "createType", VAR_5, sizeof(VAR_5))) { error_setg(VAR_3, "invalid VMDK image descriptor"); VAR_4 = -EINVAL; goto exit; } if (strcmp(VAR_5, "monolithicFlat") &&
strcmp(VAR_5, "vmfs") &&
strcmp(VAR_5, "vmfsSparse") &&
strcmp(VAR_5, "twoGbMaxExtentSparse") &&
strcmp(VAR_5, "twoGbMaxExtentFlat")) { error_setg(VAR_3, "Unsupported image type '%s'", VAR_5); VAR_4 = -ENOTSUP; goto exit; } s->create_type = g_strdup(VAR_5); s->desc_offset = 0; VAR_4 = vmdk_parse_extents(VAR_2, VAR_0, VAR_0->file->exact_filename, VAR_3); exit:
return VAR_4; }