This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours
Bug 801117 - libguestfs cannot get icon for Windows 8
libguestfs cannot get icon for Windows 8
Status: CLOSED UPSTREAM
Product: Virtualization Tools
Classification: Community
Component: libguestfs (Show other bugs)
unspecified
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Richard W.M. Jones
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-07 12:34 EST by Richard W.M. Jones
Modified: 2012-12-01 06:11 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-12-01 06:11:38 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Richard W.M. Jones 2012-03-07 12:34:39 EST
Description of problem:

libguestfs inspection currently has a hard-coded test for
Windows 7:

  /* Windows 7. */
  else if (fs->major_version == 6 && fs->minor_version == 1)
    fn = icon_windows_7;

As a result, no icon is returned for Windows 8 (major=6,minor=2).

I tried modifying the test, but the Windows 7 icon code doesn't
work for Windows 8.  The error is:

wrestool: /home/rjones/d/libguestfs/libguestfskHTDWe/1-explorer: file contains no resources
pamcut: Error reading magic number from Netpbm image stream.  Most often, this means your input file is empty.
pnmtopng: Error reading magic number from Netpbm image stream.  Most often, this means your input file is empty.

It looks like we need a new icon function to handle Windows 8.

Version-Release number of selected component (if applicable):

1.17.11.

How reproducible:

100%

Steps to Reproduce:
1. Install Windows 8 preview as a guest.
2. Try to display the icon, eg. using the 'display_icon' example program.
3.
  
Actual results:

Fails to display an icon for Windows 8.

Expected results:

It should be able to display an icon for Windows 8.

Additional info:
Comment 1 Richard W.M. Jones 2012-11-30 17:07:57 EST
Not unsurprisingly, libguestfs 1.19.65 also cannot get
an icon for Windows 8 (full release).

$ ./run ./inspector/virt-inspector /tmp/win8x32.img
<?xml version="1.0"?>
<operatingsystems>
  <operatingsystem>
    <root>/dev/sda2</root>
    <name>windows</name>
    <arch>i386</arch>
    <distro>windows</distro>
    <product_name>Windows 8 Enterprise</product_name>
    <product_variant>Client</product_variant>
    <major_version>6</major_version>
    <minor_version>2</minor_version>
    <windows_systemroot>/Windows</windows_systemroot>
    <windows_current_control_set>ControlSet001</windows_current_control_set>
    <hostname>win8x32</hostname>
    <format>installed</format>
    <mountpoints>
      <mountpoint dev="/dev/sda2">/</mountpoint>
    </mountpoints>
    <filesystems>
      <filesystem dev="/dev/sda2">
        <type>ntfs</type>
        <uuid>4EC00F45C00F32AF</uuid>
      </filesystem>
    </filesystems>
    <drive_mappings>
      <drive_mapping name="C">/dev/sda2</drive_mapping>
    </drive_mappings>
    <applications/>
  </operatingsystem>
</operatingsystems>
Comment 2 Richard W.M. Jones 2012-11-30 18:24:27 EST
I added this temporary patch:

commit 160977987f8e3922cebcdaaeb36fa69f92dc7587 (HEAD, master)
Author: Richard W.M. Jones <rjones@redhat.com>
Date:   Fri Nov 30 23:00:33 2012 +0000

    inspection: Temporary logo for Windows 8.
    
    See the comment from the code:
    
      NB about Windows 8: No location we've found so far contains a
      suitable icon for Win8.  In particular, explorer.exe definitely
      does *not* contain any Windows logo as a resource (I checked).
      Therefore the "basket icon" that this produces is just a stand-in
      until we have a better idea for solving this problem.
Comment 3 Richard W.M. Jones 2012-12-01 06:11:38 EST
Final fix is upstream:
https://github.com/libguestfs/libguestfs/commit/3d59ed5458575e417e704db58ede43a4e386014d

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