diff options
author | Thanos Makatos <thanos.makatos@nutanix.com> | 2019-09-20 09:10:53 -0400 |
---|---|---|
committer | Thanos <tmakatos@gmail.com> | 2019-09-27 15:59:11 +0100 |
commit | 4bea39dd70e241eb64eda752ba231a4c13b6c262 (patch) | |
tree | 0fb6657851b58e6747696b7d56534e8928a589ea /lib | |
parent | d3689b70f3ef793a23adf0191455b2ef82e63bf8 (diff) | |
download | libvfio-user-4bea39dd70e241eb64eda752ba231a4c13b6c262.zip libvfio-user-4bea39dd70e241eb64eda752ba231a4c13b6c262.tar.gz libvfio-user-4bea39dd70e241eb64eda752ba231a4c13b6c262.tar.bz2 |
don't trigger INTx IRQ if it's disabled
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libmuser.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/libmuser.c b/lib/libmuser.c index 8299840..795fff6 100644 --- a/lib/libmuser.c +++ b/lib/libmuser.c @@ -1002,6 +1002,21 @@ lm_irq_trigger(lm_ctx_t * lm_ctx, uint32_t vector) return -1; } + if (vector == LM_DEV_INTX_IRQ_IDX && !lm_ctx->pci_config_space->hdr.cmd.id) { + lm_log(lm_ctx, LM_ERR, "failed to trigger INTx IRQ, INTx disabled\n"); + errno = EINVAL; + return -1; + } else if (vector == LM_DEV_MSIX_IRQ_IDX) { + /* + * FIXME must check that MSI-X capability exists during creation time + */ + /* + * FIXME need to check that MSI-X is enabled and that it's not masked. + * Currently that's not possible because libmuser doesn't care about + * the internals of a capability. + */ + } + return eventfd_write(lm_ctx->irqs.efds[vector], val); } |