Bug 858126 - virt-inspector fail to work with some windows guests
virt-inspector fail to work with some windows guests
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libguestfs (Show other bugs)
6.4
Unspecified Unspecified
medium Severity high
: rc
: ---
Assigned To: Richard W.M. Jones
Virtualization Bugs
: Regression
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-17 23:13 EDT by Mohua Li
Modified: 2013-02-21 03:38 EST (History)
3 users (show)

See Also:
Fixed In Version: libguestfs-1.16.32-2.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-02-21 03:38:45 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
Old Perl virt-inspector.pl (26.73 KB, text/plain)
2012-09-28 03:38 EDT, Richard W.M. Jones
no flags Details

  None (edit)
Description Mohua Li 2012-09-17 23:13:15 EDT
Description of problem:
as we need to support both virt-inspector & virt-inspector2
 in RHEL 6, so here it's, only occur on Win2008,Win7,Vista,

[root@dhcp-93-131 xen]# virt-inspector Win7-32-hvm.raw
cat: open: /boot.ini: No such file or directory at /usr/lib64/perl5/vendor_=
perl/Sys/Guestfs/Lib.pm line 648.

[root@dhcp-93-131 xen]# virt-inspector2 Win7-32-hvm.raw
<?xml version=3D"1.0"?>
<operatingsystems>
  <operatingsystem>
    <root>/dev/sda1</root>
    <name>windows</name>
    <arch>i386</arch>
    <distro>windows</distro>
    <product_name>Windows 7 Ultimate</product_name>
    <product_variant>Client</product_variant>
    <major_version>6</major_version>
    <minor_version>1</minor_version>
    <windows_systemroot>/Windows</windows_systemroot>
    <windows_current_control_set>ControlSet001</windows_current_control_set>
    <hostname>REDHATQ-3EEUM3L</hostname>
    <format>installed</format>
    <mountpoints>
      <mountpoint dev=3D"/dev/sda1">/</mountpoint>
    </mountpoints>
    <filesystems>
      <filesystem dev=3D"/dev/sda1">
        <type>ntfs</type>
        <label>OS_Install</label>
        <uuid>642EE3852EE34E9C</uuid>
      </filesystem>
    </filesystems>
    <drive_mappings>
      <drive_mapping name=3D"C">/dev/sda1</drive_mapping>
    </drive_mappings>
    <applications>
      <application>
        <name>Red Hat Paravirtualized Xen Drivers for Windows(R)</name>
        <display_name>Red Hat Paravirtualized Xen Drivers for Windows(R) 1.
3.13</display_name>
        <version>1.3.13</version>
        <publisher>Red Hat, Inc.</publisher>
        <url>http://www.redhat.com</url>
      </application>
    </applications>
  </operatingsystem>
</operatingsystems>
                                                                           
                                                                           
                                                     

Version-Release number of selected component (if applicable):
libguestfs-1.16.30-2.el6
libguestfs-tools-1.16.30-2.el6.x86_64

How reproducible:
always

Steps to Reproduce:
1.,virt-inspector $winimg
2.
3.
  
Actual results:


Expected results:


Additional info:
this is a regression problem from 6.3 build ,no problem on libguestfs-1.16.19-1.el6
Comment 3 Richard W.M. Jones 2012-09-28 03:38:01 EDT
Created attachment 618473 [details]
Old Perl virt-inspector.pl

I can reproduce this upstream, using the old Perl
virt-inspector program (attached).

# ./virt-inspector.pl /dev/vg_pin/Win7x32
download: /boot.ini: No such file or directory at /usr/lib64/perl5/vendor_perl/Sys/Guestfs/Lib.pm line 648.
Comment 4 Richard W.M. Jones 2012-09-28 03:47:04 EDT
This is caused by upstream commit:
https://github.com/libguestfs/libguestfs/commit/973581780d8a006f336684fef6762801402d775d

This changed the (previously undefined) behaviour of this API:
http://libguestfs.org/guestfs.3.html#guestfs_case_sensitive_path
so that if the path doesn't exist, a filename is now returned
whereas before it would return an undefined value.

This breaks the following test in old Perl inspection code:

sub _check_windows_root
{
#...
    my $boot_ini = resolve_windows_path ($g, "/boot.ini");
    $r->{boot_ini} = $boot_ini;
#...
    if (defined $r->{boot_ini}) {    # <--- here
Comment 6 Richard W.M. Jones 2012-09-28 08:15:22 EDT
Second patch had a mistake, updated here:
https://www.redhat.com/archives/libguestfs/2012-September/msg00157.html
Comment 7 Richard W.M. Jones 2012-09-28 09:57:07 EDT
Upstream, the commits needed are:
5feec6b9af33b6d532e86cac353a69bc972aa970
8dc4ed535f01e2334f48e5f69931e76af8339705
Comment 8 Richard W.M. Jones 2012-09-28 10:10:54 EDT
(In reply to comment #7)
> Upstream, the commits needed are:

Ignore previous comment.  The correct commits are:
55b7c4df7895b8c22d737723d857a9a63db69926
9ea6e9701461e594033999150f930cc4fafec4d2
Comment 10 Mohua Li 2012-11-07 02:30:14 EST
libguestfs-1.16.32-2.el6.x86_64,



[root@station2 xen]# virt-inspector Win7-32-hvm.raw
windows i386 6.1 (Windows 7 Ultimate) on /dev/sda1:
  Mountpoints:
    /dev/sda1                      /
  Filesystems:
    /dev/sda1:
      type: ntfs
      content: windows-root
  Applications:
[root@station2 xen]# virt-inspector2 Win7-32-hvm.raw
<?xml version="1.0"?>
<operatingsystems>
  <operatingsystem>
    <root>/dev/sda1</root>
    <name>windows</name>
    <arch>i386</arch>
    <distro>windows</distro>
    <product_name>Windows 7 Ultimate</product_name>
    <product_variant>Client</product_variant>
    <major_version>6</major_version>
    <minor_version>1</minor_version>
    <windows_systemroot>/Windows</windows_systemroot>
    <windows_current_control_set>ControlSet001</windows_current_control_set>
    <hostname>REDHATQ-3EEUM3L</hostname>
    <format>installed</format>
    <mountpoints>
      <mountpoint dev="/dev/sda1">/</mountpoint>
    </mountpoints>
    <filesystems>
      <filesystem dev="/dev/sda1">
        <type>ntfs</type>
        <label>OS_Install</label>
        <uuid>642EE3852EE34E9C</uuid>
      </filesystem>
    </filesystems>
    <drive_mappings>
      <drive_mapping name="C">/dev/sda1</drive_mapping>
    </drive_mappings>
    <applications>
      <application>
        <name>Red Hat Paravirtualized Xen Drivers for Windows(R)</name>
        <display_name>Red Hat Paravirtualized Xen Drivers for Windows(R) 1.3.13</display_name>
        <version>1.3.13</version>
        <publisher>Red Hat, Inc.</publisher>
        <url>http://www.redhat.com</url>
      </application>
    </applications>
  </operatingsystem>
</operatingsystems>
Comment 12 errata-xmlrpc 2013-02-21 03:38:45 EST
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, and where to find the updated
files, follow the link below.

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

http://rhn.redhat.com/errata/RHBA-2013-0324.html

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