qemu-devel
[Top][All Lists]
Advanced

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

Re: Guest Agent issue with 'guest-get-osinfo' command on Windows


From: Richard W.M. Jones
Subject: Re: Guest Agent issue with 'guest-get-osinfo' command on Windows
Date: Mon, 6 Sep 2021 16:59:21 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

On Mon, Sep 06, 2021 at 06:45:08PM +0300, Konstantin Kostiuk wrote:
> Hi All,
> 
> I reviewed glib, libguestfs, and libosinfo tools. All tools read the registry
> to get information about Windows but read different registry values. All
> information is returned in a localized form.
> Related key: HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion
> We can get 'pretty-name' from 'ProductName' value (all tools use it).
> About 'version' there is three variant:
> 1. Set 'version' equals to 'kernel-version'. libguestfs and libosinfo have 
> this
> behavior.
> 2. Read 'version' from 'ReleaseId' value. glib has this behavior. In the case
> of Windows Server 2022, 'ReleaseId' equals 2009.
> 3. Read 'version' from 'DisplayVersion' value. In the case of Windows Server
> 2022, 'DisplayVersion' equals 21H2.

The important point is, however you get it, return the information as
a libosinfo short value ("win2k22" in this case).

> What do you think about this solution instead of using a conversion matrix?
> What version we should use in this case?

If you need to cover old and new versions of Windows then there's no
good way.  You just need lots of conditionals and to constantly evolve
the code as new versions come out.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
Fedora Windows cross-compiler. Compile Windows programs, test, and
build Windows installers. Over 100 libraries supported.
http://fedoraproject.org/wiki/MinGW




reply via email to

[Prev in Thread] Current Thread [Next in Thread]