From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hidetoshi Seto Subject: Re: [Qemu-devel] Re: [PATCH 07/11] kvm, x86: unify sigbus handling, prep Date: Fri, 15 Oct 2010 10:29:25 +0900 Message-ID: <4CB7AE75.3090404@jp.fujitsu.com> References: <4CB6C427.10202@np.css.fujitsu.com> <20101015003656.GA32272@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Jin Dongming , KVM list , Dean Nelson , "qemu-devel@nongnu.org" , Avi Kivity , Huang Ying To: Marcelo Tosatti Return-path: Received: from fgwmail6.fujitsu.co.jp ([192.51.44.36]:37685 "EHLO fgwmail6.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753276Ab0JOBaG (ORCPT ); Thu, 14 Oct 2010 21:30:06 -0400 Received: from m2.gw.fujitsu.co.jp ([10.0.50.72]) by fgwmail6.fujitsu.co.jp (Fujitsu Gateway) with ESMTP id o9F1U4C3023751 for (envelope-from seto.hidetoshi@jp.fujitsu.com); Fri, 15 Oct 2010 10:30:04 +0900 Received: from smail (m2 [127.0.0.1]) by outgoing.m2.gw.fujitsu.co.jp (Postfix) with ESMTP id 32C6345DE5D for ; Fri, 15 Oct 2010 10:30:04 +0900 (JST) Received: from s2.gw.fujitsu.co.jp (s2.gw.fujitsu.co.jp [10.0.50.92]) by m2.gw.fujitsu.co.jp (Postfix) with ESMTP id 027BD45DE51 for ; Fri, 15 Oct 2010 10:30:04 +0900 (JST) Received: from s2.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s2.gw.fujitsu.co.jp (Postfix) with ESMTP id AAE881DB803A for ; Fri, 15 Oct 2010 10:30:03 +0900 (JST) Received: from m107.s.css.fujitsu.com (m107.s.css.fujitsu.com [10.249.87.107]) by s2.gw.fujitsu.co.jp (Postfix) with ESMTP id 47D541DB8041 for ; Fri, 15 Oct 2010 10:30:03 +0900 (JST) In-Reply-To: <20101015003656.GA32272@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: (2010/10/15 9:36), Marcelo Tosatti wrote: > On Thu, Oct 14, 2010 at 05:49:43PM +0900, Jin Dongming wrote: >> There are 2 similar functions to handle SIGBUS: >> sigbus_handler(int n, struct qemu_signalfd_siginfo *siginfo, >> void *ctx) >> kvm_on_sigbus(CPUState *env, siginfo_t *siginfo) >> >> The former is used when main thread receives SIGBUS via signalfd, >> while latter is used when vcpu thread receives SIGBUS. >> These 2 take different siginfo, but in both case required parameters >> are common, the code and the addr in the info. >> >> Restruct functions to take the code and the addr explicitly. >> >> Signed-off-by: Hidetoshi Seto >> Tested-by: Jin Dongming >> --- >> qemu-kvm.c | 41 ++++++++++++++++++++--------------------- >> 1 files changed, 20 insertions(+), 21 deletions(-) > > Don't see the benefit, separate functions are cleaner. I think this is good for maintainability. If you want to fix a bug in this area, you might have to change 2 separate functions in completely same way. See 6c85786 and a05684e for examples. Thanks, H.Seto