qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Markus Armbruster <armbru@redhat.com>, qemu-devel@nongnu.org
Cc: marcandre.lureau@redhat.com
Subject: Re: [PATCH 4/5] dump: Improve some dump-guest-memory error messages
Date: Mon, 30 Oct 2023 15:05:57 +0100	[thread overview]
Message-ID: <473f2bd5-ebd4-00be-b8dd-c046505da9d8@linaro.org> (raw)
In-Reply-To: <20231030133712.2822276-5-armbru@redhat.com>

Hi Markus,

On 30/10/23 14:37, Markus Armbruster wrote:
> Zero @length is rejected with "Invalid parameter 'length'".  Improve
> to "Parameter 'length' expects a non-zero length".
> 
> @protocol values not starting with "fd:" or "file:" are rejected with
> "Invalid parameter 'protocol'".  Improve to "parameter 'protocol' must
> start with 'file:' or 'fd:'".
> 
> While there, make the conditional checking @protocol a little more
> obvious.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>   dump/dump.c | 16 +++++++---------
>   1 file changed, 7 insertions(+), 9 deletions(-)
> 
> diff --git a/dump/dump.c b/dump/dump.c
> index a5e9a06ef1..d888e4bd3c 100644
> --- a/dump/dump.c
> +++ b/dump/dump.c
> @@ -1812,7 +1812,8 @@ static void dump_init(DumpState *s, int fd, bool has_format,
>   
>       s->fd = fd;
>       if (has_filter && !length) {
> -        error_setg(errp, QERR_INVALID_PARAMETER, "length");
> +        error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "length",

Per commit 4629ed1e98 ("qerror: Finally unused, clean up", 2015):

  /*
   * These macros will go away, please don't use in new code, ...

Instead we can use:

            error_setg(errp, "Parameter '%s' expects %s", "length",

> +                   "a non-zero size");
>           goto cleanup;
>       }



  reply	other threads:[~2023-10-30 14:06 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-30 13:37 [PATCH 0/5] dump: Minor fixes & improvements Markus Armbruster
2023-10-30 13:37 ` [PATCH 1/5] dump: Rename qmp_dump_guest_memory() parameter to match QAPI schema Markus Armbruster
2023-10-31  6:54   ` Marc-André Lureau
2023-10-30 13:37 ` [PATCH 2/5] dump: Fix g_array_unref(NULL) in dump-guest-memory Markus Armbruster
2023-10-31  6:53   ` Marc-André Lureau
2023-10-31  9:02     ` Markus Armbruster
2023-10-31  9:06       ` Markus Armbruster
2023-10-31 10:09         ` Marc-André Lureau
2023-10-30 13:37 ` [PATCH 3/5] dump: Recognize "fd:" protocols on Windows hosts Markus Armbruster
2023-10-31  6:55   ` Marc-André Lureau
2023-10-30 13:37 ` [PATCH 4/5] dump: Improve some dump-guest-memory error messages Markus Armbruster
2023-10-30 14:05   ` Philippe Mathieu-Daudé [this message]
2023-10-31  5:44     ` Markus Armbruster
2023-10-30 13:37 ` [PATCH 5/5] dump: Drop redundant check for empty dump Markus Armbruster
2023-10-31 10:23   ` Marc-André Lureau

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=473f2bd5-ebd4-00be-b8dd-c046505da9d8@linaro.org \
    --to=philmd@linaro.org \
    --cc=armbru@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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).