qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Benoît Canet" <benoit.canet@irqsave.net>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: Luiz Capitulino <lcapitulino@redhat.com>,
	qemu-devel@nongnu.org, Markus Armbruster <armbru@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] blockdev: fix drive-mirror 'granularity' error message
Date: Wed, 27 Aug 2014 16:12:40 +0200	[thread overview]
Message-ID: <20140827141239.GA31176@irqsave.net> (raw)
In-Reply-To: <1409146199-12855-1-git-send-email-stefanha@redhat.com>

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 <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
> 
> 
Reviewed-by: Benoît Canet <benoit.canet@nodalink.com>

  parent reply	other threads:[~2014-08-27 14:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2014-08-28 12:28 ` Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140827141239.GA31176@irqsave.net \
    --to=benoit.canet@irqsave.net \
    --cc=armbru@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).