Skip to contentSkip to conversation

kvm: Don't abort on kvm_irqchip_add_msi_route()

PATCH Applied Alex Williamson 3 participants 3 messages Jun 25, 2012 – Jun 29, 2012 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kvm: Don't abort on kvm_irqchip_add_msi_route()

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.

---

 kvm-all.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kvm-all.c +1 -1
index 45d00cd..b2ed702 100644
@@ -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)
Acked-by on v1 1/1
#1 lore raw
Quoted 28 lines · Alex Williamson

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.

---

 kvm-all.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kvm-all.c +0 -0
index 45d00cd..b2ed702 100644

kvm-all.c int kvm_irqchip_send_msi(KVMState *s, MSIMessage msg) · line 1152

Quoted 8 lines
kvm-all.c +1 -1
@@ -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)
#2 lore raw
In reply to Alex Williamson
Quoted 12 lines · Alex Williamson

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>
}

Quoted 5 lines

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

Applied to uq/master.