[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 04/28] vhost-user: Send VHOST_RESET_OWNER on vhost st
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 04/28] vhost-user: Send VHOST_RESET_OWNER on vhost stop |
Date: |
Mon, 11 May 2015 14:47:08 +0200 |
From: Luke Gorrie <address@hidden>
Ensure that the vhost-user slave knows when the vrings are valid and
when they are invalid, for example during a guest reboot.
The vhost-user protocol says this of VHOST_RESET_OWNER:
Issued when a new connection is about to be closed. The Master
will no longer own this connection (and will usually close it).
Send this message to tell the vhost-user slave that the vhost session
has ended and that session state (e.g. vrings) is no longer valid.
Signed-off-by: Luke Gorrie <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
hw/net/vhost_net.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
index cf23335..47f8b89 100644
--- a/hw/net/vhost_net.c
+++ b/hw/net/vhost_net.c
@@ -263,6 +263,13 @@ static void vhost_net_stop_one(struct vhost_net *net,
&file);
assert(r >= 0);
}
+ } else if (net->nc->info->type == NET_CLIENT_OPTIONS_KIND_VHOST_USER) {
+ for (file.index = 0; file.index < net->dev.nvqs; ++file.index) {
+ const VhostOps *vhost_ops = net->dev.vhost_ops;
+ int r = vhost_ops->vhost_call(&net->dev, VHOST_RESET_OWNER,
+ NULL);
+ assert(r >= 0);
+ }
}
if (net->nc->info->poll) {
net->nc->info->poll(net->nc, true);
--
MST
- [Qemu-devel] [PULL 00/28] pc, virtio enhancements, Michael S. Tsirkin, 2015/05/11
- [Qemu-devel] [PULL 01/28] acpi-build: close } in comment, Michael S. Tsirkin, 2015/05/11
- [Qemu-devel] [PULL 04/28] vhost-user: Send VHOST_RESET_OWNER on vhost stop,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 03/28] hw/i386/acpi-build: move generic acpi building helpers into dedictated file, Michael S. Tsirkin, 2015/05/11
- [Qemu-devel] [PULL 02/28] hw/i386: Move ACPI header definitions in an arch-independent location, Michael S. Tsirkin, 2015/05/11
- [Qemu-devel] [PULL 05/28] virtio-net: fix the upper bound when trying to delete queues, Michael S. Tsirkin, 2015/05/11
- [Qemu-devel] [PULL 06/28] pc: add 2.4 machine types, Michael S. Tsirkin, 2015/05/11
- [Qemu-devel] [PULL 07/28] spapr: add machine type specific instance init function, Michael S. Tsirkin, 2015/05/11
- [Qemu-devel] [PULL 08/28] ppc: spapr: add 2.4 machine type, Michael S. Tsirkin, 2015/05/11
- [Qemu-devel] [PULL 09/28] monitor: replace the magic number 255 with MAX_QUEUE_NUM, Michael S. Tsirkin, 2015/05/11
- [Qemu-devel] [PULL 10/28] monitor: check return value of qemu_find_net_clients_except(), Michael S. Tsirkin, 2015/05/11
- [Qemu-devel] [PULL 11/28] virtio-ccw: using VIRTIO_NO_VECTOR instead of 0 for invalid virtqueue, Michael S. Tsirkin, 2015/05/11
- [Qemu-devel] [PULL 12/28] virtio: introduce vector to virtqueues mapping, Michael S. Tsirkin, 2015/05/11