summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@redhat.com>2014-08-27 14:29:59 +0100
committerStefan Hajnoczi <stefanha@redhat.com>2014-08-29 10:46:58 +0100
commit3cbbe9fd1feaf3264f745fccb0bf5f62c583078f (patch)
tree690de08384c1ed7eefa008c6bfb31038847896f6
parent0b9caf9b3166c8deb3c4f3a774c2384b069dc29c (diff)
downloadqemu-3cbbe9fd1feaf3264f745fccb0bf5f62c583078f.tar.gz
qemu-3cbbe9fd1feaf3264f745fccb0bf5f62c583078f.tar.bz2
qemu-3cbbe9fd1feaf3264f745fccb0bf5f62c583078f.zip
blockdev: fix drive-mirror 'granularity' error message
Name the 'granularity' parameter and give its expected value range. Previously the device name was mistakenly 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> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: BenoƮt Canet <benoit.canet@nodalink.com>
-rw-r--r--blockdev.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/blockdev.c b/blockdev.c
index 6a204c662d..eeb414efc0 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;
}