qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Max Reitz <mreitz@redhat.com>
Cc: qemu-block@nongnu.org, qemu-devel@nongnu.org,
	Eric Blake <eblake@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2 for-2.10 3/4] block: Add errp to BD.bdrv_truncate()
Date: Thu, 23 Mar 2017 19:00:54 +0100	[thread overview]
Message-ID: <20170323180054.GD5344@noname.redhat.com> (raw)
In-Reply-To: <20170308191544.3025-1-mreitz@redhat.com>

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 <mreitz@redhat.com>

> 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	other threads:[~2017-03-23 18:01 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-08 19:14 [Qemu-devel] [PATCH v2 for-2.10 0/4] block: Add errp to b{lk, drv}_truncate() Max Reitz
2017-03-08 19:14 ` [Qemu-devel] [PATCH v2 for-2.10 1/4] block/vhdx: Make vhdx_create() always set errp Max Reitz
2017-03-08 19:14 ` [Qemu-devel] [PATCH v2 for-2.10 2/4] block: Add errp to b{lk, drv}_truncate() Max Reitz
2017-03-23 17:46   ` Kevin Wolf
2017-03-28 19:34     ` Max Reitz
2017-03-08 19:15 ` [Qemu-devel] [PATCH v2 for-2.10 3/4] block: Add errp to BD.bdrv_truncate() Max Reitz
2017-03-23 18:00   ` Kevin Wolf [this message]
2017-03-28 19:36     ` Max Reitz
2017-03-08 19:15 ` [Qemu-devel] [PATCH v2 for-2.10 4/4] block: Add some bdrv_truncate() error messages Max Reitz
2017-03-23 18:03   ` Kevin Wolf
2017-03-28 19:35     ` Max Reitz
2017-03-23 18:05 ` [Qemu-devel] [PATCH v2 for-2.10 0/4] block: Add errp to b{lk, drv}_truncate() Kevin Wolf
2017-03-28 19:37   ` Max Reitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170323180054.GD5344@noname.redhat.com \
    --to=kwolf@redhat.com \
    --cc=eblake@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).