From: Hollis Blanchard Subject: Re: [PATCH][RESEND] Add syntax checking for xm block-attach Date: Fri, 08 Sep 2006 10:13:16 -0500 Message-ID: <1157728396.26967.12.camel@basalt.austin.ibm.com> References: <16C6D2E6799A23kanno.masaki@jp.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <16C6D2E6799A23kanno.masaki@jp.fujitsu.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Masaki Kanno Cc: xen-devel@lists.xensource.com, ewan@xensource.com List-Id: xen-devel@lists.xenproject.org On Fri, 2006-09-08 at 10:31 +0900, Masaki Kanno wrote: > + # 'r' : read-only mode > + # 'w' : read-write mode > + # 'w!' : read-write and it is safe to have multiple writers on this device > + mode = sxp.child_value(config, 'mode', 'r') > + if mode != 'r' and mode != 'w' and mode != 'w!': > + raise VmError('Invalid mode') I don't think the comments are necessary; those are pretty standard. Also, try this for your test: if mode not in ('r', 'w', 'w!'): raise VmError('Invalid mode') -- Hollis Blanchard IBM Linux Technology Center