Bug 801117 - libguestfs cannot get icon for Windows 8
libguestfs cannot get icon for Windows 8
Product: Virtualization Tools
Classification: Community
Component: libguestfs (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Richard W.M. Jones
Depends On:
  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:
Last Closed: 2012-12-01 06:11:38 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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):


How reproducible:


Steps to Reproduce:
1. Install Windows 8 preview as a guest.
2. Try to display the icon, eg. using the 'display_icon' example program.
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"?>
    <product_name>Windows 8 Enterprise</product_name>
      <mountpoint dev="/dev/sda2">/</mountpoint>
      <filesystem dev="/dev/sda2">
      <drive_mapping name="C">/dev/sda2</drive_mapping>
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:

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