qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [PATCH v2 for-2.10 3/4] block: Add errp to BD.bdrv_trun


From: Kevin Wolf
Subject: Re: [Qemu-block] [PATCH v2 for-2.10 3/4] block: Add errp to BD.bdrv_truncate()
Date: Thu, 23 Mar 2017 19:00:54 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

Am 08.03.2017 um 20:15 hat Max Reitz geschrieben:
> 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 <address@hidden>

> diff --git a/block/iscsi.c b/block/iscsi.c
> index 75d890538e..ab559a6f71 100644
> --- a/block/iscsi.c
> +++ b/block/iscsi.c
> @@ -2060,7 +2060,7 @@ static void iscsi_reopen_commit(BDRVReopenState 
> *reopen_state)
>      }
>  }
>  
> -static int iscsi_truncate(BlockDriverState *bs, int64_t offset)
> +static int iscsi_truncate(BlockDriverState *bs, int64_t offset, Error **errp)
>  {
>      IscsiLun *iscsilun = bs->opaque;
>      Error *local_err = NULL;
> @@ -2071,7 +2071,7 @@ static int iscsi_truncate(BlockDriverState *bs, int64_t 
> offset)
>  
>      iscsi_readcapacity_sync(iscsilun, &local_err);
>      if (local_err != NULL) {
> -        error_free(local_err);
> +        error_propagate(errp, local_err);
>          return -EIO;
>      }

I think this function contains a few more cases for patch 4.

Kevin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]