[Libguestfs] [PATCH 2/3] v2v: linux: check also kernel config for modules

Tomáš Golembiovský tgolembi at redhat.com
Mon Oct 3 09:23:34 UTC 2016


On Mon, 3 Oct 2016 09:07:09 +0100
"Richard W.M. Jones" <rjones at redhat.com> wrote:

> Actually I have another comment about this patch ..
> 
> On Tue, Sep 27, 2016 at 05:58:11PM +0200, Pino Toscano wrote:
> > diff --git a/v2v/linux_kernels.ml b/v2v/linux_kernels.ml
> > index b292921..c197f78 100644
> > --- a/v2v/linux_kernels.ml
> > +++ b/v2v/linux_kernels.ml
> > @@ -53,6 +53,21 @@ let detect_kernels (g : G.guestfs) inspect family bootloader =
> >    (* What kernel/kernel-like packages are installed on the current guest? *)
> >    let installed_kernels : kernel_info list =
> >      let rex_ko = Str.regexp ".*\\.k?o\\(\\.xz\\)?$" in
> > +    let check_config version feature =
> > +      let prefix = "^CONFIG_" ^ String.uppercase_ascii feature ^ "=" in
> > +      let lines = g#grep ~extended:true prefix ("/boot/config-" ^ version) in  
> 
> This could fail if the config file doesn't exist or has an
> unexpected name.
> 
> I don't think we should fail in that case.
> 
> I think what we should do is put the config file name in the
> Linux_kernels.kernel_info struct, eg:
> 
>   ki_config_file : string option;
> 
> where None would be "not found".
> 
> The check_config function can then short-circuit when ki_config_file == None.
> 
> Rich.

Good point. I missed that one.

    Tomas


-- 
Tomáš Golembiovský <tgolembi at redhat.com>




More information about the Libguestfs mailing list