[Libguestfs] [PATCH] inspect: try to use /etc/os-release on Linux guests
Pino Toscano
ptoscano at redhat.com
Wed Sep 9 14:12:44 UTC 2015
On Wednesday 09 September 2015 16:06:43 Olaf Hering wrote:
> On Wed, Sep 09, Pino Toscano wrote:
>
> > - the content of /etc/SuSE-release
>
> SUSE Linux Enterprise Server 12 (x86_64)
> VERSION = 12
> PATCHLEVEL = 0
> # This file is deprecated and will be removed in a future service pack or release.
> # Please check /etc/os-release for details about this release.
>
> > - the XML outout of `virt-inspector -a $img`
>
> <operatingsystems>
> <operatingsystem>
> <root>/dev/sda3</root>
> <name>linux</name>
> <arch>x86_64</arch>
> <distro>sles</distro>
> <product_name>SUSE Linux Enterprise Server 12 (x86_64)</product_name>
> <major_version>12</major_version>
> <minor_version>0</minor_version>
> [...]
Sounds like I can add
+ else if (VALUE_IS ("sles"))
+ distro = OS_DISTRO_SLES;
to my patch then, thanks!
Just note that, in case it was not noticeable from the patch, that if
we cannot get all the information from os-release (like on SLES without
the check for ID=sles), the current detection methods are tried.
This is not "os-release or nothing".
--
Pino Toscano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20150909/0e050018/attachment.sig>
More information about the Libguestfs
mailing list