From 73cd0a0c8df6d55fa445b93d97f4a17da483768d Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 25 Aug 2021 11:03:20 +0100 Subject: [PATCH] lib: Add osinfo information for Windows Server 2022 Datacenter Windows Server 2022 preview is identified as win2k16. 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 --- lib/inspect-osinfo.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/inspect-osinfo.c b/lib/inspect-osinfo.c index d2272dfdd..db38d87f7 100644 --- a/lib/inspect-osinfo.c +++ b/lib/inspect-osinfo.c @@ -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");