[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH XTF] vsnprintf: Expand \n to \r\n for console output


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: "Wieczorkiewicz, Pawel" <wipawel@xxxxxxxxx>
  • Date: Fri, 5 Jun 2020 06:59:59 +0000
  • Accept-language: en-US
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "Wieczorkiewicz, Pawel" <wipawel@xxxxxxxxx>
  • Delivery-date: Fri, 05 Jun 2020 07:00:17 +0000
  • Ironport-sdr: ipqgH8aG2Bmg7QxbccHkHuji0fFBDO+clA4xl7BWbYthmbkJvQZ0N24T1SUqadKbooF1yxTkzR y76GXyYxlYbQ==
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHWOnqJjCAwY1e/p06UxvrJMnpmrqjJmOQA
  • Thread-topic: [PATCH XTF] vsnprintf: Expand \n to \r\n for console output

> On 4. Jun 2020, at 16:12, Andrew Cooper <andrew.cooper3@xxxxxxxxxx> wrote:
> 
> CAUTION: This email originated from outside of the organization. Do not click 
> links or open attachments unless you can confirm the sender and know the 
> content is safe.
> 
> 
> 
> xenconsoled doesn't automatically convert \n into \r\n, which causes test
> output appear like this in a terminal:
> 
>  [root@host ~]# xl create -c tests/selftest/test-pv64-selftest.cfg
>  Parsing config from tests/selftest/test-pv64-selftest.cfg
>  --- Xen Test Framework ---
>                            Environment: PV 64bit (Long mode 4 levels)
>                                                                      XTF 
> Selftests
> 
> There are a number of ways to do this, but by far the most efficient way is to
> have vsnprintf() expand \n's in the output buffer.
> 
> This however is non-standard behaviour for vsnprintf().  Rename it to
> vsnprintf_internal() and take extra flags, and have vprintk() use the new
> LF_TO_CRLF control flag.
> 
> Inside vsnprintf_internal(), rearrange the non-format and %c logic to share
> the expansion logic, as well as extending the logic to fmt_string().
> 
> Extend the selftests to confirm correct behaviour in both modes, for all ways
> of being able to pass newline characters into a format operation.
> 
> Reported-by: Pawel Wieczorkiewicz <wipawel@xxxxxxxxx>
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> ---
> Pawel: Does this fix the issues you were seeing?

Yes, it does fix the issue. Thanks.

> ---
> common/console.c        |  2 +-
> common/libc/vsnprintf.c | 23 +++++++++++++++--------
> include/xtf/libc.h      | 15 ++++++++++++++-
> tests/selftest/main.c   | 38 ++++++++++++++++++++++++++++++++++++++
> 4 files changed, 68 insertions(+), 10 deletions(-)
> 
> 

<snip>

Best Regards,
Pawel Wieczorkiewicz
wipawel@xxxxxxxxxx


Attachment: signature.asc
Description: Message signed with OpenPGP




Amazon Development Center Germany GmbH
Krausenstr. 38
10117 Berlin
Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss
Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B
Sitz: Berlin
Ust-ID: DE 289 237 879



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.