Re: [PATCH 2/3] storage: Clean up return value checking

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

 



On Fri, Jan 13, 2017 at 07:59:09 -0500, John Ferlan wrote:
> Rather than special casing the VIR_STORAGE_BLKID_PROBE_UNKNOWN after
> calling virStorageBackendBLKIDFindPart, just allow the switch statement
> handle setting ret = -2.
> 
> Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
> ---
>  src/storage/storage_backend.c | 10 +---------
>  1 file changed, 1 insertion(+), 9 deletions(-)
> 
> diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c
> index 6bdfbf1..eebf039 100644
> --- a/src/storage/storage_backend.c
> +++ b/src/storage/storage_backend.c
> @@ -2777,10 +2777,6 @@ virStorageBackendBLKIDFindEmpty(const char *device,
>          rc == VIR_STORAGE_BLKID_PROBE_UNKNOWN) {
>  
>          rc = virStorageBackendBLKIDFindPart(probe, device, format);
> -        if (rc == VIR_STORAGE_BLKID_PROBE_UNKNOWN) {
> -            ret = -2;
> -            goto cleanup;
> -        }
>      }
>  
>      switch (rc) {
> @@ -2799,10 +2795,7 @@ virStorageBackendBLKIDFindEmpty(const char *device,
>          break;
>  
>      case VIR_STORAGE_BLKID_PROBE_UNKNOWN:
> -        virReportError(VIR_ERR_STORAGE_PROBE_FAILED,
> -                       _("Not capable of probing for format type '%s', "
> -                         "requires build --overwrite"),
> -                       format);
> +        ret = -2;

ACK, nice to see the virshism to go.

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