public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@redhat.com>
To: avi@redhat.com, kvm@vger.kernel.org, mtosatti@redhat.com,
	jan.kiszka@siemens.com
Cc: qemu-devel@nongnu.org
Subject: [PATCH] kvm: Don't abort on kvm_irqchip_add_msi_route()
Date: Mon, 25 Jun 2012 09:40:39 -0600	[thread overview]
Message-ID: <20120625154024.3598.7168.stgit@bling.home> (raw)

Anyone using these functions has to be prepared that irqchip
support may not be present.  It shouldn't be up to the core
code to determine whether this is a fatal error.  Currently
code written as:

virq = kvm_irqchip_add_msi_route(...)
if (virq < 0) {
    <slow path>
} else {
    <fast path>
}

works on x86 with and without kvm irqchip enabled, works
without kvm support compiled in, but aborts() on !x86 with
kvm support.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
---

 kvm-all.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kvm-all.c b/kvm-all.c
index 45d00cd..b2ed702 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -1146,7 +1146,7 @@ int kvm_irqchip_send_msi(KVMState *s, MSIMessage msg)
 
 int kvm_irqchip_add_msi_route(KVMState *s, MSIMessage msg)
 {
-    abort();
+    return -ENOSYS;
 }
 
 static int kvm_irqchip_assign_irqfd(KVMState *s, int fd, int virq, bool assign)


             reply	other threads:[~2012-06-25 15:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-25 15:40 Alex Williamson [this message]
2012-06-25 20:28 ` [PATCH] kvm: Don't abort on kvm_irqchip_add_msi_route() Jan Kiszka
2012-06-29 23:02 ` Marcelo Tosatti

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120625154024.3598.7168.stgit@bling.home \
    --to=alex.williamson@redhat.com \
    --cc=avi@redhat.com \
    --cc=jan.kiszka@siemens.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox