lib: Add osinfo information for Windows Server 2022 Datacenter

Windows Server 2022 preview is identified as <osinfo>win2k16</osinfo>.
Although current osinfo-db does not have an entry "win2k22", return
this instead.

osinfo-db issue to add win2k22:
https://gitlab.com/libosinfo/osinfo-db/-/issues/82

Inspection information for the guest:

    type: windows
    distro: windows
    product_name: Windows Server 2022 Datacenter
    product_variant: Server
    version: 10.0
    arch: x86_64

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1997446
Reported-by: Yongkui Guo
This commit is contained in:
Richard W.M. Jones
2021-08-25 11:03:20 +01:00
parent efb3d01992
commit 73cd0a0c8d

View File

@@ -132,7 +132,9 @@ guestfs_impl_inspect_get_osinfo (guestfs_h *g, const char *root)
switch (minor) {
case 0:
if (strstr (product_variant, "Server")) {
if (strstr (product_name, "2019"))
if (strstr (product_name, "2022"))
return safe_strdup (g, "win2k22");
else if (strstr (product_name, "2019"))
return safe_strdup (g, "win2k19");
else
return safe_strdup (g, "win2k16");