]> Pileus Git - ~andy/linux/commitdiff
KVM: change kvm_assign_device() to print return value when iommu_attach_device()...
authorShuah Khan <shuah.khan@hp.com>
Tue, 9 Oct 2012 00:36:11 +0000 (18:36 -0600)
committerMarcelo Tosatti <mtosatti@redhat.com>
Wed, 10 Oct 2012 18:45:40 +0000 (15:45 -0300)
Change existing kernel error message to include return value from
iommu_attach_device() when it fails. This will help debug device
assignment failures more effectively.

Signed-off-by: Shuah Khan <shuah.khan@hp.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
virt/kvm/iommu.c

index 037cb6730e68eef3171b0e9660d1139b423d96de..18e1e30019e3f573a8cd3540bc781b5648a239d4 100644 (file)
@@ -168,11 +168,7 @@ int kvm_assign_device(struct kvm *kvm,
 
        r = iommu_attach_device(domain, &pdev->dev);
        if (r) {
-               printk(KERN_ERR "assign device %x:%x:%x.%x failed",
-                       pci_domain_nr(pdev->bus),
-                       pdev->bus->number,
-                       PCI_SLOT(pdev->devfn),
-                       PCI_FUNC(pdev->devfn));
+               dev_err(&pdev->dev, "kvm assign device failed ret %d", r);
                return r;
        }