at 7:18 PM, Jinhao Fan <fanjinhao...@ict.ac.cn> wrote: > @@ -4979,7 +5007,13 @@ static void nvme_init_cq(NvmeCQueue *cq, NvmeCtrl *n, > uint64_t dma_addr, > } > } > n->cq[cqid] = cq; > - cq->timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, nvme_post_cqes, cq); > + > + if (cq->cqid) { > + cq->timer = aio_timer_new(n->ctx, QEMU_CLOCK_VIRTUAL, SCALE_NS, > + nvme_post_cqes, cq); > + } else { > + cq->timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, nvme_post_cqes, cq); > + } > > /* > * Only enable irq eventfd for IO queues since we always emulate admin > @@ -4988,6 +5022,13 @@ static void nvme_init_cq(NvmeCQueue *cq, NvmeCtrl *n, > uint64_t dma_addr, > if (cqid && n->params.irq_eventfd) { > nvme_init_irq_notifier(n, cq); > } > + > + if (cq->cqid) { > + cq->timer = aio_timer_new(n->ctx, QEMU_CLOCK_VIRTUAL, SCALE_NS, > + nvme_post_cqes, cq); > + } else { > + cq->timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, nvme_post_cqes, cq); > + } > }
Duplicated initialization of cq->timer.