All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gleb Natapov <gleb@redhat.com>
To: Andre Richter <andre.o.richter@gmail.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Alex Williamson <alex.williamson@redhat.com>
Subject: Re: [PATCH 1/1] virt/kvm/iommu.c: Add leading zeros to device's BDF notation in debug messages
Date: Wed, 2 Oct 2013 13:35:08 +0300	[thread overview]
Message-ID: <20131002103508.GG17294@redhat.com> (raw)
In-Reply-To: <1380709406-3528-1-git-send-email-andre.o.richter@gmail.com>

On Wed, Oct 02, 2013 at 12:23:26PM +0200, Andre Richter wrote:
> 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.
Legacy assigned device is deprecated, but this looks nice enough to
apply. Alex can you glance at it?

> 
> Signed-off-by: Andre Richter <andre.o.richter@gmail.com>
> ---
>  virt/kvm/iommu.c | 12 ++----------
>  1 file changed, 2 insertions(+), 10 deletions(-)
> 
> diff --git a/virt/kvm/iommu.c b/virt/kvm/iommu.c
> index 72a130b..a3b1410 100644
> --- a/virt/kvm/iommu.c
> +++ b/virt/kvm/iommu.c
> @@ -190,11 +190,7 @@ int kvm_assign_device(struct kvm *kvm,
>  
>  	pdev->dev_flags |= PCI_DEV_FLAGS_ASSIGNED;
>  
> -	printk(KERN_DEBUG "assign device %x:%x:%x.%x\n",
> -		assigned_dev->host_segnr,
> -		assigned_dev->host_busnr,
> -		PCI_SLOT(assigned_dev->host_devfn),
> -		PCI_FUNC(assigned_dev->host_devfn));
> +	dev_info(&pdev->dev, "kvm assign device\n");
>  
>  	return 0;
>  out_unmap:
> @@ -220,11 +216,7 @@ int kvm_deassign_device(struct kvm *kvm,
>  
>  	pdev->dev_flags &= ~PCI_DEV_FLAGS_ASSIGNED;
>  
> -	printk(KERN_DEBUG "deassign device %x:%x:%x.%x\n",
> -		assigned_dev->host_segnr,
> -		assigned_dev->host_busnr,
> -		PCI_SLOT(assigned_dev->host_devfn),
> -		PCI_FUNC(assigned_dev->host_devfn));
> +	dev_info(&pdev->dev, "kvm deassign device\n");
>  
>  	return 0;
>  }
> -- 
> 1.8.1.2

--
			Gleb.

  reply	other threads:[~2013-10-02 10:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-02 10:23 [PATCH 1/1] virt/kvm/iommu.c: Add leading zeros to device's BDF notation in debug messages Andre Richter
2013-10-02 10:35 ` Gleb Natapov [this message]
2013-10-02 15:41   ` Alex Williamson
2013-10-02 19:08     ` Andre Richter
2013-10-02 19:58       ` Alex Williamson
2013-10-03  8:48 ` Gleb Natapov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131002103508.GG17294@redhat.com \
    --to=gleb@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=andre.o.richter@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.