Re: [PATCH 3/3] storage: Alter error message in probe/empty checks

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

 



On Fri, Jan 13, 2017 at 07:59:10 -0500, John Ferlan wrote:
> For case VIR_STORAGE_BLKID_PROBE_DIFFERENT, clean up the message to
> avoid using the virsh like --overwrite syntax. Additionally provide
> a different error message when not writing the label to avoid confusion.
> 
> Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
> ---
>  src/storage/storage_backend.c | 14 ++++++++++----
>  1 file changed, 10 insertions(+), 4 deletions(-)
> 
> diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c
> index eebf039..c6a08eb 100644
> --- a/src/storage/storage_backend.c
> +++ b/src/storage/storage_backend.c
> @@ -2808,10 +2808,16 @@ virStorageBackendBLKIDFindEmpty(const char *device,
>          break;
>  
>      case VIR_STORAGE_BLKID_PROBE_DIFFERENT:
> -        virReportError(VIR_ERR_STORAGE_POOL_BUILT,
> -                       _("Device '%s' formatted cannot overwrite using '%s', "
> -                         "requires build --overwrite"),
> -                       device, format);
> +        if (writelabel)
> +            virReportError(VIR_ERR_STORAGE_POOL_BUILT,
> +                           _("Device '%s' formatted cannot overwrite using "

The beginning of the error message does not make sense.

> +                             "'%s', requires create/build with overwrite flag"),
> +                           device, format);
> +        else
> +            virReportError(VIR_ERR_OPERATION_INVALID,
> +                           _("Format of device '%s' does not match expected "
> +                             "format '%s', requires rebuild"),

I'd drop the "requires rebuild" part.

ACK

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