diff mbox

[v3,21/22] block: Fix error message style

Message ID 1466721446-27737-22-git-send-email-eblake@redhat.com
State New
Headers show

Commit Message

Eric Blake June 23, 2016, 10:37 p.m. UTC
error_setg() is not supposed to be used for multi-sentence
messages; tweak the message to append a hint instead.

Signed-off-by: Eric Blake <eblake@redhat.com>

---
v3: new patch
---
 block/raw-posix.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Fam Zheng June 24, 2016, 7:09 a.m. UTC | #1
On Thu, 06/23 16:37, Eric Blake wrote:
> error_setg() is not supposed to be used for multi-sentence
> messages; tweak the message to append a hint instead.
> 
> Signed-off-by: Eric Blake <eblake@redhat.com>
> 
> ---
> v3: new patch
> ---
>  block/raw-posix.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/block/raw-posix.c b/block/raw-posix.c
> index d3d7cce..c979ac3 100644
> --- a/block/raw-posix.c
> +++ b/block/raw-posix.c
> @@ -350,8 +350,8 @@ static void raw_probe_alignment(BlockDriverState *bs, int fd, Error **errp)
>      }
> 
>      if (!s->buf_align || !bs->bl.request_alignment) {
> -        error_setg(errp, "Could not find working O_DIRECT alignment. "
> -                         "Try cache.direct=off.");
> +        error_setg(errp, "Could not find working O_DIRECT alignment");
> +        error_append_hint(errp, "Try cache.direct=off\n");
>      }
>  }
> 
> -- 
> 2.5.5
> 

Reviewed-by: Fam Zheng <famz@redhat.com>
diff mbox

Patch

diff --git a/block/raw-posix.c b/block/raw-posix.c
index d3d7cce..c979ac3 100644
--- a/block/raw-posix.c
+++ b/block/raw-posix.c
@@ -350,8 +350,8 @@  static void raw_probe_alignment(BlockDriverState *bs, int fd, Error **errp)
     }

     if (!s->buf_align || !bs->bl.request_alignment) {
-        error_setg(errp, "Could not find working O_DIRECT alignment. "
-                         "Try cache.direct=off.");
+        error_setg(errp, "Could not find working O_DIRECT alignment");
+        error_append_hint(errp, "Try cache.direct=off\n");
     }
 }