summaryrefslogtreecommitdiffstats
path: root/hw/s390x
diff options
context:
space:
mode:
authorWei Huang2016-12-15 19:23:24 +0100
committerMichael S. Tsirkin2016-12-16 00:14:54 +0100
commit2858bc68701e282c404ed04d65d4f065e4b40e52 (patch)
treec7d967dcd199fbba02732bbec5a396815afda206 /hw/s390x
parentpci: fix error message for express slots (diff)
downloadqemu-2858bc68701e282c404ed04d65d4f065e4b40e52.tar.gz
qemu-2858bc68701e282c404ed04d65d4f065e4b40e52.tar.xz
qemu-2858bc68701e282c404ed04d65d4f065e4b40e52.zip
virtio: avoid using guest_notifier_mask in vhost-user mode
Because guest mask notifier cannot be used in vhost-user mode, a boolean flag "use_guest_notifier_mask" was added in commit 5669655aafd to disable the use of guest mask notifier under virtio-pci. However this flag wasn't checked in other virtio devices, such as virtio-mmio. In our tests, it caused assertion error under "vhost-user + virtio-mmio". This patch addresses this problem by adding a check before guest_notifier_mask is called. Signed-off-by: Wei Huang <wei@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/s390x')
-rw-r--r--hw/s390x/virtio-ccw.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
index f5c1d98192..07650683f7 100644
--- a/hw/s390x/virtio-ccw.c
+++ b/hw/s390x/virtio-ccw.c
@@ -1098,7 +1098,7 @@ static int virtio_ccw_set_guest_notifier(VirtioCcwDevice *dev, int n,
* We do not support individual masking for channel devices, so we
* need to manually trigger any guest masking callbacks here.
*/
- if (k->guest_notifier_mask) {
+ if (k->guest_notifier_mask && vdev->use_guest_notifier_mask) {
k->guest_notifier_mask(vdev, n, false);
}
/* get lost events and re-inject */
@@ -1107,7 +1107,7 @@ static int virtio_ccw_set_guest_notifier(VirtioCcwDevice *dev, int n,
event_notifier_set(notifier);
}
} else {
- if (k->guest_notifier_mask) {
+ if (k->guest_notifier_mask && vdev->use_guest_notifier_mask) {
k->guest_notifier_mask(vdev, n, true);
}
if (with_irqfd) {