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] xen : Replace hard coded domain_id checks with a

To: Mihir Nanavati <mihirn@xxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] xen : Replace hard coded domain_id checks with a macro
From: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
Date: Fri, 10 Dec 2010 09:08:23 +0000
Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Fri, 10 Dec 2010 01:11:15 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <AANLkTikP5kGGuTSPzAZbDXktxdYNxB=hyGVVraHf1vAB@xxxxxxxxxxxxxx>
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>
Organization: Citrix Systems, Inc.
References: <AANLkTikP5kGGuTSPzAZbDXktxdYNxB=hyGVVraHf1vAB@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Fri, 2010-12-10 at 07:07 +0000, Mihir Nanavati wrote:
> Replace a number of checks for Dom0, that have been hard coded to
> check for domain_id being zero with a macro is_dom0_domain().

Is the intention for this macro return true for some domid != 0 under
some future circumstance? In that case the macro name will turn out to
be badly chosen.

I'm not sure there is any benefit to hard coding a 0 in the function
name as opposed to hardcoding at the call site. I suppose it's a little
easier to search and replace...

Is there a name which describes the actual semantics which the callers
want, as opposed to testing the dom0-ness? Or perhaps there is more than
one desired semantic, in which case multiple predicates would be ok
IMHO. Does the existing IS_PRIV cover some of the cases?

Ian.


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