Bug 616753 - libguestfs will use the wrong augeas lens for /etc/modules.conf
libguestfs will use the wrong augeas lens for /etc/modules.conf
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libguestfs (Show other bugs)
6.0
All Linux
low Severity medium
: rc
: ---
Assigned To: Richard W.M. Jones
Virtualization Bugs
:
: 617087 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-07-21 06:43 EDT by Matthew Booth
Modified: 2010-11-10 16:03 EST (History)
4 users (show)

See Also:
Fixed In Version: libguestfs-1.2.7-1.21.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-11-10 16:03:11 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Matthew Booth 2010-07-21 06:43:43 EDT
Description of problem:
libguestfs uses the modprobe.conf lens to parse modules.conf. If a RHEL 3 guest contains modules.conf directive which are not valid in modprobe.conf, conversion will fail. This situation is quite common, for example if the guest has sound configured.

This impacts the ability of virt-v2v to convert RHEL 3 guests.

This has already been fixed upstream and the patch is included in RHEL 5. This looks like an oversight.

Version-Release number of selected component (if applicable):
libguestfs-1.2.7-1.18.el6.x86_64
Comment 1 Matthew Booth 2010-07-22 06:41:01 EDT
*** Bug 617087 has been marked as a duplicate of this bug. ***
Comment 2 Matthew Booth 2010-07-26 11:24:10 EDT
Fixed in libguestfs-1.2.7-1.21.el6
Comment 4 Jinxin Zheng 2010-07-29 01:25:23 EDT
Matt,

Can you provide a reproducer of this bug?

I tried the modules.conf file from bug 617087 with a RHEL 3 image, made some simple aug-* calls over the modules.conf, but couldn't see any difference with libguestfs-1.2.7-1.18.el6 and libguestfs-1.2.7-1.21.el6.
Comment 5 Mohua Li 2010-07-29 02:47:08 EDT
test on, 

libvirt-0.8.1-18.el6.x86_64
virt-v2v-0.6.1-2.el6.x86_64
libguestfs-1.2.7-1.21.el6.x86_64


the network driver is converted successfully on rhel3u9-hvm(32 bit & 64 bit), 

but sound card driver still not converted successfully, if we need to fixed the sound card driver issue on this bug?
Comment 6 Matthew Booth 2010-07-29 04:42:09 EDT
virt-inspector would probably be the best way to check it. Create a RHEL 3 guest and add a line to /etc/modules.conf which wouldn't be valid syntax in /etc/modprobe.conf, e.g.:

post-install serial /etc/init.d/setserial modload > /dev/null 2> /dev/null

Then run 'virt-inspector --perl' against the image and look for the list of module aliases. If it doesn't fail entirely, this will be empty without the patch. With the patch, it will work as expected.
Comment 7 Matthew Booth 2010-07-29 04:46:53 EDT
(In reply to comment #5)
> test on, 
> 
> libvirt-0.8.1-18.el6.x86_64
> virt-v2v-0.6.1-2.el6.x86_64
> libguestfs-1.2.7-1.21.el6.x86_64
> 
> 
> the network driver is converted successfully on rhel3u9-hvm(32 bit & 64 bit), 
> 
> but sound card driver still not converted successfully, if we need to fixed the
> sound card driver issue on this bug?    

The sound card is not related to this bug. There's a separate bug for that.
Comment 8 Jinxin Zheng 2010-07-29 22:37:24 EDT
(In reply to comment #6)
> virt-inspector would probably be the best way to check it. Create a RHEL 3
> guest and add a line to /etc/modules.conf which wouldn't be valid syntax in
> /etc/modprobe.conf, e.g.:
> 
> post-install serial /etc/init.d/setserial modload > /dev/null 2> /dev/null
> 
> Then run 'virt-inspector --perl' against the image and look for the list of
> module aliases. If it doesn't fail entirely, this will be empty without the
> patch. With the patch, it will work as expected.    

Yes, I tested with this modules.conf,

$ virt-cat rhel3u9-32b-hv-raw-amd.img /etc/modules.conf
alias eth0 8139cp
alias usb-controller usb-uhci
post-install serial /etc/init.d/setserial modload > /dev/null 2> /dev/null


with libguestfs-1.2.7-1.18, the 'modprobe_aliases' section of 'virt-inspector --perl' output is empty,

$ virt-inspector --perl rhel3u9-32b-hv-raw-amd.img | grep aliases
          'modprobe_aliases' => {},


after upgraded to libguestfs-1.2.7-1.21.el6, the output has changed to (I've reformatted the indentation for better web display),

$ virt-inspector --perl rhel3u9-32b-hv-raw-amd.img
...
'modprobe_aliases' => {
  'usb-controller' => {
    'file' => '/etc/modules.conf',
    'modulename' => 'usb-uhci',
    'augeas' => '/files/etc/modules.conf/alias[2]'
  },
  'eth0' => {
    'file' => '/etc/modules.conf',
    'modulename' => '8139cp',
    'augeas' => '/files/etc/modules.conf/alias[1]'
  }
},
...

So this package should be working as expected. Moving this bug to VERIFIED.
Comment 9 releng-rhel@redhat.com 2010-11-10 16:03:11 EST
Red Hat Enterprise Linux 6.0 is now available and should resolve
the problem described in this bug report. This report is therefore being closed
with a resolution of CURRENTRELEASE. You may reopen this bug report if the
solution does not work for you.

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