[libvirt] [PATCH] Fix logical storage pool operation on SLES10-SP2

The attached patch adjusts for a difference in behavior in the LVM utilities 'lvs' and 'vgs'. The SLES10-SP2 versions of these (and presumably others) append a trailing separator. This patch simply adjusts the regexps to allow (but not require) this. I thought just adding the ":?" to the regexps would do this, but this was leaving the trailing separator in the last group match, so I ended up tweaking the preceding group pattern as well. Dave

On Mon, Jul 28, 2008 at 03:35:30PM -0400, David Lively wrote:
The attached patch adjusts for a difference in behavior in the LVM utilities 'lvs' and 'vgs'. The SLES10-SP2 versions of these (and presumably others) append a trailing separator. This patch simply adjusts the regexps to allow (but not require) this.
I thought just adding the ":?" to the regexps would do this, but this was leaving the trailing separator in the last group match, so I ended up tweaking the preceding group pattern as well.
Yeah, the \S+ is a greedy match, so it'd consume the ':' first. I don't know if POSIX expressions have a non-greedy match modifir like Perl does. That would let you do (\\S+?):? But in any case, your suggested modification is fine, so ACK. BTW, what version of the LVM tools is SLES using - its probably useful to note that in the comment you added, in case the same problem is particular to a version, rather than just SLES Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

On Tue, 2008-07-29 at 09:44 +0100, Daniel P. Berrange wrote:
BTW, what version of the LVM tools is SLES using - its probably useful to note that in the comment you added, in case the same problem is particular to a version, rather than just SLES
lvm2 2.02.17 (-7.19, x86_64) But it's hard to know (without reading the ChangeLog in detail) how much backporting is hidden in the distro-specific part of the version (-7.19) ... Dave

On Mon, Jul 28, 2008 at 03:35:30PM -0400, David Lively wrote:
The attached patch adjusts for a difference in behavior in the LVM utilities 'lvs' and 'vgs'. The SLES10-SP2 versions of these (and presumably others) append a trailing separator. This patch simply adjusts the regexps to allow (but not require) this.
I thought just adding the ":?" to the regexps would do this, but this was leaving the trailing separator in the last group match, so I ended up tweaking the preceding group pattern as well.
Okay, looks simple and well contained. Applied and commited, thanks ! Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
participants (3)
-
Daniel P. Berrange
-
Daniel Veillard
-
David Lively