aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Levon <john.levon@nutanix.com>2020-12-07 10:48:56 +0000
committerGitHub <noreply@github.com>2020-12-07 10:48:56 +0000
commite653a69a6a13094fcb9985c4b4e4068ae91d54ac (patch)
tree204d3c6bdb8d7a451ee6202393774228fc59bae5
parentf0fdfa8936dc908e024202aa9bfc203cd3d3c816 (diff)
downloadlibvfio-user-e653a69a6a13094fcb9985c4b4e4068ae91d54ac.zip
libvfio-user-e653a69a6a13094fcb9985c4b4e4068ae91d54ac.tar.gz
libvfio-user-e653a69a6a13094fcb9985c4b4e4068ae91d54ac.tar.bz2
setup an IRQ for the gpio sample server (#169)
Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
-rw-r--r--samples/gpio-pci-idio-16.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/samples/gpio-pci-idio-16.c b/samples/gpio-pci-idio-16.c
index 494fb1a..e786d43 100644
--- a/samples/gpio-pci-idio-16.c
+++ b/samples/gpio-pci-idio-16.c
@@ -128,6 +128,11 @@ main(int argc, char *argv[])
goto out;
}
+ ret = vfu_setup_device_nr_irqs(vfu_ctx, VFU_DEV_INTX_IRQ, 1);
+ if (ret < 0) {
+ err(EXIT_FAILURE, "failed to setup irq counts");
+ }
+
ret = vfu_ctx_drive(vfu_ctx);
if (ret != 0) {
if (ret != -ENOTCONN && ret != -EINTR) {