/* Returns 0 if the check could be completed (it doesn't mean that the image is free of errors) or -errno when an internal error occurred. The results of the check are stored in res.  */
int bdrv_check(BlockDriverState *bs, BdrvCheckResult *res, BdrvCheckMode fix)
/* Returns 0 if the check could be completed (it doesn't mean that the image is free of errors) or -errno when an internal error occurred. The results of the check are stored in res.  */
int bdrv_check(BlockDriverState *bs, BdrvCheckResult *res, BdrvCheckMode fix)
{
    if (bs->drv->bdrv_check == NULL) {
        return -ENOTSUP;
    }
    memset(res, 0, sizeof(*res));
    return bs->drv->bdrv_check(bs, res, fix);
}