All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kurz <groug@kaod.org>
To: Markus Armbruster <armbru@redhat.com>
Cc: pbonzini@redhat.com, berrange@redhat.com, qemu-devel@nongnu.org,
	ehabkost@redhat.com
Subject: Re: [PATCH 2/2] qom: Correct error values in two contracts
Date: Thu, 17 Sep 2020 15:31:21 +0200	[thread overview]
Message-ID: <20200917153121.66a4f2f9@bahia.lan> (raw)
In-Reply-To: <20200917125540.597786-3-armbru@redhat.com>

On Thu, 17 Sep 2020 14:55:40 +0200
Markus Armbruster <armbru@redhat.com> wrote:

> object_property_get_bool()'s contract claims it returns NULL on error.
> Pasto; it returns false.
> 
> object_property_get_int()'s contract claims it returns "negative".  It
> actually returns -1.  All the other object_property_get_FOO()
> contracts specify the exact error value, so do the same here.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---

Reviewed-by: Greg Kurz <groug@kaod.org>

>  include/qom/object.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/qom/object.h b/include/qom/object.h
> index f75547a3fe..d0a3332c1f 100644
> --- a/include/qom/object.h
> +++ b/include/qom/object.h
> @@ -1624,7 +1624,7 @@ bool object_property_set_bool(Object *obj, const char *name,
>   * @name: the name of the property
>   * @errp: returns an error if this function fails
>   *
> - * Returns: the value of the property, converted to a boolean, or NULL if
> + * Returns: the value of the property, converted to a boolean, or false if
>   * an error occurs (including when the property value is not a bool).
>   */
>  bool object_property_get_bool(Object *obj, const char *name,
> @@ -1649,7 +1649,7 @@ bool object_property_set_int(Object *obj, const char *name,
>   * @name: the name of the property
>   * @errp: returns an error if this function fails
>   *
> - * Returns: the value of the property, converted to an integer, or negative if
> + * Returns: the value of the property, converted to an integer, or -1 if
>   * an error occurs (including when the property value is not an integer).
>   */
>  int64_t object_property_get_int(Object *obj, const char *name,



  parent reply	other threads:[~2020-09-17 13:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-17 12:55 [PATCH 0/2] qpm: Minor error value corrections Markus Armbruster
2020-09-17 12:55 ` [PATCH 1/2] qom: Clean up object_property_get_enum()'s error value Markus Armbruster
2020-09-17 12:59   ` Daniel P. Berrangé
2020-09-17 13:25   ` Greg Kurz
2020-09-17 12:55 ` [PATCH 2/2] qom: Correct error values in two contracts Markus Armbruster
2020-09-17 12:59   ` Daniel P. Berrangé
2020-09-17 13:31   ` Greg Kurz [this message]
2020-09-17 13:03 ` [PATCH 0/2] qpm: Minor error value corrections no-reply
2020-09-17 13:06 ` no-reply
2020-09-17 17:28 ` Eduardo Habkost

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=20200917153121.66a4f2f9@bahia.lan \
    --to=groug@kaod.org \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=pbonzini@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.