From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Otte Subject: Re: [kvm-ppc-devel] [PATCH] Split kvm_vcpu to support new archs. Date: Fri, 19 Oct 2007 15:34:20 +0200 Message-ID: <4718B25C.4080506@de.ibm.com> References: <42DFA526FC41B1429CE7279EF83C6BDC809A6A@pdsmsx415.ccr.corp.intel.com> <1192737702.21205.17.camel@basalt> <4717CA4B.7040307@codemonkey.ws> <1192742084.21205.22.camel@basalt> <4717D095.40708@codemonkey.ws> <1192743798.21205.30.camel@basalt> Reply-To: carsteno-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, kvm-ppc-devel , "Zhang, Xiantao" To: Hollis Blanchard Return-path: In-Reply-To: <1192743798.21205.30.camel@basalt> 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 Hollis Blanchard wrote: > I must be misunderstanding, because this seems completely backwards to > me. With your nesting, any time architecture code wants to access > architecture state (which is almost all the time), you'd *need* > container_of: > > void arch_func(struct kvm_vcpu *vcpu) { > struct arch_vcpu *arch = container_of(vcpu, arch_vcpu, > arch); > arch->gpr[3] = 0; > } > > In contrast, my nesting proposal would look like this: > > void arch_func(struct kvm_vcpu *vcpu) { > vcpu->arch.gpr[3] = 0; > } > I'm with Hollis on this one. It looks clearly preferable to me. ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/