Bug 1176493

Summary: virt-v2v ignores sound device when convert xen guest to local kvm
Product: Red Hat Enterprise Linux 7 Reporter: zhoujunqin <juzhou>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1CC: dyuan, mbooth, mzhan, ptoscano, tzheng
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: V2V
Fixed In Version: libguestfs-1.28.1-1.29.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-19 06:58:35 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
detail debug log none

Description zhoujunqin 2014-12-22 06:31:56 UTC
Created attachment 971889 [details]
detail debug log

Description of problem:
virt-v2v ignores sound device when convert xen guest to local kvm

Version-Release number of selected component (if applicable):
libguestfs-1.28.1-1.18.el7.x86_64
virt-v2v-1.28.1-1.18.el7.x86_64
libvirt-1.2.8-11.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Prepare a xen guest with sound device.

e.g. # virsh dumpxml xen-fv-rhel7.0-x86_64
there should be  some code like this

...
    <sound model='es1370'/>
...

or you can add a sound card by virt-manager add Hareware.

2. Use virt-v2v convert this guest to local kvm.

# virt-v2v -ic xen+ssh://10.66.106.64 xen-fv-rhel7.0-x86_64 -of raw -on xen-fv-rhel7.0-x86_64-sound-es1370
[   0.0] Opening the source -i libvirt -ic xen+ssh://10.66.106.64 xen-fv-rhel7.0-x86_64
[   0.0] Creating an overlay to protect the source from being modified
[   0.0] Opening the overlay
[   3.0] Initializing the target -o libvirt -os default
[   3.0] Inspecting the overlay
[  13.0] Checking for sufficient free disk space in the guest
[  13.0] Estimating space required on target for each disk
[  13.0] Converting Red Hat Enterprise Linux Server release 7.0 (Maipo) to run on KVM
virt-v2v: This guest has virtio drivers installed.
[  52.0] Mapping filesystem data to avoid copying unused and blank areas
[  54.0] Closing the overlay
[  54.0] Copying disk 1/1 to /var/lib/libvirt/images/xen-fv-rhel7.0-x86_64-sound-es1370-sda (raw)
    (100.00/100%)
[ 185.0] Creating output metadata
Pool default refreshed

Domain xen-fv-rhel7.0-x86_64-sound-es1370 defined from /tmp/v2vlibvirtfaa5b7.xml

[ 185.0] Finishing off

3. Repeat step1 & step2 with other type sound device: pcspk/sb16

Actual results:
Conversion finished successfully and guest can be seen via virt-manager, but inspecting the guest HW details the sound card is missing.

Expected results:
1. Sound device can be seen via virt-manager after conversion.
2. If sound device is not supported by rhel7, there should be some information showing.

Additional info:
1. I will attach detail debug log.
2. Sound device type supported on rhel7: ich6/ac97/ich9

Comment 1 Richard W.M. Jones 2014-12-22 08:40:52 UTC
I just checked old virt-v2v, and it didn't transfer sound devices either.

There is an open question about what devices we should copy over --
perhaps we should copy every 'unknown' device.  Although for sound
devices that wouldn't work since we likely do need to convert them
for the new hypervisor.

Anyway this is RHEL 7.2 material.

Comment 2 Richard W.M. Jones 2015-04-20 20:28:23 UTC
Patch posted:
https://www.redhat.com/archives/libguestfs/2015-April/msg00076.html

Comment 3 Richard W.M. Jones 2015-04-22 15:09:51 UTC
Upstream:
https://github.com/libguestfs/libguestfs/commit/3834a1064f866eef4c34440e6dd5023cc47ff7e1
https://github.com/libguestfs/libguestfs/commit/2b0c6e8565977c3a53e3a834f3518cce2128aaec

For RHEL we will also need a RHEL-specific patch to
remove certain devices from the list in v2v/utils.ml
function 'qemu_supports_sound_card'.

The function in RHEL 7 will need to end up like this:

let qemu_supports_sound_card = function
  | AC97
  | ICH6
  | ICH9
  | PCSpeaker
    -> true
  | ES1370
  | SB16
  | USBAudio
    -> false

Comment 5 zhoujunqin 2015-06-26 09:59:15 UTC
I can reproduce this issue with package:
libvirt-1.2.16-1.el7.x86_64
libguestfs-1.28.1-1.38.el7.x86_64
virt-v2v-1.28.1-1.38.el7.x86_64

Then try to verify this issue with new build:
libvirt-1.2.16-1.el7.x86_64
libguestfs-1.28.1-1.40.el7.x86_64
virt-v2v-1.28.1-1.40.el7.x86_64

Scenario1:     <sound model='es1370'/>
1.
# virt-v2v -ic xen+ssh://10.66.106.64 xen-fv-rhel7.0-x86_64 -of raw -on xen-fv-rhel7.0-x86_64-sound-es1370
[   0.0] Opening the source -i libvirt -ic xen+ssh://10.66.106.64 xen-fv-rhel7.0-x86_64
[   0.0] Creating an overlay to protect the source from being modified
[   1.0] Opening the overlay
[ 127.0] Initializing the target -o libvirt -os default
[ 127.0] Inspecting the overlay
[ 137.0] Checking for sufficient free disk space in the guest
[ 137.0] Estimating space required on target for each disk
[ 137.0] Converting Red Hat Enterprise Linux Server release 7.0 (Maipo) to run on KVM
virt-v2v: This guest has virtio drivers installed.
[ 184.0] Mapping filesystem data to avoid copying unused and blank areas
[ 186.0] Closing the overlay
[ 186.0] Copying disk 1/1 to /var/lib/libvirt/images/xen-fv-rhel7.0-x86_64-sound-es1370-sda (raw)
    (100.00/100%)
[ 308.0] Creating output metadata
Pool default refreshed

Domain xen-fv-rhel7.0-x86_64-sound-es1370 defined from /tmp/v2vlibvirt80e0c6.xml

[ 310.0] Finishing off

Result1: After conversion, there is no sound device in guest configuration.

# virsh dumpxml xen-fv-rhel7.0-x86_64-sound-es1370  |grep sound
  <name>xen-fv-rhel7.0-x86_64-sound-es1370</name>
      <source pool='default' volume='xen-fv-rhel7.0-x86_64-sound-es1370-sda'/>

Result2: when set <sound model='sb16'/>, get same result.


Scenario2:     <sound model='pcspk'/>
1.
# virt-v2v -ic xen+ssh://10.66.106.64 xen-fv-rhel7.0-x86_64 -of raw -on xen-fv-rhel7.0-x86_64-sound-pcspk
[   0.0] Opening the source -i libvirt -ic xen+ssh://10.66.106.64 xen-fv-rhel7.0-x86_64
[   1.0] Creating an overlay to protect the source from being modified
[   1.0] Opening the overlay
[   4.0] Initializing the target -o libvirt -os default
[   4.0] Inspecting the overlay
[  15.0] Checking for sufficient free disk space in the guest
[  15.0] Estimating space required on target for each disk
[  15.0] Converting Red Hat Enterprise Linux Server release 7.0 (Maipo) to run on KVM
virt-v2v: This guest has virtio drivers installed.
[  60.0] Mapping filesystem data to avoid copying unused and blank areas
[  62.0] Closing the overlay
[  62.0] Copying disk 1/1 to /var/lib/libvirt/images/xen-fv-rhel7.0-x86_64-sound-pcspk-sda (raw)
    (100.00/100%)
[ 181.0] Creating output metadata
Pool default refreshed

Domain xen-fv-rhel7.0-x86_64-sound-pcspk defined from /tmp/v2vlibvirtca8206.xml

[ 181.0] Finishing off

Result: After conversion, we can found sound device in guest co

# virsh dumpxml xen-fv-rhel7.0-x86_64-sound-pcspk |grep sound
  <name>xen-fv-rhel7.0-x86_64-sound-pcspk</name>
      <source pool='default' volume='xen-fv-rhel7.0-x86_64-sound-pcspk-sda'/>
    <sound model='pcspk'/>

Since above 2 scenarios testing result is consistent with Comments 3 said, move this bug from ON_QA to VERIFIED.

Comment 7 errata-xmlrpc 2015-11-19 06:58:35 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, 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://rhn.redhat.com/errata/RHBA-2015-2183.html