 
	
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH][RESEND] Add syntax checking for xm block-attach
 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
 
 
 | 
|  | Lists.xenproject.org is hosted with RackSpace, monitoring our |