int bdrv_load_vmstate(BlockDriverState *bs, uint8_t *buf,

                      int64_t pos, int size)

{

    BlockDriver *drv = bs->drv;

    if (!drv)

        return -ENOMEDIUM;

    if (drv->bdrv_load_vmstate)

        return drv->bdrv_load_vmstate(bs, buf, pos, size);

    if (bs->file)

        return bdrv_load_vmstate(bs->file, buf, pos, size);

    return -ENOTSUP;

}

int bdrv_load_vmstate(BlockDriverState *bs, uint8_t *buf,

                      int64_t pos, int size)

{

    BlockDriver *drv = bs->drv;

    if (!drv)

        return -ENOMEDIUM;

    if (drv->bdrv_load_vmstate)

        return drv->bdrv_load_vmstate(bs, buf, pos, size);

    if (bs->file)

        return bdrv_load_vmstate(bs->file, buf, pos, size);

    return -ENOTSUP;

}

int FUNC_0(BlockDriverState *VAR_0, uint8_t *VAR_1,

                      int64_t VAR_2, int VAR_3)

{

    BlockDriver *drv = VAR_0->drv;

    if (!drv)

        return -ENOMEDIUM;

    if (drv->FUNC_0)

        return drv->FUNC_0(VAR_0, VAR_1, VAR_2, VAR_3);

    if (VAR_0->file)

        return FUNC_0(VAR_0->file, VAR_1, VAR_2, VAR_3);

    return -ENOTSUP;

}

int FUNC_0(BlockDriverState *VAR_0, uint8_t *VAR_1,
int64_t VAR_2, int VAR_3)
{ BlockDriver *drv = VAR_0->drv; if (!drv)
return -ENOMEDIUM; if (drv->FUNC_0)
return drv->FUNC_0(VAR_0, VAR_1, VAR_2, VAR_3); if (VAR_0->file)
return FUNC_0(VAR_0->file, VAR_1, VAR_2, VAR_3); return -ENOTSUP; }