All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] qemu-kvm: fix no gsi routing warning
@ 2009-09-21 14:51 Michael S. Tsirkin
  2009-09-21 14:56 ` Avi Kivity
  0 siblings, 1 reply; 4+ messages in thread
From: Michael S. Tsirkin @ 2009-09-21 14:51 UTC (permalink / raw)
  To: kvm, avi; +Cc: quintela, hch

When running on host kernel which does not let the guest manupulate the
gsi routing, and user requested MSI-X to be enabled, we get the
following warnings:
kvm_msix_add: kvm_get_irq_route_gsi failed: No space left on device
kvm_msix_update: kvm_update_routing_entry failed: Invalid argument

What really happens is that we report a failure to allocate
a vector to the guest, it will retry and finally disable MSI.

Make this clearer by checking for gsi capability and warning about
the error in a readable form.

Reported-by: Juan Quintela <quintela@redhat.com>
Suggested-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/msix.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/hw/msix.c b/hw/msix.c
index fcd425f..5695582 100644
--- a/hw/msix.c
+++ b/hw/msix.c
@@ -129,6 +129,13 @@ static int kvm_msix_add(PCIDevice *dev, unsigned vector)
     struct kvm_irq_routing_entry *entry = dev->msix_irq_entries + vector;
     int r;
 
+    if (!kvm_has_gsi_routing(kvm_context)) {
+        fprintf(stderr, "Warning: no MSI-X support found. "
+                "At least kernel 2.6.30 is required for MSI-X support.\n"
+               );
+        return -EOPNOTSUPP;
+    }
+
     r = kvm_get_irq_route_gsi(kvm_context);
     if (r < 0) {
         fprintf(stderr, "%s: kvm_get_irq_route_gsi failed: %s\n", __func__, strerror(-r));
-- 
1.6.2.5

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-09-23  9:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-21 14:51 [PATCH] qemu-kvm: fix no gsi routing warning Michael S. Tsirkin
2009-09-21 14:56 ` Avi Kivity
2009-09-21 19:50   ` Michael S. Tsirkin
2009-09-23  9:04     ` Avi Kivity

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.