aboutsummaryrefslogtreecommitdiffstats
path: root/virt/kvm
diff options
context:
space:
mode:
authorAndre Richter <andre.o.richter@gmail.com>2013-10-02 06:23:26 -0400
committerGleb Natapov <gleb@redhat.com>2013-10-03 04:47:02 -0400
commit29242cb5c63b1f8e12e8055ba1a6c3e0004fa86d (patch)
tree9232fb54531bd2bea6035147964d34dbc4f1dfbf /virt/kvm
parent2f303b74a62fb74983c0a66e2df353be963c527c (diff)
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: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Andre Richter <andre.o.richter@gmail.com> Signed-off-by: Gleb Natapov <gleb@redhat.com>
Diffstat (limited to 'virt/kvm')
-rw-r--r--virt/kvm/iommu.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/virt/kvm/iommu.c b/virt/kvm/iommu.c
index 72a130bc448a..a3b14109049b 100644
--- a/virt/kvm/iommu.c
+++ b/virt/kvm/iommu.c
@@ -190,11 +190,7 @@ int kvm_assign_device(struct kvm *kvm,
190 190
191 pdev->dev_flags |= PCI_DEV_FLAGS_ASSIGNED; 191 pdev->dev_flags |= PCI_DEV_FLAGS_ASSIGNED;
192 192
193 printk(KERN_DEBUG "assign device %x:%x:%x.%x\n", 193 dev_info(&pdev->dev, "kvm assign device\n");
194 assigned_dev->host_segnr,
195 assigned_dev->host_busnr,
196 PCI_SLOT(assigned_dev->host_devfn),
197 PCI_FUNC(assigned_dev->host_devfn));
198 194
199 return 0; 195 return 0;
200out_unmap: 196out_unmap:
@@ -220,11 +216,7 @@ int kvm_deassign_device(struct kvm *kvm,
220 216
221 pdev->dev_flags &= ~PCI_DEV_FLAGS_ASSIGNED; 217 pdev->dev_flags &= ~PCI_DEV_FLAGS_ASSIGNED;
222 218
223 printk(KERN_DEBUG "deassign device %x:%x:%x.%x\n", 219 dev_info(&pdev->dev, "kvm deassign device\n");
224 assigned_dev->host_segnr,
225 assigned_dev->host_busnr,
226 PCI_SLOT(assigned_dev->host_devfn),
227 PCI_FUNC(assigned_dev->host_devfn));
228 220
229 return 0; 221 return 0;
230} 222}