From: Yuanhan Liu Date: Mon, 27 Jun 2016 05:22:00 +0000 (+0800) Subject: vhost: fix missing flag reset on stop X-Git-Tag: spdx-start~6312 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=4feff06e5055922e2c7df858a29f723bddf8ceaf;p=dpdk.git vhost: fix missing flag reset on stop Commit 550c9d27d143 ("vhost: set/reset device flags internally") moves the VIRTIO_DEV_RUNNING set/reset to vhost lib. But I missed one reset on stop; here fixes it. Fixes: 550c9d27d143 ("vhost: set/reset device flags internally") Reported-by: Ciara Loftus Signed-off-by: Yuanhan Liu Tested-by: Ciara Loftus --- diff --git a/lib/librte_vhost/vhost_user/virtio-net-user.c b/lib/librte_vhost/vhost_user/virtio-net-user.c index a6a48dc09f..e7c43479c3 100644 --- a/lib/librte_vhost/vhost_user/virtio-net-user.c +++ b/lib/librte_vhost/vhost_user/virtio-net-user.c @@ -317,8 +317,10 @@ user_get_vring_base(int vid, struct vhost_vring_state *state) if (dev == NULL) return -1; /* We have to stop the queue (virtio) if it is running. */ - if (dev->flags & VIRTIO_DEV_RUNNING) + if (dev->flags & VIRTIO_DEV_RUNNING) { + dev->flags &= ~VIRTIO_DEV_RUNNING; notify_ops->destroy_device(vid); + } /* Here we are safe to get the last used index */ vhost_get_vring_base(vid, state->index, state);