浏览代码

KVM: ignore msi request if !level

Irqfd sets level for interrupt to 1 and then to 0.
For MSI, check level so that a single message is sent.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Michael S. Tsirkin 16 年之前
父节点
当前提交
07fb8bb29f
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      virt/kvm/irq_comm.c

+ 3 - 1
virt/kvm/irq_comm.c

@@ -139,7 +139,9 @@ int kvm_set_irq(struct kvm *kvm, int irq_source_id, int irq, int level)
 		else
 		else
 			clear_bit(irq_source_id, irq_state);
 			clear_bit(irq_source_id, irq_state);
 		sig_level = !!(*irq_state);
 		sig_level = !!(*irq_state);
-	} else /* Deal with MSI/MSI-X */
+	} else if (!level)
+		return ret;
+	else /* Deal with MSI/MSI-X */
 		sig_level = 1;
 		sig_level = 1;
 
 
 	/* Not possible to detect if the guest uses the PIC or the
 	/* Not possible to detect if the guest uses the PIC or the