]> www.infradead.org Git - users/dwmw2/qemu.git/commit
vhost: Always store new kick fd on vhost_svq_set_svq_kick_fd
authorEugenio Pérez <eperezma@redhat.com>
Tue, 23 Aug 2022 18:20:07 +0000 (20:20 +0200)
committerJason Wang <jasowang@redhat.com>
Fri, 2 Sep 2022 02:22:39 +0000 (10:22 +0800)
commit8b64e486423b09db4463799727bf1fad62fe496a
tree339363c435781f56900e9b41734d5bdb95c7b34c
parent5b590f51b923776a14d3bcafcb393279c1b72022
vhost: Always store new kick fd on vhost_svq_set_svq_kick_fd

We can unbind twice a file descriptor if we call twice
vhost_svq_set_svq_kick_fd because of this. Since it comes from vhost and
not from SVQ, that file descriptor could be a different thing that
guest's vhost notifier.

Likewise, it can happens the same if a guest start and stop the device
multiple times.

Reported-by: Lei Yang <leiyang@redhat.com>
Fixes: dff4426fa6 ("vhost: Add Shadow VirtQueue kick forwarding capabilities")
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
hw/virtio/vhost-shadow-virtqueue.c