static int vmdk_open_sparse(BlockDriverState *bs,

                            BlockDriverState *file, int flags,

                            char *buf, Error **errp)

{

    uint32_t magic;



    magic = ldl_be_p(buf);

    switch (magic) {

        case VMDK3_MAGIC:

            return vmdk_open_vmfs_sparse(bs, file, flags, errp);

            break;

        case VMDK4_MAGIC:

            return vmdk_open_vmdk4(bs, file, flags, errp);

            break;

        default:

            return -EMEDIUMTYPE;

            break;

    }

}

static int vmdk_open_sparse(BlockDriverState *bs,

                            BlockDriverState *file, int flags,

                            char *buf, Error **errp)

{

    uint32_t magic;



    magic = ldl_be_p(buf);

    switch (magic) {

        case VMDK3_MAGIC:

            return vmdk_open_vmfs_sparse(bs, file, flags, errp);

            break;

        case VMDK4_MAGIC:

            return vmdk_open_vmdk4(bs, file, flags, errp);

            break;

        default:

            return -EMEDIUMTYPE;

            break;

    }

}

static int FUNC_0(BlockDriverState *VAR_0,

                            BlockDriverState *VAR_1, int VAR_2,

                            char *VAR_3, Error **VAR_4)

{

    uint32_t magic;



    magic = ldl_be_p(VAR_3);

    switch (magic) {

        case VMDK3_MAGIC:

            return vmdk_open_vmfs_sparse(VAR_0, VAR_1, VAR_2, VAR_4);

            break;

        case VMDK4_MAGIC:

            return vmdk_open_vmdk4(VAR_0, VAR_1, VAR_2, VAR_4);

            break;

        default:

            return -EMEDIUMTYPE;

            break;

    }

}

static int FUNC_0(BlockDriverState *VAR_0,
BlockDriverState *VAR_1, int VAR_2,
char *VAR_3, Error **VAR_4)
{ uint32_t magic; magic = ldl_be_p(VAR_3); switch (magic) { case VMDK3_MAGIC:
return vmdk_open_vmfs_sparse(VAR_0, VAR_1, VAR_2, VAR_4); break; case VMDK4_MAGIC:
return vmdk_open_vmdk4(VAR_0, VAR_1, VAR_2, VAR_4); break; default:
return -EMEDIUMTYPE; break; } }