All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Jin Dongming <jin.dongming@np.css.fujitsu.com>,
	KVM list <kvm@vger.kernel.org>, Dean Nelson <dnelson@redhat.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	Avi Kivity <avi@redhat.com>, Huang Ying <ying.huang@intel.com>
Subject: Re: [Qemu-devel] 	Re: [PATCH 07/11] kvm, x86: unify sigbus handling, prep
Date: Fri, 15 Oct 2010 10:29:25 +0900	[thread overview]
Message-ID: <4CB7AE75.3090404@jp.fujitsu.com> (raw)
In-Reply-To: <20101015003656.GA32272@amt.cnet>

(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 <seto.hidetoshi@jp.fujitsu.com>
>> Tested-by: Jin Dongming <jin.dongming@np.css.fujitsu.com>
>> ---
>>  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


WARNING: multiple messages have this Message-ID (diff)
From: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: KVM list <kvm@vger.kernel.org>, Dean Nelson <dnelson@redhat.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	Avi Kivity <avi@redhat.com>, Huang Ying <ying.huang@intel.com>,
	Jin Dongming <jin.dongming@np.css.fujitsu.com>
Subject: Re: [Qemu-devel] 	Re: [PATCH 07/11] kvm, x86: unify sigbus handling, prep
Date: Fri, 15 Oct 2010 10:29:25 +0900	[thread overview]
Message-ID: <4CB7AE75.3090404@jp.fujitsu.com> (raw)
In-Reply-To: <20101015003656.GA32272@amt.cnet>

(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 <seto.hidetoshi@jp.fujitsu.com>
>> Tested-by: Jin Dongming <jin.dongming@np.css.fujitsu.com>
>> ---
>>  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

  reply	other threads:[~2010-10-15  1:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-14  8:49 [PATCH 07/11] kvm, x86: unify sigbus handling, prep Jin Dongming
2010-10-14  8:49 ` [Qemu-devel] " Jin Dongming
2010-10-15  0:36 ` Marcelo Tosatti
2010-10-15  0:36   ` [Qemu-devel] " Marcelo Tosatti
2010-10-15  1:29   ` Hidetoshi Seto [this message]
2010-10-15  1:29     ` Hidetoshi Seto
2010-10-15  1:46     ` Marcelo Tosatti
2010-10-15  1:46       ` Marcelo Tosatti

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=4CB7AE75.3090404@jp.fujitsu.com \
    --to=seto.hidetoshi@jp.fujitsu.com \
    --cc=avi@redhat.com \
    --cc=dnelson@redhat.com \
    --cc=jin.dongming@np.css.fujitsu.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=ying.huang@intel.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.