Skip to content

Commit 6ab4cde

Browse files
jan-kiszkamatosatti
authored andcommitted
pci-assign: Fix kvm_deassign_irq handling in assign_irq
Always clear AssignedDevice::irq_requested_type after calling kvm_deassign_irq. Moreover, drop the obviously incorrect exclusion when reporting related errors - if irq_requested_type is non-zero, deassign must not fail. Signed-off-by: Jan Kiszka <[email protected]> Signed-off-by: Marcelo Tosatti <[email protected]>
1 parent 2e5a900 commit 6ab4cde

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

hw/device-assignment.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -982,9 +982,10 @@ static int assign_irq(AssignedDevice *dev)
982982
if (dev->irq_requested_type) {
983983
assigned_irq_data.flags = dev->irq_requested_type;
984984
r = kvm_deassign_irq(kvm_state, &assigned_irq_data);
985-
/* -ENXIO means no assigned irq */
986-
if (r && r != -ENXIO)
985+
if (r) {
987986
perror("assign_irq: deassign");
987+
}
988+
dev->irq_requested_type = 0;
988989
}
989990

990991
assigned_irq_data.flags = KVM_DEV_IRQ_GUEST_INTX;

0 commit comments

Comments
 (0)