qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] vhost_dev:qemu will quit when vhost_dev is null


From: indiffPig
Subject: [Qemu-devel] [PATCH] vhost_dev:qemu will quit when vhost_dev is null
Date: Thu, 1 Jun 2017 10:51:27 -0400

From: "yin.zuowei" <address@hidden>

Signed-off-by: yin.zuowei <address@hidden>

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]