From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36855) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQsVo-0000pv-KN for qemu-devel@nongnu.org; Thu, 26 Feb 2015 02:05:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YQsVn-0006D2-G7 for qemu-devel@nongnu.org; Thu, 26 Feb 2015 02:05:32 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42531) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQsVn-0006Cj-8c for qemu-devel@nongnu.org; Thu, 26 Feb 2015 02:05:31 -0500 From: Jason Wang Date: Thu, 26 Feb 2015 15:04:43 +0800 Message-Id: <1424934286-7099-9-git-send-email-jasowang@redhat.com> In-Reply-To: <1424934286-7099-1-git-send-email-jasowang@redhat.com> References: <1424934286-7099-1-git-send-email-jasowang@redhat.com> Subject: [Qemu-devel] [PATCH V2 08/11] virtio-pci: switch to use bus specific queue limit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Jason Wang , Anthony Liguori , mst@redhat.com Instead of depending on a macro, switch to use a bus specific queue limit. Cc: Anthony Liguori Cc: Michael S. Tsirkin Signed-off-by: Jason Wang --- hw/virtio/virtio-pci.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index 7fa8141..23c4649 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -215,7 +215,7 @@ static void virtio_pci_start_ioeventfd(VirtIOPCIProxy *proxy) return; } - for (n = 0; n < VIRTIO_PCI_QUEUE_MAX; n++) { + for (n = 0; n < virtio_get_queue_max(vdev); n++) { if (!virtio_queue_get_num(vdev, n)) { continue; } @@ -251,7 +251,7 @@ static void virtio_pci_stop_ioeventfd(VirtIOPCIProxy *proxy) return; } - for (n = 0; n < VIRTIO_PCI_QUEUE_MAX; n++) { + for (n = 0; n < virtio_get_queue_max(vdev); n++) { if (!virtio_queue_get_num(vdev, n)) { continue; } @@ -287,11 +287,11 @@ static void virtio_ioport_write(void *opaque, uint32_t addr, uint32_t val) virtio_queue_set_addr(vdev, vdev->queue_sel, pa); break; case VIRTIO_PCI_QUEUE_SEL: - if (val < VIRTIO_PCI_QUEUE_MAX) + if (val < virtio_get_queue_max(vdev)) vdev->queue_sel = val; break; case VIRTIO_PCI_QUEUE_NOTIFY: - if (val < VIRTIO_PCI_QUEUE_MAX) { + if (val < virtio_get_queue_max(vdev)) { virtio_queue_notify(vdev, val); } break; @@ -792,7 +792,7 @@ static int virtio_pci_set_guest_notifiers(DeviceState *d, int nvqs, bool assign) bool with_irqfd = msix_enabled(&proxy->pci_dev) && kvm_msi_via_irqfd_enabled(); - nvqs = MIN(nvqs, VIRTIO_PCI_QUEUE_MAX); + nvqs = MIN(nvqs, virtio_get_queue_max(vdev)); /* When deassigning, pass a consistent nvqs value * to avoid leaking notifiers. -- 1.9.1