mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-22 07:03:38 +00:00
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>
This commit is contained in:
committed by
Pino Toscano
parent
56e5cf14e9
commit
4ddc0add85
@@ -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 ();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user