mirror of https://github.com/xemu-project/xemu.git
hw/nvme: fix use/unuse of msix vectors
Only call msix_{un,}use_vector() when interrupts are actually enabled for a completion queue. Reviewed-by: Jesper Wendel Devantier <foss@defmacro.it> Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
This commit is contained in:
parent
9162f10125
commit
149f6e90b5
|
@ -5423,7 +5423,7 @@ static void nvme_free_cq(NvmeCQueue *cq, NvmeCtrl *n)
|
|||
event_notifier_set_handler(&cq->notifier, NULL);
|
||||
event_notifier_cleanup(&cq->notifier);
|
||||
}
|
||||
if (msix_enabled(pci)) {
|
||||
if (msix_enabled(pci) && cq->irq_enabled) {
|
||||
msix_vector_unuse(pci, cq->vector);
|
||||
}
|
||||
if (cq->cqid) {
|
||||
|
@ -5464,9 +5464,10 @@ static void nvme_init_cq(NvmeCQueue *cq, NvmeCtrl *n, uint64_t dma_addr,
|
|||
{
|
||||
PCIDevice *pci = PCI_DEVICE(n);
|
||||
|
||||
if (msix_enabled(pci)) {
|
||||
if (msix_enabled(pci) && irq_enabled) {
|
||||
msix_vector_use(pci, vector);
|
||||
}
|
||||
|
||||
cq->ctrl = n;
|
||||
cq->cqid = cqid;
|
||||
cq->size = size;
|
||||
|
|
Loading…
Reference in New Issue