int bdrv_file_open(BlockDriverState **pbs, const char *filename, int flags)

{

    BlockDriverState *bs;

    int ret;



    bs = bdrv_new("");

    if (!bs)

        return -ENOMEM;

    ret = bdrv_open2(bs, filename, flags | BDRV_O_FILE, NULL);

    if (ret < 0) {

        bdrv_delete(bs);

        return ret;

    }

    bs->growable = 1;

    *pbs = bs;

    return 0;

}

int bdrv_file_open(BlockDriverState **pbs, const char *filename, int flags)

{

    BlockDriverState *bs;

    int ret;



    bs = bdrv_new("");

    if (!bs)

        return -ENOMEM;

    ret = bdrv_open2(bs, filename, flags | BDRV_O_FILE, NULL);

    if (ret < 0) {

        bdrv_delete(bs);

        return ret;

    }

    bs->growable = 1;

    *pbs = bs;

    return 0;

}

int FUNC_0(BlockDriverState **VAR_0, const char *VAR_1, int VAR_2)

{

    BlockDriverState *bs;

    int VAR_3;



    bs = bdrv_new("");

    if (!bs)

        return -ENOMEM;

    VAR_3 = bdrv_open2(bs, VAR_1, VAR_2 | BDRV_O_FILE, NULL);

    if (VAR_3 < 0) {

        bdrv_delete(bs);

        return VAR_3;

    }

    bs->growable = 1;

    *VAR_0 = bs;

    return 0;

}

int FUNC_0(BlockDriverState **VAR_0, const char *VAR_1, int VAR_2)
{ BlockDriverState *bs; int VAR_3; bs = bdrv_new(""); if (!bs)
return -ENOMEM; VAR_3 = bdrv_open2(bs, VAR_1, VAR_2 | BDRV_O_FILE, NULL); if (VAR_3 < 0) { bdrv_delete(bs); return VAR_3; } bs->growable = 1; *VAR_0 = bs; return 0; }