From: "Richard W.M. Jones" <rjones@redhat.com>
To: Konstantin Kostiuk <konstantin@daynix.com>
Cc: "Vladimir Sementsov-Ogievskiy" <vsementsov@virtuozzo.com>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Michael Roth" <michael.roth@amd.com>,
Developers <qemu-devel@nongnu.org>,
"Yuri Benditovich" <yuri.benditovich@daynix.com>,
"Tomas Golembiovsky" <tgolembi@redhat.com>,
"Marc-André Lureau" <marcandre.lureau@gmail.com>,
"Yan Vugenfirer" <yan@daynix.com>
Subject: Re: Guest Agent issue with 'guest-get-osinfo' command on Windows
Date: Mon, 6 Sep 2021 16:59:21 +0100 [thread overview]
Message-ID: <20210906155921.GU26415@redhat.com> (raw)
In-Reply-To: <CAJ28CFQKbmbPk-+X882zraNp+ToT+BKJC5hV-c+i1Fe2VzTWaA@mail.gmail.com>
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
next prev parent reply other threads:[~2021-09-06 16:02 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-02 12:36 Guest Agent issue with 'guest-get-osinfo' command on Windows Konstantin Kostiuk
2021-09-02 13:11 ` Philippe Mathieu-Daudé
2021-09-02 13:15 ` Philippe Mathieu-Daudé
2021-09-02 13:24 ` Marc-André Lureau
2021-09-02 13:36 ` Daniel P. Berrangé
2021-09-02 13:55 ` Richard W.M. Jones
2021-09-02 14:12 ` Konstantin Kostiuk
2021-09-02 14:54 ` Marc-André Lureau
2021-09-06 15:45 ` Konstantin Kostiuk
2021-09-06 15:59 ` Richard W.M. Jones [this message]
2021-09-06 16:30 ` Konstantin Kostiuk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210906155921.GU26415@redhat.com \
--to=rjones@redhat.com \
--cc=berrange@redhat.com \
--cc=konstantin@daynix.com \
--cc=marcandre.lureau@gmail.com \
--cc=michael.roth@amd.com \
--cc=qemu-devel@nongnu.org \
--cc=tgolembi@redhat.com \
--cc=vsementsov@virtuozzo.com \
--cc=yan@daynix.com \
--cc=yuri.benditovich@daynix.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).