[libvirt] [PATCH v2] rpc: remove trailing whitespace character in error string

Eric Blake eblake at redhat.com
Wed Jul 18 16:16:20 UTC 2012


On 07/18/2012 09:23 AM, Guannan Ren wrote:
> Instead of only removing the ending newline character, it is
> better to remove all of standard whitespace character for the
> sake of log format.
> 
> One example that we have to do this is:
> After three times incorrect password input, virsh command
> virsh -c qemu://remoteserver/system will report error like:
> 
> : Connection reset by peerey,gssapi-keyex,gssapi-with-mic,password).
> 
> But it should be:
> Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
> : Connection reset by peer
> 
> The reason is that we dropped the newline, but have a '\r' left.
> The terminal interprets it as "move the cursor back to the start
> of the current line", so the error string is messed up.

ACK.

-- 
Eric Blake   eblake at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120718/0474a6e5/attachment-0001.sig>


More information about the libvir-list mailing list