[Qemu-devel] [PATCH v2 1/7] nbd-client: Fix error message typos

Eric Blake posted 7 patches 8 years, 3 months ago
[Qemu-devel] [PATCH v2 1/7] nbd-client: Fix error message typos
Posted by Eric Blake 8 years, 3 months ago
Provide missing spaces that are required when using string
concatenation to break error messages across source lines.

Signed-off-by: Eric Blake <eblake@redhat.com>
---
 block/nbd-client.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/block/nbd-client.c b/block/nbd-client.c
index b44d4d4a01..de6c153328 100644
--- a/block/nbd-client.c
+++ b/block/nbd-client.c
@@ -248,7 +248,7 @@ static int nbd_parse_error_payload(NBDStructuredReplyChunk *chunk,

     error = nbd_errno_to_system_errno(payload_advance32(&payload));
     if (error == 0) {
-        error_setg(errp, "Protocol error: server sent structured error chunk"
+        error_setg(errp, "Protocol error: server sent structured error chunk "
                          "with error = 0");
         return -EINVAL;
     }
@@ -257,7 +257,7 @@ static int nbd_parse_error_payload(NBDStructuredReplyChunk *chunk,
     message_size = payload_advance16(&payload);

     if (message_size > chunk->length - sizeof(error) - sizeof(message_size)) {
-        error_setg(errp, "Protocol error: server sent structured error chunk"
+        error_setg(errp, "Protocol error: server sent structured error chunk "
                          "with incorrect message size");
         return -EINVAL;
     }
@@ -408,7 +408,7 @@ static coroutine_fn int nbd_co_do_receive_one_chunk(
     if (chunk->type == NBD_REPLY_TYPE_NONE) {
         if (!(chunk->flags & NBD_REPLY_FLAG_DONE)) {
             error_setg(errp, "Protocol error: NBD_REPLY_TYPE_NONE chunk without"
-                             "NBD_REPLY_FLAG_DONE flag set");
+                       " NBD_REPLY_FLAG_DONE flag set");
             return -EINVAL;
         }
         return 0;
-- 
2.13.6


Re: [Qemu-devel] [PATCH v2 1/7] nbd-client: Fix error message typos
Posted by Vladimir Sementsov-Ogievskiy 8 years, 3 months ago
09.11.2017 00:56, Eric Blake wrote:
> Provide missing spaces that are required when using string
> concatenation to break error messages across source lines.
>
> Signed-off-by: Eric Blake <eblake@redhat.com>

Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>


> ---
>   block/nbd-client.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/block/nbd-client.c b/block/nbd-client.c
> index b44d4d4a01..de6c153328 100644
> --- a/block/nbd-client.c
> +++ b/block/nbd-client.c
> @@ -248,7 +248,7 @@ static int nbd_parse_error_payload(NBDStructuredReplyChunk *chunk,
>
>       error = nbd_errno_to_system_errno(payload_advance32(&payload));
>       if (error == 0) {
> -        error_setg(errp, "Protocol error: server sent structured error chunk"
> +        error_setg(errp, "Protocol error: server sent structured error chunk "
>                            "with error = 0");
>           return -EINVAL;
>       }
> @@ -257,7 +257,7 @@ static int nbd_parse_error_payload(NBDStructuredReplyChunk *chunk,
>       message_size = payload_advance16(&payload);
>
>       if (message_size > chunk->length - sizeof(error) - sizeof(message_size)) {
> -        error_setg(errp, "Protocol error: server sent structured error chunk"
> +        error_setg(errp, "Protocol error: server sent structured error chunk "
>                            "with incorrect message size");
>           return -EINVAL;
>       }
> @@ -408,7 +408,7 @@ static coroutine_fn int nbd_co_do_receive_one_chunk(
>       if (chunk->type == NBD_REPLY_TYPE_NONE) {
>           if (!(chunk->flags & NBD_REPLY_FLAG_DONE)) {
>               error_setg(errp, "Protocol error: NBD_REPLY_TYPE_NONE chunk without"
> -                             "NBD_REPLY_FLAG_DONE flag set");
> +                       " NBD_REPLY_FLAG_DONE flag set");

I think it's better not to change indentation here, as it is done so in 
other places.
You don't like this way of indenting splitted strings?

>               return -EINVAL;
>           }
>           return 0;


-- 
Best regards,
Vladimir


Re: [Qemu-devel] [PATCH v2 1/7] nbd-client: Fix error message typos
Posted by Eric Blake 8 years, 3 months ago
On 11/09/2017 02:58 AM, Vladimir Sementsov-Ogievskiy wrote:
> 09.11.2017 00:56, Eric Blake wrote:
>> Provide missing spaces that are required when using string
>> concatenation to break error messages across source lines.
>>
>> Signed-off-by: Eric Blake <eblake@redhat.com>
> 
> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> 

>> @@ -408,7 +408,7 @@ static coroutine_fn int nbd_co_do_receive_one_chunk(
>>       if (chunk->type == NBD_REPLY_TYPE_NONE) {
>>           if (!(chunk->flags & NBD_REPLY_FLAG_DONE)) {
>>               error_setg(errp, "Protocol error: NBD_REPLY_TYPE_NONE
>> chunk without"
>> -                             "NBD_REPLY_FLAG_DONE flag set");
>> +                       " NBD_REPLY_FLAG_DONE flag set");
> 
> I think it's better not to change indentation here, as it is done so in
> other places.
> You don't like this way of indenting splitted strings?

s/splitted/split/ (one of those weird irregular English verbs)

I just did what emacs recommended when I hit TAB.  Your indentation
style also works in isolation, even if it isn't the default that emacs
tries to give me.  I could avoid the churn on this patch, but then my
addition in 6/7 looks inconsistent compared to this one, so I'll
probably just leave the indentation change in place.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org