WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH 2 of 5] early PV on HVM

To: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 2 of 5] early PV on HVM
From: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Date: Fri, 12 Mar 2010 12:22:07 -0800
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, "linux-kernel@xxxxxxxxxxxxxxx" <linux-kernel@xxxxxxxxxxxxxxx>
Delivery-date: Fri, 12 Mar 2010 12:22:42 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <alpine.DEB.2.00.1003121819500.27222@kaball-desktop>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <alpine.DEB.2.00.1003101501320.28412@kaball-desktop> <4B995EA6.8080105@xxxxxxxx> <alpine.DEB.2.00.1003121819500.27222@kaball-desktop>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.8) Gecko/20100301 Fedora/3.0.3-1.fc12 Lightning/1.0b2pre Thunderbird/3.0.3
On 03/12/2010 11:09 AM, Stefano Stabellini wrote:
My version is not 64-bit specific, should I move it to a new file
anyway?

I was trying to keep the differences with Sheng's version low, but in
this case I am not quite sure how to manage it.
Suggestions are welcome.

My rough rules for code layout (in no particular order):

   * keep similar functions together (even if they're not necessarily
     sharing common code)
   * dislike externs and cross-file references (ie, prefer static
     functions/data) -> keep code sharing functions/data together
   * dislike #ifdef CONFIG_x within files; prefer Makefile rules to
     either completely compile or not compile files
   * dislike dumping-ground files
   * dislike too-small files
   * dislike moving code between files, so its better to get it right
     from the start (it makes merging harder)

So in this case, enlighten.c is the general setup/init/misc file in xen/. I've been trying to move things out of it to reduce its dumping ground-ness. In your case, the changes are clearly init, so they probably belong there. They're compiled unconditionally, so there's no #ifdef. They're fairly small so they would probably be too small in a separate file (unless its likely to get bigger?). So keep in enlighten.c.

(In Sheng's version of this patch, it has more code and is conditionally compiled, so I think the balance tips the other way.)

    J


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>