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

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

 



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@xxxxxxxxxx>
> ---
>  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.

Attachment: signature.asc
Description: PGP signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux