All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
To: Eric Blake <eblake@redhat.com>, qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	qemu-stable@nongnu.org, qemu-block@nongnu.org,
	Markus Armbruster <armbru@redhat.com>
Subject: Re: [Qemu-devel] [PATCH for-2.11] nbd/client: Use error_prepend() correctly
Date: Mon, 13 Nov 2017 19:23:31 +0300	[thread overview]
Message-ID: <0e997434-531f-7a3a-b362-006f163e4cc0@virtuozzo.com> (raw)
In-Reply-To: <be69fe36-58f2-1164-5bcd-823df74ae769@redhat.com>

13.11.2017 18:32, Eric Blake wrote:
> [adding Markus as error maintainer]
>
> On 11/13/2017 09:24 AM, Eric Blake wrote:
>> When using error prepend(), it is necessary to end with a space
>> in the format string; otherwise, messages come out incorrectly,
>> such as when connecting to a socket that hangs up immediately:
>>
>> can't open device nbd://localhost:10809/: Failed to read dataUnexpected end-of-file before all bytes were read
>>
>> Originally botched in commit e44ed99d, then several more instances
>> added in the meantime.
>>
>> CC: qemu-stable@nongnu.org
>> Signed-off-by: Eric Blake <eblake@redhat.com>
>> ---
>>   nbd/client.c | 50 ++++++++++++++++++++++++++------------------------
>>   1 file changed, 26 insertions(+), 24 deletions(-)
>>
>> diff --git a/nbd/client.c b/nbd/client.c
>> index 1880103d2a..4e15fc484d 100644
>> --- a/nbd/client.c
>> +++ b/nbd/client.c
>> @@ -79,12 +79,12 @@ static int nbd_send_option_request(QIOChannel *ioc, uint32_t opt,
>>       stl_be_p(&req.length, len);
>>
>>       if (nbd_write(ioc, &req, sizeof(req), errp) < 0) {
>> -        error_prepend(errp, "Failed to send option request header");
>> +        error_prepend(errp, "Failed to send option request header: ");
> A quick grep of the tree noticed that most (all?) error_prepend()
> callers use trailing ": " in their format string.  Should we refactor
> that to be done automatically by error_prepend() itself, rather than at
> every callsite?
>

Sounds good.

-- 
Best regards,
Vladimir

  reply	other threads:[~2017-11-13 16:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-13 15:24 [Qemu-devel] [PATCH for-2.11] nbd/client: Use error_prepend() correctly Eric Blake
2017-11-13 15:32 ` Eric Blake
2017-11-13 16:23   ` Vladimir Sementsov-Ogievskiy [this message]
2017-11-13 17:10   ` Markus Armbruster
2017-11-13 16:27 ` Vladimir Sementsov-Ogievskiy
2017-11-13 17:14 ` Markus Armbruster
2017-11-13 18:19   ` Eric Blake
2017-11-14  7:28     ` Markus Armbruster
2017-11-13 18:21 ` Eric Blake

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0e997434-531f-7a3a-b362-006f163e4cc0@virtuozzo.com \
    --to=vsementsov@virtuozzo.com \
    --cc=armbru@redhat.com \
    --cc=eblake@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.