From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] move structures to svm/vmx.c, use untyped arch_data in independent code Date: Thu, 19 Jul 2007 11:26:50 +0300 Message-ID: <469F204A.6080700@qumranet.com> References: <469EAC5A.2070900@codemonkey.ws> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, avi-atKUWr5tajDk1uMJSBkQmQ@public.gmane.org To: Anthony Liguori Return-path: In-Reply-To: <469EAC5A.2070900-rdkfGonbjUSkNkDKm+mE6A@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 Anthony Liguori wrote: > Paul Turner wrote: > >> From: Paul Turner >> >> Since gcc can't handle [0]-sized arrays without type information we have >> to use a generic type and then cast to remove arch dependencies from the >> vcpu struct; this patch moves the structures (and the associated >> include dependency) from kvm.h into svm/vmx.c as well as introducing >> vmx/svm macros for accessing these fields where appt. >> >> > > Sorry, I'm jumping in pretty late in this thread, but this casting stuff > seems pretty ugly to me. Perhaps we need to take the refactoring a > little further and have kvm_vcpu be a member of kvm_vcpu_{vmx,svm} and > then use the standard container_of() stuff to get at the pointer? > > This is definitely the right way to do it. -- error compiling committee.c: too many arguments to function ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/