On 23.03.2017 19:00, Kevin Wolf wrote: > 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 <mre...@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.
I'm probably going to follow Stefan's proposal of adding (even generic) error messages to all drivers anyway. Max
signature.asc
Description: OpenPGP digital signature