qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] vhost_dev:qemu will quit when vhost_dev is null
@ 2017-06-01 14:51 indiffPig
  2017-06-01 15:25 ` Michael S. Tsirkin
  0 siblings, 1 reply; 2+ messages in thread
From: indiffPig @ 2017-06-01 14:51 UTC (permalink / raw)
  To: mst; +Cc: qemu-devel, yin.zuowei

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 .
---
 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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] vhost_dev:qemu will quit when vhost_dev is null
  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
  0 siblings, 0 replies; 2+ messages in thread
From: Michael S. Tsirkin @ 2017-06-01 15:25 UTC (permalink / raw)
  To: indiffPig; +Cc: qemu-devel, yin.zuowei

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
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-06-01 15:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).