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 1078080

Summary: Fail to start guest with normal PCI device
Product: Red Hat Enterprise Linux 7 Reporter: tingting zheng <tzheng>
Component: libvirtAssignee: Jiri Denemark <jdenemar>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 7.0CC: acathrow, dyuan, jdenemar, lcui, mzhan, tzheng, xuzhang
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-03-19 12:19:09 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
xml file of guest
none
libvirt log file none

Description tingting zheng 2014-03-19 06:56:37 UTC
Description:
Fail to start guest with normal PCI device

Version:
libvirt-1.1.1-28.el7.x86_64
virt-manager-0.10.0-18.el7.noarch

How reproducible:
100%

Steps to Reproduce:
1.Enable intel_iommu on host.
2.Prepare a guest with shutdown status.
3.Launch virt-manager,Open the guest,click show details->"Add Hardware"->select 'PCI Host Device' in hardware type list->select a NIC in device list to coldplug the PCI device to the vm,in my case,it is normal network card:00:19:0 82567LM-3 Gigabit Network Connection
4.Try to boot the guest,will get the below error.
Error starting domain: Unable to get index for interface enp0s25: No such device

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 100, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 122, in tmpcb
    callback(*args, **kwargs)
  File "/usr/share/virt-manager/virtManager/domain.py", line 1220, in startup
    self._backend.create()
  File "/usr/lib64/python2.7/site-packages/libvirt.py", line 698, in create
    if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self)
libvirtError: Unable to get index for interface enp0s25: No such device

5.Check the xml of the guest,the pci part will shows as:
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <source>
        <address domain='0x0000' bus='0x00' slot='0x19' function='0x0'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </hostdev>

6.I can hotplug the PCI device to guest successfully when the guest is running.


Actual results:
As described.

Expected results:
Step 5,guest can be started successfully.

Additional info:
The issue only occurs for normal PCI devices,and guest with VF can be started successfully.

Comment 1 Jiri Denemark 2014-03-19 10:44:13 UTC
PCI passthrough works normally for me (both coldplug and hotplug). Could you attach the complete domain XML, output of "virsh nodedev-dumpxml pci_0000_00_19_0" command, and most importantly debug logs from libvirtd generated while you tried to start the domain?

Comment 2 tingting zheng 2014-03-19 11:06:05 UTC
(In reply to Jiri Denemark from comment #1)
> PCI passthrough works normally for me (both coldplug and hotplug). Could you
> attach the complete domain XML, output of "virsh nodedev-dumpxml
> pci_0000_00_19_0" command, and most importantly debug logs from libvirtd
> generated while you tried to start the domain?

# virsh nodedev-dumpxml pci_0000_00_19_0
<device>
  <name>pci_0000_00_19_0</name>
  <path>/sys/devices/pci0000:00/0000:00:19.0</path>
  <parent>computer</parent>
  <driver>
    <name>e1000e</name>
  </driver>
  <capability type='pci'>
    <domain>0</domain>
    <bus>0</bus>
    <slot>25</slot>
    <function>0</function>
    <product id='0x10de'>82567LM-3 Gigabit Network Connection</product>
    <vendor id='0x8086'>Intel Corporation</vendor>
    <iommuGroup number='3'>
      <address domain='0x0000' bus='0x00' slot='0x19' function='0x0'/>
    </iommuGroup>
  </capability>
</device>

Comment 3 tingting zheng 2014-03-19 11:08:26 UTC
Created attachment 876320 [details]
xml file of guest

Comment 4 tingting zheng 2014-03-19 11:09:03 UTC
Created attachment 876321 [details]
libvirt log file

Comment 5 Jiri Denemark 2014-03-19 11:12:14 UTC
In the domain XML, I can see

    <interface type='direct'>
      <mac address='52:54:00:0a:99:26'/>
      <source dev='enp0s25' mode='vepa'/>
      <model type='rtl8139'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>

where enp0s25 corresponds to the error message you got. Are you trying to passthrough a the same network card that you use in the <interface> element above?

Comment 6 tingting zheng 2014-03-19 11:20:13 UTC
(In reply to Jiri Denemark from comment #5)
> In the domain XML, I can see
> 
>     <interface type='direct'>
>       <mac address='52:54:00:0a:99:26'/>
>       <source dev='enp0s25' mode='vepa'/>
>       <model type='rtl8139'/>
>       <address type='pci' domain='0x0000' bus='0x00' slot='0x03'
> function='0x0'/>
>     </interface>
> 
> where enp0s25 corresponds to the error message you got. Are you trying to
> passthrough a the same network card that you use in the <interface> element
> above?

Yes,so the error info is caused by the interface.

Comment 7 Jiri Denemark 2014-03-19 12:19:09 UTC
This is not a bug then. Attaching the PCI device removes it from the host and thus enp0s25 disappears so it's logical the start fails because it cannot find the device to connect the domain's interface with. Hotplug succeeds because the network interface is there when the domain is started, it the disappears as a result of its PCI device being passed through to the domain, which succeeds although domain's network connectivity will be broken since then.