[libvirt] [PATCH 4/6] storage: fix virStorageFileGetBackingStoreStr error handling

Peter Krempa pkrempa at redhat.com
Thu Apr 26 07:56:16 UTC 2018


On Wed, Apr 25, 2018 at 16:52:41 +0100, Daniel Berrange wrote:
> The virStorageFileGetBackingStoreStr method has overloaded the NULL
> return value to indicate both no backing available and a fatal
> error dealing with it.
> 
> The caller is thus not able to correctly propagate the error
> messages.
> 
> Signed-off-by: Daniel P. Berrangé <berrange at redhat.com>
> ---
>  src/qemu/qemu_driver.c    | 15 +++++++++------
>  src/util/virstoragefile.c | 49 +++++++++++++++++++++++++++++++----------------
>  src/util/virstoragefile.h |  5 +++--
>  3 files changed, 44 insertions(+), 25 deletions(-)

[...]

> diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
> index 531540ac91..f09035cd4a 100644
> --- a/src/util/virstoragefile.c
> +++ b/src/util/virstoragefile.c
> @@ -4357,14 +4357,8 @@ virStorageFileRead(virStorageSourcePtr src,
>          return -1;
>      }
>  
> -    if (!src->drv->backend->storageFileRead) {
> -        virReportError(VIR_ERR_INTERNAL_ERROR,
> -                       _("storage file reading is not supported for "
> -                         "storage type %s (protocol: %s)"),
> -                       virStorageTypeToString(src->type),
> -                       virStorageNetProtocolTypeToString(src->protocol));
> +    if (!src->drv->backend->storageFileRead)

This is called from qemuDomainBlockPeek, where this would cause no error
to be reported.

ACK with the above addressed.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20180426/7378c8d7/attachment-0001.sig>


More information about the libvir-list mailing list