diff options
author | Thanos Makatos <thanos.makatos@nutanix.com> | 2019-09-04 08:17:58 -0400 |
---|---|---|
committer | Felipe Franciosi <felipe@nutanix.com> | 2019-09-05 16:45:35 +0100 |
commit | 97318bf57b28859ef70181754d904488ede83aec (patch) | |
tree | 595facb0a2c9ac50caf6d1a68ae26ec1de18d6cf /lib | |
parent | 44e7e04c0c7c1e717a8894ee8ac38234759fc473 (diff) | |
download | libvfio-user-97318bf57b28859ef70181754d904488ede83aec.zip libvfio-user-97318bf57b28859ef70181754d904488ede83aec.tar.gz libvfio-user-97318bf57b28859ef70181754d904488ede83aec.tar.bz2 |
set IPIN if interrupts are used in dev_info
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libmuser.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/libmuser.c b/lib/libmuser.c index 1462e4e..3f92ee2 100644 --- a/lib/libmuser.c +++ b/lib/libmuser.c @@ -990,7 +990,8 @@ lm_ctx_destroy(lm_ctx_t * lm_ctx) static void init_pci_hdr(lm_pci_hdr_t * const hdr, const lm_pci_hdr_id_t * const id, - const lm_pci_hdr_cc_t * const cc, const lm_pci_hdr_ss_t *ss) + const lm_pci_hdr_cc_t * const cc, const lm_pci_hdr_ss_t *ss, + bool ipin) { assert(hdr); assert(id); @@ -1000,6 +1001,7 @@ init_pci_hdr(lm_pci_hdr_t * const hdr, const lm_pci_hdr_id_t * const id, hdr->id = *id; hdr->cc = *cc; hdr->ss = *ss; + hdr->intr.ipin = ipin; } static int copy_sparse_mmap_areas(lm_reg_info_t *dst, lm_reg_info_t *src) @@ -1118,7 +1120,8 @@ lm_ctx_create(lm_dev_info_t * const dev_info) } init_pci_hdr(&lm_ctx->pci_config_space->hdr, &dev_info->pci_info.id, - &dev_info->pci_info.cc, &dev_info->pci_info.ss) + &dev_info->pci_info.cc, &dev_info->pci_info.ss, + dev_info->pci_info.irq_count[LM_DEV_INTX_IRQ_IDX]); for (i = 0; i < ARRAY_SIZE(lm_ctx->pci_config_space->hdr.bars); i++) { if ((dev_info->pci_info.reg_info[i].flags & LM_REG_FLAG_MEM) == 0) { lm_ctx->pci_config_space->hdr.bars[i].io.region_type |= 0x1; |