From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joe Perches Subject: Re: [PATCH 048/104] KVM: Add and use pr_unimpl for standard formatting of unimplemented features Date: Mon, 17 Sep 2007 09:16:18 -0700 Message-ID: <1190045778.19708.211.camel@localhost> References: <11900179463203-git-send-email-avi@qumranet.com> <11900179481707-git-send-email-avi@qumranet.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Avi Kivity Return-path: In-Reply-To: <11900179481707-git-send-email-avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org On Mon, 2007-09-17 at 10:31 +0200, Avi Kivity wrote: > diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h > index cfda3ab..6d25826 100644 > --- a/drivers/kvm/kvm.h > +++ b/drivers/kvm/kvm.h > @@ -474,6 +474,14 @@ struct kvm_arch_ops { > > extern struct kvm_arch_ops *kvm_arch_ops; > > +/* 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) > + > #define kvm_printf(kvm, fmt ...) printk(KERN_DEBUG fmt) > #define vcpu_printf(vcpu, fmt...) kvm_printf(vcpu->kvm, fmt) > This converts all KERN_ uses to KERN_ERR. It seems better to add a argument to kvm_printf. pr_unimpl is perhaps a poor name choice. perhaps vcpu_printk_ratelimit(vcpu, level, fmt, ...) ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/