Masaki Kanno
2006-Sep-08 01:31 UTC
[Xen-devel] [PATCH][RESEND] Add syntax checking for xm block-attach
Hi, This patch adds syntax checking for "xm block-attach" command. The character string that can be specified for "mode" is "r", "w", and "w!". Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com> Best regards, Kan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Hollis Blanchard
2006-Sep-08 15:13 UTC
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@lists.xensource.com http://lists.xensource.com/xen-devel
Masaki Kanno
2006-Sep-11 01:12 UTC
Re: [Xen-devel] [PATCH][RESEND] Add syntax checking for xmblock-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'')Hi Hollis, Thanks for your comments and example codes. Best regards, Kan> >-- >Hollis Blanchard >IBM Linux Technology Center > > >_______________________________________________ >Xen-devel mailing list >Xen-devel@lists.xensource.com >http://lists.xensource.com/xen-devel_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel