All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: indiffPig@126.com
Cc: qemu-devel@nongnu.org, "yin.zuowei" <cxasm@qq.com>
Subject: Re: [Qemu-devel] [PATCH] vhost_dev:qemu will quit when vhost_dev is null
Date: Thu, 1 Jun 2017 18:25:30 +0300	[thread overview]
Message-ID: <20170601182513-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <1496328687-13121-1-git-send-email-indiffPig@126.com>

On Thu, Jun 01, 2017 at 10:51:27AM -0400, indiffPig@126.com wrote:
> From: "yin.zuowei" <cxasm@qq.com>
> 
> Signed-off-by: yin.zuowei <cxasm@qq.com>
> 
> when ovdk socket is not ok, this vhost_dev is null ,then qemu will be quit.
> We think ovdk is just a network devices, should not cause an exit .


It is called like this:
    if (vhost_ops && vhost_ops->vhost_set_vring_enable) {
        return vhost_ops->vhost_set_vring_enable(&net->dev, enable);
    }

so how can it be NULL?


> ---
>  hw/virtio/vhost-user.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c
> index dde094a..3a9fdf4 100644
> --- a/hw/virtio/vhost-user.c
> +++ b/hw/virtio/vhost-user.c
> @@ -387,6 +387,9 @@ static int vhost_user_set_vring_base(struct vhost_dev *dev,
>  static int vhost_user_set_vring_enable(struct vhost_dev *dev, int enable)
>  {
>      int i;
> +    if (!dev) {
> +        return -1;
> +    }
>  
>      if (!virtio_has_feature(dev->features, VHOST_USER_F_PROTOCOL_FEATURES)) {
>          return -1;
> -- 
> 1.8.3.1
> 

      reply	other threads:[~2017-06-01 15:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-01 14:51 [Qemu-devel] [PATCH] vhost_dev:qemu will quit when vhost_dev is null indiffPig
2017-06-01 15:25 ` Michael S. Tsirkin [this message]

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=20170601182513-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=cxasm@qq.com \
    --cc=indiffPig@126.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.