[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Libguestfs] [PATCH] inspect: correct osinfo ID for CentOS >= 8



On Tue, Dec 10, 2019 at 05:50:42PM +0100, Pino Toscano wrote:
> CentOS 8 is represented with a simpler "centos8" osinfo ID.
> ---
>  lib/inspect-osinfo.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/inspect-osinfo.c b/lib/inspect-osinfo.c
> index 90b7ffd86..ba07e4564 100644
> --- a/lib/inspect-osinfo.c
> +++ b/lib/inspect-osinfo.c
> @@ -40,7 +40,9 @@ guestfs_impl_inspect_get_osinfo (guestfs_h *g, const char *root)
>  
>    if (STREQ (type, "linux")) {
>      if (STREQ (distro, "centos")) {
> -      if (major >= 7)
> +      if (major >= 8)
> +        return safe_asprintf (g, "%s%d", distro, major);
> +      else if (major == 7)
>          return safe_asprintf (g, "%s%d.0", distro, major);
>        else if (major == 6)
>          return safe_asprintf (g, "%s%d.%d", distro, major, minor);

Obvious one, ACK, thanks.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-builder quickly builds VMs from scratch
http://libguestfs.org/virt-builder.1.html


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]