diff options
Diffstat (limited to 'src/vnet/devices/virtio/vhost_user.c')
-rw-r--r-- | src/vnet/devices/virtio/vhost_user.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/vnet/devices/virtio/vhost_user.c b/src/vnet/devices/virtio/vhost_user.c index a8a7ae89065..796be4b80a2 100644 --- a/src/vnet/devices/virtio/vhost_user.c +++ b/src/vnet/devices/virtio/vhost_user.c @@ -73,7 +73,9 @@ get_huge_page_size (int fd) static void unmap_all_mem_regions (vhost_user_intf_t * vui) { - int i, r; + int i, r, q; + vhost_user_vring_t *vq; + for (i = 0; i < vui->nregions; i++) { if (vui->region_mmap_addr[i] != MAP_FAILED) @@ -104,6 +106,14 @@ unmap_all_mem_regions (vhost_user_intf_t * vui) } } vui->nregions = 0; + + for (q = 0; q < VHOST_VRING_MAX_N; q++) + { + vq = &vui->vrings[q]; + vq->avail = 0; + vq->used = 0; + vq->desc = 0; + } } static void |