Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1472719

Summary: [RFE]Add warning in process of v2v converting guest which has pci passthrough device
Product: Red Hat Enterprise Linux 7 Reporter: mxie <mxie>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact: Jiri Herrmann <jherrman>
Priority: medium    
Version: 7.4CC: jherrman, juzhou, kuwei, mtessun, mzhan, ptoscano, tzheng, xiaodwan
Target Milestone: rcKeywords: FutureFeature
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: V2V
Fixed In Version: libguestfs-1.36.6-1.el7 Doc Type: Bug Fix
Doc Text:
*virt-v2v* now warns about not converting PCI passthrough devices The *virt-v2v* utility currently cannot convert PCI passthrough devices and thus ignores them in the conversion process. Prior to this update, however, attempting to convert a guest virtual machine with a PCI passthrough device successfully converted the guest, but did not provide any warning about the ignored PCI passthrough device. Now, converting such a guest logs an appropriate warning message during the conversion.
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-10 09:18:10 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:
Bug Depends On: 1472272    
Bug Blocks: 1477852    
Attachments:
Description Flags
virt-v2v-pci-passthrough.log none

Description mxie@redhat.com 2017-07-19 08:57:04 UTC
Created attachment 1300927 [details]
virt-v2v-pci-passthrough.log

Description of problem:
[RFE]Add warning in process of v2v converting guest which has pci passthrough device

Version-Release number of selected component (if applicable):
virt-v2v-1.36.3-6.el7_4.2.x86_64
libguestfs-1.36.3-6.el7_4.2.x86_64

How reproducible:
100%

Steps to Reproduce:

1.Prepare a xen guest which has added physical pci device
]# virsh -c xen+ssh://root.3.21
Welcome to virsh, the virtualization interactive terminal.

Type:  'help' for help with commands
       'quit' to quit
virsh # dumpxml Auto-rhel7.2-display
<domain type='xen'>
  <name>Auto-rhel7.2-display</name>
  ....
  ....
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <source>
        <address domain='0x0000' bus='0x02' slot='0x00' function='0x1'/>
      </source>
    </hostdev>
  </devices>
</domain>
2.Use virt-v2v convert this guest to libvirt but there is no warning during conversion(actually,physical pci device will not be existed after v2v conversion )
# virt-v2v -ic xen+ssh://root.3.21 Auto-rhel7.2-display -of qcow2
[   0.0] Opening the source -i libvirt -ic xen+ssh://root.3.21 Auto-rhel7.2-display
[   0.5] Creating an overlay to protect the source from being modified
[   1.3] Initializing the target -o libvirt -os default
[   1.3] Opening the overlay
[   6.5] Inspecting the overlay
[  26.0] Checking for sufficient free disk space in the guest
[  26.0] Estimating space required on target for each disk
[  26.0] Converting Red Hat Enterprise Linux Server 7.2 (Maipo) to run on KVM
virt-v2v: This guest has virtio drivers installed.
[ 177.3] Mapping filesystem data to avoid copying unused and blank areas
[ 177.7] Closing the overlay
[ 180.8] Checking if the guest needs BIOS or UEFI to boot
[ 180.8] Assigning disks to buses
[ 180.8] Copying disk 1/1 to /var/lib/libvirt/images/Auto-rhel7.2-display-sda (qcow2)
    (100.00/100%)
[ 865.9] Creating output metadata
Pool default refreshed

Domain Auto-rhel7.2-display defined from /tmp/v2vlibvirt03322f.xml

[ 866.6] Finishing off


Actula results:
As above description

Expected results:
Add warning in process of v2v converting guest which has pci passthrough device,such as "virt-v2v: warning: pci passthrough device will be ignored "


Additional info:

Comment 2 Pino Toscano 2017-08-30 11:08:34 UTC
Easy patch sent:
https://www.redhat.com/archives/libguestfs/2017-August/msg00141.html

Comment 3 Pino Toscano 2017-08-30 12:13:10 UTC
Fixed upstream with
https://github.com/libguestfs/libguestfs/commit/57d89157911a9d0f6d3da5396c59daecd2d76973
which is in libguestfs >= 1.37.22.

Comment 5 kuwei@redhat.com 2017-09-21 10:37:45 UTC
Verify the bug with below builds:
virt-v2v-1.36.6-1.el7.x86_64
libguestfs-1.36.6-1.el7.x86_64
libvirt-3.7.0-2.el7.x86_64
qemu-kvm-rhev-2.9.0-16.el7_4.8.x86_64


Steps:
Scenario 1:
1.Prepare a xen guest which has added physical pci device
# virsh -c xen+ssh://root.3.21
Welcome to virsh, the virtualization interactive terminal.

Type:  'help' for help with commands
       'quit' to quit
virsh # dumpxml Auto-rhel7.2-display
<domain type='xen'>
  <name>Auto-rhel7.2-display</name>
  ....
  ....
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <source>
        <address domain='0x0000' bus='0x02' slot='0x00' function='0x1'/>
      </source>
    </hostdev>
  </devices>
</domain>
2.Use virt-v2v convert this guest to libvirt,we can see the warning info below.
#  virt-v2v -ic xen+ssh://root.3.21 Auto-rhel7.2-display -of qcow2
[   0.0] Opening the source -i libvirt -ic xen+ssh://root.3.21 Auto-rhel7.2-display
virt-v2v: warning: this guest has a passthrough host device which will be 
ignored
[   0.5] Creating an overlay to protect the source from being modified
[   0.9] Initializing the target -o libvirt -os default
[   1.0] Opening the overlay
[   3.3] Inspecting the overlay
[  21.2] Checking for sufficient free disk space in the guest
[  21.2] Estimating space required on target for each disk
[  21.2] Converting Red Hat Enterprise Linux Server 7.2 (Maipo) to run on KVM
virt-v2v: This guest has virtio drivers installed.
[ 143.4] Mapping filesystem data to avoid copying unused and blank areas
[ 143.8] Closing the overlay
[ 143.9] Checking if the guest needs BIOS or UEFI to boot
[ 143.9] Assigning disks to buses
[ 143.9] Copying disk 1/1 to /var/lib/libvirt/images/Auto-rhel7.2-display-sda (qcow2)
    (100.00/100%)
[ 385.2] Creating output metadata
Pool default refreshed

Domain Auto-rhel7.2-display defined from /tmp/v2vlibvirt1c13cf.xml

[ 385.3] Finishing off
3.After conversion, boot the guest all checkpoints passed.

Scenario 2:
1.Prepare a  libvirt guest which has added physical pci device
<domain type='kvm'>
  <name>rhel6.7-pci-passthrough</name>
  <uuid>ab776fee-978d-425b-bb97-7edebeb2677b</uuid>
  <memory unit='KiB'>2097152</memory>
 <hostdev mode='subsystem' type='pci' managed='yes'>
      <source>
        <address domain='0x0000' bus='0x00' slot='0x1f' function='0x0'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </hostdev>
    <memballoon model='virtio'>
  </devices>
</domain>

2.Use virt-v2v convert this guest to rhv,we can see the warning list below.
virt-v2v rhel6.7-pci-passthrough -o rhv -os 10.73.131.93:/home/nfs_export
[   0.0] Opening the source -i libvirt rhel6.7-pci-passthrough
virt-v2v: warning: this guest has a passthrough host device which will be 
ignored
[   0.0] Creating an overlay to protect the source from being modified
[   0.1] Initializing the target -o rhv -os 10.73.131.93:/home/nfs_export
[   0.3] Opening the overlay
[   1.6] Inspecting the overlay
[  14.5] Checking for sufficient free disk space in the guest
[  14.5] Estimating space required on target for each disk
[  14.5] Converting Red Hat Enterprise Linux Server release 6.7 Beta (Santiago) to run on KVM
virt-v2v: This guest has virtio drivers installed.
[  86.4] Mapping filesystem data to avoid copying unused and blank areas
[  86.5] Closing the overlay
[  86.8] Checking if the guest needs BIOS or UEFI to boot
[  86.8] Assigning disks to buses
[  86.8] Copying disk 1/1 to /tmp/v2v.Lyo76V/bdf9c90b-e6f0-439c-aa9f-6305fd5fad7e/images/fcceff56-5b41-406d-b268-d1c6e242987e/9c8e72b1-cac3-4051-9bb6-b88723bfaf01 (raw)
    (100.00/100%)
[ 122.4] Creating output metadata
[ 122.4] Finishing off
3.After conversion, input the guest to data domain ,boot the guest and all checkpoints passed.

So, i think the bug has fix,move ON_QA to VERIFIED

Comment 7 kuwei@redhat.com 2018-01-02 07:53:22 UTC
According to comment 5,the patch looks fine, If the bug has new impact when it's done repairing,I will open a new bug.
Move the bug to VERIFIED. 

Thanks pino

Comment 10 errata-xmlrpc 2018-04-10 09:18:10 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://access.redhat.com/errata/RHBA-2018:0677