[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] blockdev: fix drive-mirror 'granularity' error
From: |
Benoît Canet |
Subject: |
Re: [Qemu-devel] [PATCH] blockdev: fix drive-mirror 'granularity' error message |
Date: |
Wed, 27 Aug 2014 16:12:40 +0200 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
The Wednesday 27 Aug 2014 à 14:29:59 (+0100), Stefan Hajnoczi wrote :
> 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 <address@hidden>
> Signed-off-by: Stefan Hajnoczi <address@hidden>
> ---
> 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
>
>
Reviewed-by: Benoît Canet <address@hidden>