qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [PATCH] nbd/client: Fix error messages during NBD_INFO_


From: Eric Blake
Subject: Re: [Qemu-block] [PATCH] nbd/client: Fix error messages during NBD_INFO_BLOCK_SIZE
Date: Tue, 1 May 2018 15:15:11 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0

On 05/01/2018 10:55 AM, Vladimir Sementsov-Ogievskiy wrote:
01.05.2018 18:46, Eric Blake wrote:
A missing space makes for poor error messages.  Also, we missed
diagnosing a server that sends a maximum block size less than
the minimum.

Fixes: 081dd1fe
CC: address@hidden
Signed-off-by: Eric Blake <address@hidden>

Reviewed-by: Vladimir Sementsov-Ogievskiy <address@hidden>

---
  nbd/client.c | 10 ++++++++--
  1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/nbd/client.c b/nbd/client.c
index 7f35b5c3232..7b3caa90ec2 100644
--- a/nbd/client.c
+++ b/nbd/client.c
@@ -436,7 +436,7 @@ static int nbd_opt_go(QIOChannel *ioc, const char *wantname,
              be32_to_cpus(&info->min_block);
              if (!is_power_of_2(info->min_block)) {
                  error_setg(errp, "server minimum block size %" PRId32
-                           "is not a power of two", info->min_block);
+                           " is not a power of two", info->min_block);

One more tweak: PRIu32 is better than PRId32, as block sizes cannot go negative. I'm squashing that in, then staging this on my NBD queue.

--
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]