Skip to content

Commit

Permalink
KVM: Refactor IRQ names of assigned devices
Browse files Browse the repository at this point in the history
Cosmetic change, but it helps to correlate IRQs with PCI devices.

Acked-by: Alex Williamson <[email protected]>
Acked-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Marcelo Tosatti <[email protected]>
  • Loading branch information
jan-kiszka authored and avikivity committed Jan 12, 2011
1 parent 0645211 commit 1e001d4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions include/linux/kvm_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,7 @@ struct kvm_assigned_dev_kernel {
struct pci_dev *dev;
struct kvm *kvm;
spinlock_t intx_lock;
char irq_name[32];
};

struct kvm_irq_mask_notifier {
Expand Down
11 changes: 6 additions & 5 deletions virt/kvm/assigned-dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,7 @@ static int assigned_device_enable_host_intx(struct kvm *kvm,
* are going to be long delays in accepting, acking, etc.
*/
if (request_threaded_irq(dev->host_irq, NULL, kvm_assigned_dev_thread,
IRQF_ONESHOT, "kvm_assigned_intx_device",
(void *)dev))
IRQF_ONESHOT, dev->irq_name, (void *)dev))
return -EIO;
return 0;
}
Expand All @@ -251,7 +250,7 @@ static int assigned_device_enable_host_msi(struct kvm *kvm,

dev->host_irq = dev->dev->irq;
if (request_threaded_irq(dev->host_irq, NULL, kvm_assigned_dev_thread,
0, "kvm_assigned_msi_device", (void *)dev)) {
0, dev->irq_name, (void *)dev)) {
pci_disable_msi(dev->dev);
return -EIO;
}
Expand All @@ -278,8 +277,7 @@ static int assigned_device_enable_host_msix(struct kvm *kvm,
for (i = 0; i < dev->entries_nr; i++) {
r = request_threaded_irq(dev->host_msix_entries[i].vector,
NULL, kvm_assigned_dev_thread,
0, "kvm_assigned_msix_device",
(void *)dev);
0, dev->irq_name, (void *)dev);
if (r)
goto err;
}
Expand Down Expand Up @@ -336,6 +334,9 @@ static int assign_host_irq(struct kvm *kvm,
if (dev->irq_requested_type & KVM_DEV_IRQ_HOST_MASK)
return r;

snprintf(dev->irq_name, sizeof(dev->irq_name), "kvm:%s",
pci_name(dev->dev));

switch (host_irq_type) {
case KVM_DEV_IRQ_HOST_INTX:
r = assigned_device_enable_host_intx(kvm, dev);
Expand Down

0 comments on commit 1e001d4

Please sign in to comment.