qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH RFC] qemu-io: Prefer stderr for error messages


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH RFC] qemu-io: Prefer stderr for error messages
Date: Thu, 13 Dec 2018 08:04:53 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1

On 12/13/18 6:21 AM, Wainer dos Santos Moschetta wrote:

On 12/12/2018 08:04 PM, Eric Blake wrote:
When a qemu-io command fails, it's best if the failure message
goes to stderr rather than stdout.

Reported-by: Richard W.M. Jones <address@hidden>
Signed-off-by: Eric Blake <address@hidden>
---

RFC because at least iotest 60 (found by -qcow2 -g quick) breaks due
to reordering of output lines, and I'd rather know if we like this
idea before bothering to revisit all affected iotests (including
discovering if other slower ones have similar problems).

          if (!QEMU_IS_ALIGNED(count, BDRV_SECTOR_SIZE)) {
-            printf("%"PRId64" is not a sector-aligned value for 'count'\n",
-                   count);
+            fprintf(stderr,
+                    "%"PRId64" is not a sector-aligned value for 'count'\n",

Adding one space before and after PRId64 as in '"%" PRId64 " is not (...)"' increases readability IMHO.

Pre-existing, but I don't mind fixing it while touching in the area.

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]