[Libguestfs] [PATCH] v2v: linux: improve regex for resume= entries (RHBZ#1651987)

Richard W.M. Jones rjones at redhat.com
Wed Dec 5 12:01:40 UTC 2018


On Wed, Dec 05, 2018 at 12:57:19PM +0100, Pino Toscano wrote:
> Add few more characters for the devices of resume= entries in the
> command line of grub: this way it is possible to match also /dev/mapper
> devices.
> 
> This should require no further processing, since the names of the
> /dev/mapper devices do not change after the conversion.

Yes this is what worried me, but I think you're right.

Therefore, ACK.

Rich.

>  v2v/convert_linux.ml | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/v2v/convert_linux.ml b/v2v/convert_linux.ml
> index be4905473..945c3aa32 100644
> --- a/v2v/convert_linux.ml
> +++ b/v2v/convert_linux.ml
> @@ -1004,7 +1004,7 @@ let convert (g : G.guestfs) inspect source output rcaps =
>        List.flatten (List.map Array.to_list (List.map g#aug_match paths)) in
>  
>      (* Map device names for each entry. *)
> -    let rex_resume = PCRE.compile "^resume=(/dev/[a-z\\d]+)(.*)$"
> +    let rex_resume = PCRE.compile "^resume=(/dev/[-a-z\\d/_]+)(.*)$"
>      and rex_device_cciss = PCRE.compile "^/dev/(cciss/c\\d+d\\d+)(?:p(\\d+))?$"
>      and rex_device = PCRE.compile "^/dev/([a-z]+)(\\d*)?$" in
>  
> -- 
> 2.17.2
> 
> _______________________________________________
> Libguestfs mailing list
> Libguestfs at redhat.com
> https://www.redhat.com/mailman/listinfo/libguestfs

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://people.redhat.com/~rjones/virt-top




More information about the Libguestfs mailing list