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>, Ian Campbell <Ian.Campbell@xxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] xen : Replace hard coded domain_id checks with a macro
From: Keir Fraser <keir@xxxxxxx>
Date: Fri, 10 Dec 2010 10:42:39 +0000
Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Fri, 10 Dec 2010 02:43:45 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:user-agent:date :subject:from:to:cc:message-id:thread-topic:thread-index:in-reply-to :mime-version:content-type:content-transfer-encoding; bh=V2MhFPdKY7iuqHjyvHoVAAyQke7I20C4HU92VxeGpMY=; b=v/Vh+2ARGWszncFeNSmn7USuSo/NYVZf97M6VR9uJcTib2RalGUrg1grfQMQ3RJfa9 Jht/tKWrqWOE2KC4bf+WYPL+6ZO0DycNtiJLAY/T33Vj3wbb40za/doNSIGfK0HFEMaM BV8Uw+GN+WNM2jlr5kFS/iCePKfYZiHB0jLA4=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic :thread-index:in-reply-to:mime-version:content-type :content-transfer-encoding; b=w6cRkU5AQKIoWGfbmOyl/fqEI6WxUsRCU/VW3CArOd6deO5eVMxpdUg9SJRxXAM+1k 1leUrLm/WjmYzk3KOAW/FfjoGHN6ExIOD6dOb5RXF12yaKDw5q0ehoKRGN1loZNUEzH8 aGsP4CfsjXbzx1ptojQ38nErHwzX0jQW8Wr1U=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <AANLkTi=oVFpJiL9nT2BzTm4auu1my2Lbii+XwinSBgwX@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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcuYVvcSN+Tn7iYxq0SYPdYuzoUlAw==
Thread-topic: [Xen-devel] [PATCH] xen : Replace hard coded domain_id checks with a macro
User-agent: Microsoft-Entourage/12.27.0.100910
I'm undecided. The patch by itself is kind of harmless but also kind of
pointless. Probably we should leave this until you have something more
substantial to propose. Trickling in trivial patches like this is a waste of
time.

 -- Keir

On 10/12/2010 10:13, "Mihir Nanavati" <mihirn@xxxxxxxxx> wrote:

> Yes, the idea is to later have it, or another similar macro return true for
> domids != 0. At the moment, I think it's likely that there will be other
> separate predicates (maybe something like is_xenstore_domain,
> is_control_domain, etc) for different disaggregated domains, and then have the
> last bit continue to use this, even though it may no longer be domid 0.
> 
> You're right about the name being ill-chosen, but the only other name I could
> come up with was is_what_used_to_be_dom0 which was even worse ;) I'm open to
> suggestions. Perhaps, hardware domain or pci domain?
> 
> At the moment, IS_PRIV could be used, but it would lead to a coupling of the
> privileges with functionality which could be problematic later on.
> 
> ~M
> 
> On Fri, Dec 10, 2010 at 1:08 AM, Ian Campbell <Ian.Campbell@xxxxxxxxxx> wrote:
>> 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



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