From: Rich Lane Date: Tue, 10 Nov 2015 02:15:13 +0000 (-0800) Subject: vhost: make destroy callback on reset owner message X-Git-Tag: spdx-start~8086 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=d243ecf0c2de7c0fe45f6efa30c26f1c79c8cb16;p=dpdk.git vhost: make destroy callback on reset owner message QEMU sends VHOST_RESET_OWNER first when shutting down. There was previously no way for the dataplane to know that the virtio_net instance had become unusable and it would segfault when trying to do RX/TX. Signed-off-by: Rich Lane Acked-by: Yuanhan Liu --- diff --git a/lib/librte_vhost/virtio-net.c b/lib/librte_vhost/virtio-net.c index 14278deef4..39a6a5e8de 100644 --- a/lib/librte_vhost/virtio-net.c +++ b/lib/librte_vhost/virtio-net.c @@ -436,6 +436,9 @@ reset_owner(struct vhost_device_ctx ctx) if (dev == NULL) return -1; + if (dev->flags & VIRTIO_DEV_RUNNING) + notify_ops->destroy_device(dev); + device_fh = dev->device_fh; cleanup_device(dev); init_device(dev);