diff mbox

[01/17] kvm: libkvm: protect irq injection status code with KVM_CAP_IRQ_INJECT_STATUS

Message ID 1242574999-20887-2-git-send-email-aliguori@us.ibm.com (mailing list archive)
State New, archived
Headers show

Commit Message

Anthony Liguori May 17, 2009, 3:43 p.m. UTC
From: Gleb Natapov <gleb@redhat.com>

Fixes builds with older kernel headers.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

Comments

Avi Kivity May 17, 2009, 4:57 p.m. UTC | #1
Anthony Liguori wrote:
> From: Gleb Natapov <gleb@redhat.com>
>
> Fixes builds with older kernel headers.
>   

Since we build with a specific set of headers now (rather that 'make 
sync'), this isn't necessary.
diff mbox

Patch

diff --git a/kvm/libkvm/libkvm.c b/kvm/libkvm/libkvm.c
index 0ac1c28..7c65f31 100644
--- a/kvm/libkvm/libkvm.c
+++ b/kvm/libkvm/libkvm.c
@@ -667,9 +667,14 @@  int kvm_set_irq_level(kvm_context_t kvm, int irq, int level, int *status)
 	if (r == -1)
 		perror("kvm_set_irq_level");
 
-	if (status)
+	if (status) {
+#ifdef KVM_CAP_IRQ_INJECT_STATUS
 		*status = (kvm->irqchip_inject_ioctl == KVM_IRQ_LINE) ?
 			1 : event.status;
+#else
+		*status = 1;
+#endif
+	}
 
 	return 1;
 }