Tomáš Golembiovský
2016-Aug-06 18:04 UTC
[Libguestfs] [PATCH] v2v: fix regex replacement in grub2_update_console
The replacement string was wrong. There are only two match groups in the regular expression, not three. Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com> --- v2v/convert_linux.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/v2v/convert_linux.ml b/v2v/convert_linux.ml index 06943cd..4b1ce99 100644 --- a/v2v/convert_linux.ml +++ b/v2v/convert_linux.ml @@ -1057,9 +1057,9 @@ let rec convert ~keep_serial_console (g : G.guestfs) inspect source rcaps if Str.string_match rex grub_cmdline 0 then ( let new_grub_cmdline if not remove then - Str.global_replace rex "\\1console=ttyS0\\3" grub_cmdline + Str.global_replace rex "\\1console=ttyS0\\2" grub_cmdline else - Str.global_replace rex "\\1\\3" grub_cmdline in + Str.global_replace rex "\\1\\2" grub_cmdline in g#aug_set path new_grub_cmdline; g#aug_save (); -- 2.9.2
Pino Toscano
2016-Aug-08 09:03 UTC
Re: [Libguestfs] [PATCH] v2v: fix regex replacement in grub2_update_console
On Saturday, 6 August 2016 20:04:53 CEST Tomáš Golembiovský wrote:> The replacement string was wrong. There are only two match groups in the > regular expression, not three. > > Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com> > ---LGTM, pushed. Thanks, -- Pino Toscano
Maybe Matching Threads
- [PATCH] v2v: factor out bootloader handling
- Re: [PATCH v2] v2v: factor out bootloader handling
- [PATCH v2] v2v: factor out bootloader handling
- [PATCH v2] v2v: factor out bootloader handling
- [PATCH] v2v: linux: correctly update resume=/dev/device entries (RHBZ#1532224)