[lvm-devel][PATCH] Add escape sequence for ':' in command's PV list

Dave Wysochanski dwysocha at redhat.com
Fri May 15 12:07:30 UTC 2009


On Thu, 2009-05-14 at 15:25 -0400, Dave Wysochanski wrote:
> On Thu, 2009-05-14 at 11:33 +0200, Peter Rajnoha wrote: 
> > On 05/13/2009 09:43 PM, Dave Wysochanski wrote:
> > > I know, it does not make sense to specify a pe range
> > > for pvcreate or vgcreate.  But shouldn't we be consistent, or at least
> > > very much clarify the arguments are different?  I can just imagine
> > > someone scripting something and then being surprised when they needed to
> > > quote only for lvcreate, pvmove, etc.
> > 
> > Hmm, then the question is, what should we do with single unescaped ':' if
> > it appears in pvcreate, vgcreate, e.g. "pvcreate /dev/a::b:c" -- the first
> > double one is OK, but what about the second single one? Should it be considered
> > as an input error then? (...probably giving the user a message like
> > "PE range definition not allowed here.")
> > 
> 
> At this point I'd lean towards just clarifing the difference in the
> arguments for the commands (e.g. in man pages, etc).  See attached patch
> for a stab at updating the man pages.  If we go this route, then your
> patch is fine as is IMO.
> 
> Also, on IRC yesterday, Alasdair suggested a new built-in command to
> escape names such as this 
> 17:01:40 < deepthot> agk_: on the escaping, you mean someone would do something like: lvcreate -L 16M -n lvname vgname `lvmescape /dev/pname`?
> 17:05:07 < agk_> almost:   lvmescape /dev/path   then they can append :4-10 on it
> 
> IMO, this is a good idea.  However, in the spirit of not getting too
> sidetracked, I think if we add proper explanation, we can probably defer
> adding the built-in command, which probably requires some design thought
> (for example, how to specify whether it is a pvname, vgname, etc - they
> may have different characters to escape, etc).  If you want to tackle
> that too though, go for it.
> 

Upon further thought, I agree with you Peter - let's reject the ":" in
pvcreate/vgcreate commands and print a message about pe range not
allowed in these commands.  This way the commands are all consistent -
require a "::" if any pvname contains a ":" in any of the commands.




More information about the lvm-devel mailing list