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 991334 - Libvirt lost error messages when starting a domain with pci hostdev after setting iommu off.
Summary: Libvirt lost error messages when starting a domain with pci hostdev after set...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.5
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Ján Tomko
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-08-02 07:38 UTC by Hu Jianwei
Modified: 2013-11-21 09:07 UTC (History)
8 users (show)

Fixed In Version: libvirt-0.10.2-23.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-11-21 09:07:46 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:1581 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2013-11-21 01:11:35 UTC

Description Hu Jianwei 2013-08-02 07:38:26 UTC
Description of problem:
Libvirt lost error messages when starting a domain with pci hostdev after setting iommu off.
 
Version-Release number of selected component (if applicable):
libvirt-0.10.2-21.el6.x86_64
qemu-kvm-rhev-0.12.1.2-2.381.el6.x86_64
kernel-2.6.32-401.el6.x86_64


How reproducible:
100%

Steps:
1.In grub config file, remove "intel_iommu=on" from kernel command line, reboot host pc.

2.Define a domain and add the similar following xml to domain.
<hostdev mode='subsystem' type='pci'>
<source>
<address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
</source>
</hostdev>

3.Start the domain.
[root@sriov2 ~]# virsh start r6
error: Failed to start domain r6
error: internal error process exited while connecting to monitor:


Actual results:
Missing details error messages, as step 3 shown.

Expected results:
I can not reproduce this issue on libvirt-0.10.2-18.el6_4.9.x86_64 version. We can reproduce it since libvirt-0.10.2-19.el6.x86_64.

Libvirt should pop up some messages, just like below:
[root@sriov2 ~]# virsh start r6
error: Failed to start domain r6
error: internal error process exited while connecting to monitor: char device redirected to /dev/pts/2
assigned_dev_register_regions: Error: Couldn't mmap 0xe7200000!
qemu-kvm: -device pci-assign,host=01:00.0,id=hostdev0,configfd=25,bus=pci.0,addr=0x7: Device 'pci-assign' could not be initialized
(This message showed on libvirt-0.10.2-18.el6_4.9.x86_64 version.)

or
[root@sriov2 ~]# virsh attach-device r6 hostdev.xml
error: Failed to attach device from hostdev.xml
error: internal error unable to execute QEMU command 'device_add': Device 'pci-assign' could not be initialized
(Message showed on libvirt-0.10.2-21.el6.x86_64 using attach-device command.)

Comment 2 Hu Jianwei 2013-08-02 09:59:45 UTC
There is a similar error.
 
1.Turn OFF VT-d in BOIS.

2. Dettach this pci device from host
# virsh nodedev-dettach pci_0000_01_00_0

3.Add below xml file to domain.
<hostdev mode='subsystem' type='pci'>
<source>
<address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
</source>
</hostdev> 

4.Start domain.
[root@sriov2 ~]# virsh start r6_1
error: Failed to start domain r6_1
error: internal error Process exited while reading console log output: 


Note,no details information showed, should display some like below:

[root@sriov2 ~]# virsh attach-device r6_1 hostdev.xml
error: Failed to attach device from hostdev.xml
error: internal error unable to execute QEMU command 'device_add': Device 'pci-assign' could not be initialized

Comment 3 yanbing du 2013-08-05 02:37:21 UTC
Actually, this bug should be introduced by bug 954248.

Comment 4 Ján Tomko 2013-08-15 13:10:37 UTC
Upstream patch proposed:
https://www.redhat.com/archives/libvir-list/2013-August/msg00696.html

Comment 5 Ján Tomko 2013-08-15 13:37:02 UTC
Now fixed upstream:
commit 9ceaaa08e9b2281a5b58ac2f896761b2703d8791
Author:     Ján Tomko <jtomko>
AuthorDate: 2013-08-15 15:05:29 +0200
Commit:     Ján Tomko <jtomko>
CommitDate: 2013-08-15 15:05:29 +0200

    Fix qemuProcessReadLog with non-zero offset
    
    This restores the error message when QMP probing is not used.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=991334

git describe: v1.1.1-142-g9ceaaa0 

Downstream patch posted:
http://post-office.corp.redhat.com/archives/rhvirt-patches/2013-August/msg01000.html

Comment 7 Xuesong Zhang 2013-08-23 06:36:05 UTC
Verify this bug on build libvirt-0.10.2-23.el6.x86_64.


steps of scenario 1:
1.In grub config file, remove "intel_iommu=on" from kernel command line, reboot host pc.

2.Define a domain and add the similar following xml to domain.
<hostdev mode='subsystem' type='pci' manage='yes'>
<source>
<address domain='0x0000' bus='0x86' slot='0x00' function='0x0'/>
</source>
</hostdev>

3. start the guest with the xml in step 2.
# virsh start a
error: Failed to start domain a
error: internal error process exited while connecting to monitor: char device redirected to /dev/pts/1
No IOMMU found.  Unable to assign device "hostdev0"
qemu-kvm: -device pci-assign,host=86:00.0,id=hostdev0,configfd=30,bus=pci.0,addr=0x6: Device 'pci-assign' could not be initialized

4. attach the pci to guest.
# virsh attach-device a interface.xml 
error: Failed to attach device from interface.xml
error: internal error unable to execute QEMU command 'device_add': Device 'pci-assign' could not be initialized

steps of scenario 2:
1.Turn OFF VT-d in BOIS.
2.Define a domain and add the similar following xml to domain.
<hostdev mode='subsystem' type='pci' manage='yes'>
<source>
<address domain='0x0000' bus='0x86' slot='0x00' function='0x0'/>
</source>
</hostdev>

3. start the guest with the xml in step 2.
# virsh start rhel65
error: Failed to start domain rhel65
error: internal error Process exited while reading console log output: char device redirected to /dev/pts/1
No IOMMU found.  Unable to assign device "hostdev0"
qemu-kvm: -device pci-assign,host=00:19.0,id=hostdev0,configfd=27,bus=pci.0,addr=0x6: Device 'pci-assign' could not be initialized


4. attach the pci to guest.
# virsh attach-device rhel65 interface2.xml 
error: Failed to attach device from interface2.xml
error: internal error unable to execute QEMU command 'device_add': Device 'pci-assign' could not be initialized

Comment 9 errata-xmlrpc 2013-11-21 09:07:46 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.

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


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