int bdrv_can_snapshot(BlockDriverState *bs)

{

    BlockDriver *drv = bs->drv;

    if (!drv || bdrv_is_removable(bs) || bdrv_is_read_only(bs)) {

        return 0;

    }



    if (!drv->bdrv_snapshot_create) {

        if (bs->file != NULL) {

            return bdrv_can_snapshot(bs->file);

        }

        return 0;

    }



    return 1;

}

int bdrv_can_snapshot(BlockDriverState *bs)

{

    BlockDriver *drv = bs->drv;

    if (!drv || bdrv_is_removable(bs) || bdrv_is_read_only(bs)) {

        return 0;

    }



    if (!drv->bdrv_snapshot_create) {

        if (bs->file != NULL) {

            return bdrv_can_snapshot(bs->file);

        }

        return 0;

    }



    return 1;

}

int FUNC_0(BlockDriverState *VAR_0)

{

    BlockDriver *drv = VAR_0->drv;

    if (!drv || bdrv_is_removable(VAR_0) || bdrv_is_read_only(VAR_0)) {

        return 0;

    }



    if (!drv->bdrv_snapshot_create) {

        if (VAR_0->file != NULL) {

            return FUNC_0(VAR_0->file);

        }

        return 0;

    }



    return 1;

}

int FUNC_0(BlockDriverState *VAR_0)
{ BlockDriver *drv = VAR_0->drv; if (!drv || bdrv_is_removable(VAR_0) || bdrv_is_read_only(VAR_0)) { return 0; } if (!drv->bdrv_snapshot_create) { if (VAR_0->file != NULL) { return FUNC_0(VAR_0->file); } return 0; } return 1; }