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][RESEND] Add syntax checking for xm block-attach

To: Masaki Kanno <kanno.masaki@xxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH][RESEND] Add syntax checking for xm block-attach
From: Hollis Blanchard <hollisb@xxxxxxxxxx>
Date: Fri, 08 Sep 2006 10:13:16 -0500
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, ewan@xxxxxxxxxxxxx
Delivery-date: Fri, 08 Sep 2006 08:13:15 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <16C6D2E6799A23kanno.masaki@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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: IBM Linux Technology Center
References: <16C6D2E6799A23kanno.masaki@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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


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

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