Commit 1e001d49f9f9a0e3eb72939ad49d9a2c7754e9c1

Authored by Jan Kiszka
Committed by Avi Kivity
1 parent 0645211c43

KVM: Refactor IRQ names of assigned devices

Cosmetic change, but it helps to correlate IRQs with PCI devices.

Acked-by: Alex Williamson <alex.williamson@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>

Showing 2 changed files with 7 additions and 5 deletions Side-by-side Diff

include/linux/kvm_host.h
... ... @@ -489,6 +489,7 @@
489 489 struct pci_dev *dev;
490 490 struct kvm *kvm;
491 491 spinlock_t intx_lock;
  492 + char irq_name[32];
492 493 };
493 494  
494 495 struct kvm_irq_mask_notifier {
virt/kvm/assigned-dev.c
... ... @@ -231,8 +231,7 @@
231 231 * are going to be long delays in accepting, acking, etc.
232 232 */
233 233 if (request_threaded_irq(dev->host_irq, NULL, kvm_assigned_dev_thread,
234   - IRQF_ONESHOT, "kvm_assigned_intx_device",
235   - (void *)dev))
  234 + IRQF_ONESHOT, dev->irq_name, (void *)dev))
236 235 return -EIO;
237 236 return 0;
238 237 }
... ... @@ -251,7 +250,7 @@
251 250  
252 251 dev->host_irq = dev->dev->irq;
253 252 if (request_threaded_irq(dev->host_irq, NULL, kvm_assigned_dev_thread,
254   - 0, "kvm_assigned_msi_device", (void *)dev)) {
  253 + 0, dev->irq_name, (void *)dev)) {
255 254 pci_disable_msi(dev->dev);
256 255 return -EIO;
257 256 }
... ... @@ -278,8 +277,7 @@
278 277 for (i = 0; i < dev->entries_nr; i++) {
279 278 r = request_threaded_irq(dev->host_msix_entries[i].vector,
280 279 NULL, kvm_assigned_dev_thread,
281   - 0, "kvm_assigned_msix_device",
282   - (void *)dev);
  280 + 0, dev->irq_name, (void *)dev);
283 281 if (r)
284 282 goto err;
285 283 }
... ... @@ -335,6 +333,9 @@
335 333  
336 334 if (dev->irq_requested_type & KVM_DEV_IRQ_HOST_MASK)
337 335 return r;
  336 +
  337 + snprintf(dev->irq_name, sizeof(dev->irq_name), "kvm:%s",
  338 + pci_name(dev->dev));
338 339  
339 340 switch (host_irq_type) {
340 341 case KVM_DEV_IRQ_HOST_INTX: