RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1997446 - osinfo is not correct when handling windows server 2022 image
Summary: osinfo is not correct when handling windows server 2022 image
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: libguestfs
Version: 9.0
Hardware: x86_64
OS: Unspecified
low
low
Target Milestone: rc
: ---
Assignee: Richard W.M. Jones
QA Contact: YongkuiGuo
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-08-25 09:23 UTC by YongkuiGuo
Modified: 2022-12-28 03:08 UTC (History)
3 users (show)

Fixed In Version: libguestfs-1.46.0-4.el9.x86_64
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-05-17 12:28:37 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-94738 0 None None None 2021-08-25 09:24:52 UTC
Red Hat Product Errata RHBA-2022:2317 0 None None None 2022-05-17 12:29:12 UTC

Description YongkuiGuo 2021-08-25 09:23:33 UTC
Description of problem:
When handling windows server 2022 image with virt-inspector, the osinfo displays win2k16 not win2k22.


Version-Release number of selected component (if applicable):
libguestfs-1.45.6-12.el9.x86_64


How reproducible:
100%


Steps:

1. 
# virt-inspector -a win2022-preview-x86_64.raw
<?xml version="1.0"?>
<operatingsystems>
  <operatingsystem>
    <root>/dev/sda2</root>
    <name>windows</name>
    <arch>x86_64</arch>
    <distro>windows</distro>
    <product_name>Windows Server 2022 Datacenter</product_name>
    <product_variant>Server</product_variant>
    <major_version>10</major_version>
    <minor_version>0</minor_version>
    <windows_systemroot>/Windows</windows_systemroot>
    <windows_current_control_set>ControlSet001</windows_current_control_set>
    <hostname>WIN-12SKMK6PLJ3</hostname>
    <osinfo>win2k16</osinfo>
    <mountpoints>
      <mountpoint dev="/dev/sda2">/</mountpoint>
    </mountpoints>
    <filesystems>
      <filesystem dev="/dev/sda2">
        <type>ntfs</type>
        <uuid>F2B2A84FB2A819DD</uuid>
      </filesystem>
    </filesystems>
    <drive_mappings>
      <drive_mapping name="C">/dev/sda2</drive_mapping>
    </drive_mappings>
    <applications>
      <application>
        <name>Microsoft Edge</name>
        <display_name>Microsoft Edge</display_name>
        <version>92.0.902.55</version>
        <install_path>C:\Program Files (x86)\Microsoft\Edge\Application</install_path>
        <publisher>Microsoft Corporation</publisher>
      </application>
      <application>
        <name>Microsoft Edge Update</name>
        <display_name>Microsoft Edge Update</display_name>
        <version>1.3.145.49</version>
      </application>
    </applications>
  </operatingsystem>
</operatingsystems>


Actual results:
As above

Expected results:
The osinfo displays win2k22.

Additional info:

Comment 1 Richard W.M. Jones 2021-08-25 09:41:30 UTC
Hi Yongkui, do you have the output from
virt-inspector -a win2022-preview-x86_64.raw -vx ?

Comment 3 YongkuiGuo 2021-08-25 09:55:26 UTC
(In reply to Richard W.M. Jones from comment #1)
> Hi Yongkui, do you have the output from
> virt-inspector -a win2022-preview-x86_64.raw -vx ?

Sorry, attached the whole log. Seems this issue is related to the following source code:

$ vi lib/inspect-osinfo.c
case 10:
  switch (minor) {
    case 0:
      if (strstr (product_variant, "Server")) {
          if (strstr (product_name, "2019"))
            return safe_strdup (g, "win2k19");
          else
            return safe_strdup (g, "win2k16");
      } else
        return safe_strdup (g, "win10");
    }
    break;
  }

Comment 4 Richard W.M. Jones 2021-08-25 10:11:01 UTC
There's actually no entry in osinfo-db yet for this OS.  I created
an issue over there:
https://gitlab.com/libosinfo/osinfo-db/-/issues/82

The upstream fix in libguestfs is:
https://github.com/libguestfs/libguestfs/commit/73cd0a0c8df6d55fa445b93d97f4a17da483768d

Comment 5 Richard W.M. Jones 2021-11-23 13:16:15 UTC
The fix for this is included in libguestfs >= 1.45.7, so it
is already fixed in RHEL 9.

Comment 8 YongkuiGuo 2021-11-24 11:26:59 UTC
Verified with package:
libguestfs-1.46.0-5.el9.x86_64

Steps:

1. On rhel9 host
# virt-inspector -a win2022-preview-x86_64.raw
<?xml version="1.0"?>
<operatingsystems>
  <operatingsystem>
    <root>/dev/sda2</root>
    <name>windows</name>
    <arch>x86_64</arch>
    <distro>windows</distro>
    <product_name>Windows Server 2022 Datacenter</product_name>
    <product_variant>Server</product_variant>
    <major_version>10</major_version>
    <minor_version>0</minor_version>
    <windows_systemroot>/Windows</windows_systemroot>
    <windows_current_control_set>ControlSet001</windows_current_control_set>
    <hostname>WIN-12SKMK6PLJ3</hostname>
    <osinfo>win2k22</osinfo>
    <mountpoints>
      <mountpoint dev="/dev/sda2">/</mountpoint>
    </mountpoints>
    <filesystems>
      <filesystem dev="/dev/sda2">
        <type>ntfs</type>
        <uuid>F2B2A84FB2A819DD</uuid>
      </filesystem>
    </filesystems>
    <drive_mappings>
      <drive_mapping name="C">/dev/sda2</drive_mapping>
    </drive_mappings>
    <applications>
      <application>
        <name>Microsoft Edge</name>
        <display_name>Microsoft Edge</display_name>
        <version>92.0.902.55</version>
        <install_path>C:\Program Files (x86)\Microsoft\Edge\Application</install_path>
        <publisher>Microsoft Corporation</publisher>
      </application>
      <application>
        <name>Microsoft Edge Update</name>
        <display_name>Microsoft Edge Update</display_name>
        <version>1.3.145.49</version>
      </application>
    </applications>
  </operatingsystem>
</operatingsystems>

The value of osinfo is correct.

Comment 10 errata-xmlrpc 2022-05-17 12:28:37 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (new packages: libguestfs), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:2317


Note You need to log in before you can comment on or make changes to this bug.