aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2012-07-02 10:05:39 +0200
committerMarcelo Tosatti <mtosatti@redhat.com>2012-07-03 08:36:00 -0300
commit6f82a5ea52302bab33287b0191538be6f9138637 (patch)
tree811dcb0604ee267dd0ac19c17e987d72fe777211
parent398b87f4ef3426569bdda2da2c9c2b89f4ba906f (diff)
qemu-kvm: virtio: Do not register mask notifiers without in-kernel irqchip support
We crash if we registers mask notifiers without backing in-kernel irqchip. This corresponds to the check in QEMU upstream after 1.1 now. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
-rw-r--r--hw/virtio-pci.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c
index a0c2ca74b..5b643561e 100644
--- a/hw/virtio-pci.c
+++ b/hw/virtio-pci.c
@@ -629,7 +629,7 @@ static int virtio_pci_set_guest_notifiers(void *opaque, bool assign)
/* Must unset mask notifier while guest notifier
* is still assigned */
- if (!assign) {
+ if (kvm_irqchip_in_kernel() && !assign) {
r = msix_unset_mask_notifier(&proxy->pci_dev);
assert(r >= 0);
}
@@ -647,7 +647,7 @@ static int virtio_pci_set_guest_notifiers(void *opaque, bool assign)
/* Must set mask notifier after guest notifier
* has been assigned */
- if (assign) {
+ if (kvm_irqchip_in_kernel() && assign) {
r = msix_set_mask_notifier(&proxy->pci_dev,
virtio_pci_mask_notifier);
if (r < 0) {