Skip to content
  • Hanna Reitz's avatar
    5b363937
    block: Make bdrv_open() return a BDS · 5b363937
    Hanna Reitz authored
    
    
    There are no callers to bdrv_open() or bdrv_open_inherit() left that
    pass a pointer to a non-NULL BDS pointer as the first argument of these
    functions, so we can finally drop that parameter and just make them
    return the new BDS.
    
    Generally, the following pattern is applied:
    
        bs = NULL;
        ret = bdrv_open(&bs, ..., &local_err);
        if (ret < 0) {
            error_propagate(errp, local_err);
            ...
        }
    
    by
    
        bs = bdrv_open(..., errp);
        if (!bs) {
            ret = -EINVAL;
            ...
        }
    
    Of course, there are only a few instances where the pattern is really
    pure.
    
    Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
    Reviewed-by: default avatarKevin Wolf <kwolf@redhat.com>
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
    5b363937
    block: Make bdrv_open() return a BDS
    Hanna Reitz authored
    
    
    There are no callers to bdrv_open() or bdrv_open_inherit() left that
    pass a pointer to a non-NULL BDS pointer as the first argument of these
    functions, so we can finally drop that parameter and just make them
    return the new BDS.
    
    Generally, the following pattern is applied:
    
        bs = NULL;
        ret = bdrv_open(&bs, ..., &local_err);
        if (ret < 0) {
            error_propagate(errp, local_err);
            ...
        }
    
    by
    
        bs = bdrv_open(..., errp);
        if (!bs) {
            ret = -EINVAL;
            ...
        }
    
    Of course, there are only a few instances where the pattern is really
    pure.
    
    Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
    Reviewed-by: default avatarKevin Wolf <kwolf@redhat.com>
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
Loading