From 66fde245b39b71dfc2e46803bcaf640f8175bcb5 Mon Sep 17 00:00:00 2001 From: Wu Zongyong Date: Wed, 20 Nov 2019 15:42:45 +0800 Subject: [PATCH] vfio: use correct flags to disable interrupts The comments of vfio kernel module said that individual subindex interrupts can be disabled using the -1 value for DATA_EVENTFD or the index can be disabled as a whole with: flags = (DATA_NONE|ACTION_TRIGGER), count = 0. Signed-off-by: Wu Zongyong CC: Liu Jiang --- vfio/src/vfio_device.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vfio/src/vfio_device.rs b/vfio/src/vfio_device.rs index 93144eb9b..d07f825a6 100644 --- a/vfio/src/vfio_device.rs +++ b/vfio/src/vfio_device.rs @@ -692,10 +692,10 @@ impl VfioDevice { let mut irq_set = vec_with_array_field::(0); irq_set[0].argsz = mem::size_of::() as u32; - irq_set[0].flags = VFIO_IRQ_SET_ACTION_MASK; + irq_set[0].flags = VFIO_IRQ_SET_ACTION_TRIGGER | VFIO_IRQ_SET_DATA_NONE; irq_set[0].index = irq_index; irq_set[0].start = 0; - irq_set[0].count = irq.count; + irq_set[0].count = 0; // Safe as we are the owner of self and irq_set which are valid value let ret = unsafe { ioctl_with_ref(self, VFIO_DEVICE_SET_IRQS(), &irq_set[0]) };