All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Stefan Weil <sw@weilnetz.de>
Cc: qemu-trivial@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-trivial] [PATCH] virtio: Fix return value for dummy function vhost_net_virtqueue_pending
Date: Wed, 25 Dec 2013 17:18:34 +0200	[thread overview]
Message-ID: <20131225151834.GA20075@redhat.com> (raw)
In-Reply-To: <1387723882-30633-1-git-send-email-sw@weilnetz.de>

On Sun, Dec 22, 2013 at 03:51:22PM +0100, Stefan Weil wrote:
> cgcc complains that -ENOSYS is not a good value for 'bool'.
> 
> A dummy virtio will never have pending queue entries, so let us return
> false.
> 
> Signed-off-by: Stefan Weil <sw@weilnetz.de>

Applied, thanks.

> ---
> 
> Could we also use g_assert_not_reached or hw_error in those dummy functions?
> 
> Regards
> Stefan

I'd go for g_assert_not_reached normally - it's an internal
bug if this is called since init stub fails.
Or leave it as is - it's an unusual configuration.

>  hw/net/vhost_net.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
> index 006576d..854997d 100644
> --- a/hw/net/vhost_net.c
> +++ b/hw/net/vhost_net.c
> @@ -321,7 +321,7 @@ void vhost_net_ack_features(struct vhost_net *net, unsigned features)
>  
>  bool vhost_net_virtqueue_pending(VHostNetState *net, int idx)
>  {
> -    return -ENOSYS;
> +    return false;
>  }
>  
>  void vhost_net_virtqueue_mask(VHostNetState *net, VirtIODevice *dev,
> -- 
> 1.7.10.4


WARNING: multiple messages have this Message-ID (diff)
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Stefan Weil <sw@weilnetz.de>
Cc: qemu-trivial@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] virtio: Fix return value for dummy function vhost_net_virtqueue_pending
Date: Wed, 25 Dec 2013 17:18:34 +0200	[thread overview]
Message-ID: <20131225151834.GA20075@redhat.com> (raw)
In-Reply-To: <1387723882-30633-1-git-send-email-sw@weilnetz.de>

On Sun, Dec 22, 2013 at 03:51:22PM +0100, Stefan Weil wrote:
> cgcc complains that -ENOSYS is not a good value for 'bool'.
> 
> A dummy virtio will never have pending queue entries, so let us return
> false.
> 
> Signed-off-by: Stefan Weil <sw@weilnetz.de>

Applied, thanks.

> ---
> 
> Could we also use g_assert_not_reached or hw_error in those dummy functions?
> 
> Regards
> Stefan

I'd go for g_assert_not_reached normally - it's an internal
bug if this is called since init stub fails.
Or leave it as is - it's an unusual configuration.

>  hw/net/vhost_net.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
> index 006576d..854997d 100644
> --- a/hw/net/vhost_net.c
> +++ b/hw/net/vhost_net.c
> @@ -321,7 +321,7 @@ void vhost_net_ack_features(struct vhost_net *net, unsigned features)
>  
>  bool vhost_net_virtqueue_pending(VHostNetState *net, int idx)
>  {
> -    return -ENOSYS;
> +    return false;
>  }
>  
>  void vhost_net_virtqueue_mask(VHostNetState *net, VirtIODevice *dev,
> -- 
> 1.7.10.4

  reply	other threads:[~2013-12-25 15:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-22 14:51 [Qemu-trivial] [PATCH] virtio: Fix return value for dummy function vhost_net_virtqueue_pending Stefan Weil
2013-12-22 14:51 ` [Qemu-devel] " Stefan Weil
2013-12-25 15:18 ` Michael S. Tsirkin [this message]
2013-12-25 15:18   ` Michael S. Tsirkin

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=20131225151834.GA20075@redhat.com \
    --to=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=sw@weilnetz.de \
    /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.