Skip to content

qemu-ga: add guest-get-osinfo command

Tomáš Golembiovský qemu-devel 5 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v8 Latest3 patches 0 repliesNew
  2. v73 patches 4 repliesSuperseded
  3. v63 patches 2 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v51 patch4 repliesSuperseded
v41 patch1 replySuperseded

Changes in v8 from the cover letter

- not tracking len in ga_parse_osrelease()
- replaced if(ret != TRUE) lines in ga_parse_osrelease()
- removed underscores from schema documentation
- renamed field 'machine-hardware' to 'machine' and clarified it's documentation for Windows
- fields kernel_version, kernel_release and machine are also optional
- added fixture_tear_down() in tests

Patches in v8 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3qemu-ga: add guest-get-osinfo commandqga/commands-posix.c qga/commands-win32.c qga/qapi-schema.json+387 -00 replies
2/3test-qga: pass environemnt to qemu-gatests/test-qga.c+4 -40 replies
3/3test-qga: add test for guest-get-osinfoqga/commands-posix.c tests/data/test-qga-os-release tests/test-qga.c+73 -30 replies

Reviews trailers per patch

2 of 3 patches have a Reviewed-by or Acked-by.

PatchMarc-André Lureau
1/3
2/3R-b
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v8 thread

Cover letter [Qemu-devel] [PATCH v8 0/3] qemu-ga: add guest-get-osinfo command

v8:
- not tracking len in ga_parse_osrelease()
- replaced if(ret != TRUE) lines in ga_parse_osrelease()
- removed underscores from schema documentation
- renamed field 'machine-hardware' to 'machine' and clarified it's documentation for Windows
- fields kernel_version, kernel_release and machine are also optional
- added fixture_tear_down() in tests

v7:
- fixed incorrect error check in ga_get_win_version()
- added missing test-qga-os-release
- fixed coding style issues

v6:
- fixed the documentation comment in schema
- disguising os-release as key-value file (thanks Marc-André)
- dropped dependency on gio
- improved error handling
- added test

v5:
- fixed build failure with older glib
- fixed coding style issues
- fixed one log string

This is a continuation of the work started by Vinzenz Feenstra in the threads:

https://lists.nongnu.org/archive/html/qemu-devel/2017-03/msg04154.html
https://lists.nongnu.org/archive/html/qemu-devel/2017-03/msg04302.html
https://lists.nongnu.org/archive/html/qemu-devel/2017-03/msg06262.html

The idea is to report some basic information from uname and from os-release file, if it is present. On MS Windows, where neither uname nor os-release exist we fill the values based on the information we can get from the OS.

The example output on Fedora is:

{

  "return": {
    "kernel-version": "#1 SMP Mon May 8 18:46:06 UTC 2017",
    "kernel-release": "4.10.15-200.fc25.x86_64",
    "machine-hardware": "x86_64",
    "id": "fedora",
    "name": "Fedora",
    "pretty-name": "Fedora 25 (Server Edition)",
    "version": "25 (Server Edition)",
    "variant": "Server Edition",
    "version-id": "25",
    "variant-id": "server"

}
}

The example output on MS Windows 10 is:

{

  "return": {
    "kernel-version": "10.0",
    "kernel-release": "10240",
    "machine-hardware": "x86_64",
    "id": "mswindows",
    "name": "Microsoft Windows",
    "pretty-name": "Windows 10 Enterprise",
    "version": "Microsoft Windows 10",
    "version-id": "10",
    "variant": "client",
    "variant-id": "client"

}
}

Tomas Golembiovsky

Tomáš Golembiovský (3):
qemu-ga: add guest-get-osinfo command
test-qga: pass environemnt to qemu-ga
test-qga: add test for guest-get-osinfo

 qga/commands-posix.c           | 141 +++++++++++++++++++++++++++++++
 qga/commands-win32.c           | 188 +++++++++++++++++++++++++++++++++++++++++
 qga/qapi-schema.json           |  65 ++++++++++++++
 tests/data/test-qga-os-release |   7 ++
 tests/test-qga.c               |  64 +++++++++++++-
 5 files changed, 461 insertions(+), 4 deletions(-)
 create mode 100644 tests/data/test-qga-os-release
Signature · 1 line
2.13.1