Richard W.M. Jones
2016-Nov-01 14:06 UTC
Re: [Libguestfs] [PATCH] v2v: bootloaders: search grub config for all distributions
On Tue, Nov 01, 2016 at 03:10:51PM +0300, Pavel Butsykin wrote:> On 01.11.2016 13:11, Richard W.M. Jones wrote: > >On Thu, Oct 27, 2016 at 08:22:30PM +0300, Pavel Butsykin wrote: > >> match typ with > >> | Grub1 -> > >>- if config_file = "/boot/efi/EFI/redhat/grub.conf" then > >>- g#aug_transform "grub" "/boot/efi/EFI/redhat/grub.conf"; > >>- > >>+ (match inspect.i_firmware with > >>+ | I_BIOS -> () > >>+ | I_UEFI _ -> g#aug_transform "grub" config_file > >>+ ); > >> new bootloader_grub1 g inspect config_file > >> | Grub2 -> new bootloader_grub2 g config_file > > > >I don't think this part of the patch is correct. We need to use the > >Augeas transform only for a particular path which is missing from the > >Augeas lens. > > It is necessary for /EFI/redhat/, but no need for others?I believe so, because the Augeas grub lens has: (* View: filter *) let filter = incl "/boot/grub/grub.conf" . incl "/boot/grub/menu.lst" . incl "/etc/grub.conf" so it wouldn't normally be activated for a grub.conf found under any other path.> >What do you think of the attached version instead? It's smaller and > >more efficient (only makes 2 libguestfs API calls in the normal case)? > > Yeah, I agree. And in this version the code is easier to read :)The slow tests passed, so I'll push this version shortly. Thanks, Rich. -- 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
Reasonably Related Threads
- Re: [PATCH v6 1/1] v2v: bootloaders: search grub config for all distributions
- Re: [PATCH v6 1/1] v2v: bootloaders: search grub config for all distributions
- [PATCH v5 1/3] v2v: bootloaders: search grub config for all distributions
- Re: [PATCH v3] v2v: bootloaders: search grub config for all distributions
- [PATCH] v2v: bootloaders: search grub config for all distributions