Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 125273
b: refs/heads/master
c: 6155236
h: refs/heads/master
i:
  125271: 641f7e0
v: v3
  • Loading branch information
Mark McLoughlin authored and Avi Kivity committed Dec 31, 2008
1 parent 7146ebc commit 4526735
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f29b2673d3fc7ae38ec22922e9cdc75ee37386b5
refs/heads/master: 61552367b2ce5e9bea6b6af670ec80aea386f34e
14 changes: 10 additions & 4 deletions trunk/virt/kvm/irq_comm.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,25 @@ int kvm_request_irq_source_id(struct kvm *kvm)
unsigned long *bitmap = &kvm->arch.irq_sources_bitmap;
int irq_source_id = find_first_zero_bit(bitmap,
sizeof(kvm->arch.irq_sources_bitmap));

if (irq_source_id >= sizeof(kvm->arch.irq_sources_bitmap)) {
printk(KERN_WARNING "kvm: exhaust allocatable IRQ sources!\n");
irq_source_id = -EFAULT;
} else
set_bit(irq_source_id, bitmap);
return -EFAULT;
}

ASSERT(irq_source_id != KVM_USERSPACE_IRQ_SOURCE_ID);
set_bit(irq_source_id, bitmap);

return irq_source_id;
}

void kvm_free_irq_source_id(struct kvm *kvm, int irq_source_id)
{
int i;

if (irq_source_id <= 0 ||
ASSERT(irq_source_id != KVM_USERSPACE_IRQ_SOURCE_ID);

if (irq_source_id < 0 ||
irq_source_id >= sizeof(kvm->arch.irq_sources_bitmap)) {
printk(KERN_ERR "kvm: IRQ source ID out of range!\n");
return;
Expand Down

0 comments on commit 4526735

Please sign in to comment.