qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] blockdev: fix drive-mirror 'granularity' error message
@ 2014-08-27 13:29 Stefan Hajnoczi
  2014-08-27 13:33 ` Eric Blake
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Stefan Hajnoczi @ 2014-08-27 13:29 UTC (permalink / raw)
  To: qemu-devel; +Cc: Markus Armbruster, Stefan Hajnoczi, Luiz Capitulino

Name the 'granularity' parameter and give its expected value range.
Previously the device name was mistakingly reported as the parameter
name.

Note that the error class is unchanged from ERROR_CLASS_GENERIC_ERROR.

Reported-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 blockdev.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/blockdev.c b/blockdev.c
index 6a204c6..eeb414e 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -2179,11 +2179,12 @@ void qmp_drive_mirror(const char *device, const char *target,
     }
 
     if (granularity != 0 && (granularity < 512 || granularity > 1048576 * 64)) {
-        error_set(errp, QERR_INVALID_PARAMETER, device);
+        error_set(errp, QERR_INVALID_PARAMETER_VALUE, "granularity",
+                  "a value in range [512B, 64MB]");
         return;
     }
     if (granularity & (granularity - 1)) {
-        error_set(errp, QERR_INVALID_PARAMETER, device);
+        error_set(errp, QERR_INVALID_PARAMETER_VALUE, "granularity", "power of 2");
         return;
     }
 
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-08-28 12:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-27 13:29 [Qemu-devel] [PATCH] blockdev: fix drive-mirror 'granularity' error message Stefan Hajnoczi
2014-08-27 13:33 ` Eric Blake
2014-08-28 12:29   ` Stefan Hajnoczi
2014-08-28 12:31   ` Stefan Hajnoczi
2014-08-28 12:39     ` Eric Blake
2014-08-27 14:12 ` Benoît Canet
2014-08-28 12:28 ` Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).