Commit 29242cb5 authored by Andre Richter's avatar Andre Richter Committed by Gleb Natapov

virt/kvm/iommu.c: Add leading zeros to device's BDF notation in debug messages

When KVM (de)assigns PCI(e) devices to VMs, a debug message is printed
including the BDF notation of the respective device. Currently, the BDF
notation does not have the commonly used leading zeros. This produces
messages like "assign device 0:1:8.0", which look strange at first sight.

The patch fixes this by exchanging the printk(KERN_DEBUG ...) with dev_info()
and also inserts "kvm" into the debug message, so that it is obvious where
the message comes from. Also reduces LoC.
Acked-by: default avatarAlex Williamson <alex.williamson@redhat.com>
Signed-off-by: default avatarAndre Richter <andre.o.richter@gmail.com>
Signed-off-by: default avatarGleb Natapov <gleb@redhat.com>
parent 2f303b74
...@@ -190,11 +190,7 @@ int kvm_assign_device(struct kvm *kvm, ...@@ -190,11 +190,7 @@ int kvm_assign_device(struct kvm *kvm,
pdev->dev_flags |= PCI_DEV_FLAGS_ASSIGNED; pdev->dev_flags |= PCI_DEV_FLAGS_ASSIGNED;
printk(KERN_DEBUG "assign device %x:%x:%x.%x\n", dev_info(&pdev->dev, "kvm assign device\n");
assigned_dev->host_segnr,
assigned_dev->host_busnr,
PCI_SLOT(assigned_dev->host_devfn),
PCI_FUNC(assigned_dev->host_devfn));
return 0; return 0;
out_unmap: out_unmap:
...@@ -220,11 +216,7 @@ int kvm_deassign_device(struct kvm *kvm, ...@@ -220,11 +216,7 @@ int kvm_deassign_device(struct kvm *kvm,
pdev->dev_flags &= ~PCI_DEV_FLAGS_ASSIGNED; pdev->dev_flags &= ~PCI_DEV_FLAGS_ASSIGNED;
printk(KERN_DEBUG "deassign device %x:%x:%x.%x\n", dev_info(&pdev->dev, "kvm deassign device\n");
assigned_dev->host_segnr,
assigned_dev->host_busnr,
PCI_SLOT(assigned_dev->host_devfn),
PCI_FUNC(assigned_dev->host_devfn));
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment