[PATCH 05/23] qemu-img: simplify --repair error message

Michael Tokarev posted 23 patches 7 months, 4 weeks ago
Maintainers: Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>
[PATCH 05/23] qemu-img: simplify --repair error message
Posted by Michael Tokarev 7 months, 4 weeks ago
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 qemu-img.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/qemu-img.c b/qemu-img.c
index 3ae07bfae0..ad7fa033b1 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -843,8 +843,8 @@ static int img_check(const img_cmd_t *ccmd, int argc, char **argv)
             } else if (!strcmp(optarg, "all")) {
                 fix = BDRV_FIX_LEAKS | BDRV_FIX_ERRORS;
             } else {
-                error_exit(ccmd, "Unknown option value for -r "
-                           "(expecting 'leaks' or 'all'): %s", optarg);
+                error_exit(ccmd,
+                           "--repair expects 'leaks' or 'all' not '%s'", optarg);
             }
             break;
         case OPTION_OUTPUT:
-- 
2.39.2
Re: [PATCH 05/23] qemu-img: simplify --repair error message
Posted by Daniel P. Berrangé 7 months, 2 weeks ago
On Sat, Feb 10, 2024 at 12:22:26AM +0300, Michael Tokarev wrote:
> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
> ---
>  qemu-img.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/qemu-img.c b/qemu-img.c
> index 3ae07bfae0..ad7fa033b1 100644
> --- a/qemu-img.c
> +++ b/qemu-img.c
> @@ -843,8 +843,8 @@ static int img_check(const img_cmd_t *ccmd, int argc, char **argv)
>              } else if (!strcmp(optarg, "all")) {
>                  fix = BDRV_FIX_LEAKS | BDRV_FIX_ERRORS;
>              } else {
> -                error_exit(ccmd, "Unknown option value for -r "
> -                           "(expecting 'leaks' or 'all'): %s", optarg);
> +                error_exit(ccmd,
> +                           "--repair expects 'leaks' or 'all' not '%s'", optarg);
>              }

Should we say  '--repair/-r expects...' since we don't know which the
user passed

Either way

  Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|