diff options
author | Jan Kiszka <jan.kiszka@siemens.com> | 2011-09-12 11:26:22 +0200 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-09-25 18:52:43 +0200 |
commit | bd80158aff71a80292f96d9baea1a65bc0ce87b3 (patch) | |
tree | 7e5dc6ed6cb0be43d2c6ce20c4771965ce803d51 /include | |
parent | KVM: x86: Avoid guest-triggerable printks in APIC model (diff) | |
download | linux-bd80158aff71a80292f96d9baea1a65bc0ce87b3.tar.xz linux-bd80158aff71a80292f96d9baea1a65bc0ce87b3.zip |
KVM: Clean up and extend rate-limited output
The use of printk_ratelimit is discouraged, replace it with
pr*_ratelimited or __ratelimit. While at it, convert remaining
guest-triggerable printks to rate-limited variants.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/kvm_host.h | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index d0e42f30edf6..2a414f66af28 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -18,6 +18,7 @@ #include <linux/msi.h> #include <linux/slab.h> #include <linux/rcupdate.h> +#include <linux/ratelimit.h> #include <asm/signal.h> #include <linux/kvm.h> @@ -282,11 +283,8 @@ struct kvm { /* The guest did something we don't support. */ #define pr_unimpl(vcpu, fmt, ...) \ - do { \ - if (printk_ratelimit()) \ - printk(KERN_ERR "kvm: %i: cpu%i " fmt, \ - current->tgid, (vcpu)->vcpu_id , ## __VA_ARGS__); \ - } while (0) + pr_err_ratelimited("kvm: %i: cpu%i " fmt, \ + current->tgid, (vcpu)->vcpu_id , ## __VA_ARGS__) #define kvm_printf(kvm, fmt ...) printk(KERN_DEBUG fmt) #define vcpu_printf(vcpu, fmt...) kvm_printf(vcpu->kvm, fmt) |