aboutsummaryrefslogtreecommitdiff
path: root/hw/virtio/virtio-mmio.c
diff options
context:
space:
mode:
authorWei Huang <wei@redhat.com>2016-12-15 12:23:24 -0600
committerMichael S. Tsirkin <mst@redhat.com>2016-12-16 01:14:54 +0200
commit2858bc68701e282c404ed04d65d4f065e4b40e52 (patch)
treec7d967dcd199fbba02732bbec5a396815afda206 /hw/virtio/virtio-mmio.c
parentd93ddfb1f8fb72a7c175a8cf1028c639f769d105 (diff)
downloadqemu-2858bc68701e282c404ed04d65d4f065e4b40e52.zip
qemu-2858bc68701e282c404ed04d65d4f065e4b40e52.tar.gz
qemu-2858bc68701e282c404ed04d65d4f065e4b40e52.tar.bz2
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/virtio/virtio-mmio.c')
-rw-r--r--hw/virtio/virtio-mmio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/virtio/virtio-mmio.c b/hw/virtio/virtio-mmio.c
index 17412cb7..60654dc 100644
--- a/hw/virtio/virtio-mmio.c
+++ b/hw/virtio/virtio-mmio.c
@@ -402,7 +402,7 @@ static int virtio_mmio_set_guest_notifier(DeviceState *d, int n, bool assign,
event_notifier_cleanup(notifier);
}
- if (vdc->guest_notifier_mask) {
+ if (vdc->guest_notifier_mask && vdev->use_guest_notifier_mask) {
vdc->guest_notifier_mask(vdev, n, !assign);
}