[Libguestfs] [PATCH v12 09/11] daemon: Implement inspection of Linux and other Unix-like operating systems.

Pino Toscano ptoscano at redhat.com
Tue Sep 19 14:31:37 UTC 2017


On Wednesday, 9 August 2017 19:23:44 CEST Richard W.M. Jones wrote:
> +(* When this function is called, the filesystem is mounted on sysroot (). *)
> +and check_filesystem mountable =
> +  let role = ref `Other in
> +  (* The following struct is mutated in place by callees.  However we
> +   * need to make a copy of the object here so we don't mutate the
> +   * null_inspection_data struct!
> +   *)
> +  let data = null_inspection_data () in
> +
> +  let debug_matching what =
> +    if verbose () then
> +      eprintf "check_filesystem: %s matched %s\n%!"
> +              (Mountable.to_string mountable) what
> +  in

At this point, shouldn't be there the caching of the existance of
/bin, /etc, /share?  Even if this does not involve daemon calls
anymore, still IMHO is a small save (few stat fork/calls less).

> +  | Some DISTRO_REDHAT_BASED
> +  | Some DISTRO_RHEL
> +  | Some DISTRO_CENTOS
> +  | Some DISTRO_SCIENTIFIC_LINUX
> +  | Some DISTRO_ORACLE_LINUX ->
> +     if major >= 8 then
> +       Some PACKAGE_MANAGEMENT_DNF

Not yet...

-- 
Pino Toscano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20170919/b8295577/attachment.sig>


More information about the Libguestfs mailing list