On 06.03.2017 20:54, Max Reitz wrote:
> Add an Error parameter to the block drivers' bdrv_truncate() interface.
> If a block driver does not set this in case of an error, the generic
> bdrv_truncate() implementation will do so.
> 
> Where it is obvious, this patch also makes some block drivers set this
> value.
> 
> Signed-off-by: Max Reitz <mre...@redhat.com>
> ---
>  include/block/block_int.h |  2 +-
>  block.c                   |  4 ++--
>  block/archipelago.c       |  3 ++-
>  block/blkdebug.c          |  4 ++--
>  block/crypto.c            |  5 +++--
>  block/file-posix.c        |  2 +-
>  block/file-win32.c        |  6 +++---
>  block/gluster.c           |  3 ++-
>  block/iscsi.c             |  4 ++--
>  block/nfs.c               |  2 +-
>  block/qcow2.c             |  8 ++++----
>  block/qed.c               |  2 +-
>  block/raw-format.c        |  4 ++--
>  block/rbd.c               |  2 +-
>  block/sheepdog.c          | 14 ++++++--------
>  15 files changed, 33 insertions(+), 32 deletions(-)

[...]


> diff --git a/block/archipelago.c b/block/archipelago.c
> index 2449cfc702..0015178381 100644
> --- a/block/archipelago.c
> +++ b/block/archipelago.c
> @@ -976,7 +976,8 @@ static int64_t 
> qemu_archipelago_getlength(BlockDriverState *bs)
>      return archipelago_volume_info(s);
>  }
>  
> -static int qemu_archipelago_truncate(BlockDriverState *bs, int64_t offset)
> +static int qemu_archipelago_truncate(BlockDriverState *bs, int64_t offset,
> +                                     Error *errp)

This should be **errp, of course. Will fix. :-/

Max

>  {
>      int ret, targetlen;
>      struct xseg_request *req;

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to