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 1459906

Summary: The guest with intel-iommu device enabled can not restore after managedsave
Product: Red Hat Enterprise Linux 7 Reporter: yafu <yafu>
Component: qemu-kvm-rhevAssignee: Peter Xu <peterx>
Status: CLOSED ERRATA QA Contact: jingzhao <jinzhao>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.4CC: chayang, dyuan, fjin, hhuang, jinzhao, jishao, juzhang, lizhu, michen, mrezanin, pezhang, rbalakri, virt-maint, xuzhang, yafu, yanqzhan, zpeng
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: qemu-kvm-rhev-2.10.0-1.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-11 00:23:04 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:    
Bug Blocks: 1473046    
Attachments:
Description Flags
qemu log none

Description yafu 2017-06-08 14:07:51 UTC
Description of problem:
The guest with intel-iommu device enabled can not restore after managedsave.

Version-Release number of selected component (if applicable):
libvirt-3.2.0-9.virtcov.el7.x86_64
qemu-kvm-rhev-2.9.0-8.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Prepare a guest with q35 machine type and enable the intel-iommu device:
...
<os>
    <type arch='x86_64' machine='pc-q35-rhel7.4.0'>hvm</type>  -
    <boot dev='hd'/>
</os>
...
<iommu model='intel'/>
</devices>
...

2.start the guest:
#virsh start vm1-q35

3.Enable iommu in the guest:
(1)Edit file  "/etc/default/grub":
Append "intel_iommu=on" or "amd_iommu=on" to the value of "GRUB_CMDLINE_LINUX=......". Such as the following one:
GRUB_CMDLINE_LINUX="rd.md=0 rd.lvm=0 rd.dm=0 vconsole.keymap=us $([ -x /usr/sbin/rhcrashkernel-param ] && /usr/sbin/rhcrashkernel-param || :) rd.luks=0 vconsole.font=latarcyrheb-sun16 rhgb quiet intel_iommu=on"

(2)Then run the following command to generate the updated grub file:
# grub2-mkconfig -o /boot/grub2/grub.cfg
Reboot the guest.

4.Do managedsave:
#virsh managedsave vm1-q35
Domain vm1-q35 state saved by libvirt

5.Start the guest:
#virsh start vm1-q35
# virsh start vm1-q35
error: Failed to start domain vm1-q35
error: operation failed: job: unexpectedly failed

Actual results:
The guest with intel-iommu device enabled can not restore after managedsave. 

Expected results:
If the guest with intel-iommu device enabled can not restored after managedsave, libvirt should reject to do managedsave with the guest.

Additional info:
Could see the info below in the libvirtd.log:
Jun  8 09:58:43 localhost libvirtd: 22164: error : qemuMigrationCheckJobStatus:1425 : operation failed: job: unexpectedly failed
Jun  8 09:58:43 localhost systemd-machined: Machine qemu-2-vm1-q35 terminated.
Jun  8 09:58:43 localhost libvirtd: 22164: warning : qemuDomainObjStart:7112 : Unable to restore from managed state /var/lib/libvirt/qemu/save/vm1-q35.save. Maybe the file is corrupted

Comment 3 Ján Tomko 2017-06-13 15:15:42 UTC
Could you attach the qemu log?

Comment 4 yafu 2017-06-13 15:24:42 UTC
Created attachment 1287372 [details]
qemu log

Comment 8 Peter Xu 2017-06-29 04:34:36 UTC
It's a regression upstream as well. Fix posted upstream:

https://lists.gnu.org/archive/html/qemu-devel/2017-06/msg06545.html

Will backport when merged.

Peter

Comment 12 jingzhao 2017-10-17 05:45:10 UTC
Reproduce the issue on qemu-kvm-rhev-2.9.0-16.el7_4.9.x86_64 and verified it on qemu-kvm-rhev-2.10.0-2.el7.x86_64

changed to verified status

Thanks
Jing

Comment 14 errata-xmlrpc 2018-04-11 00:23:04 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/RHSA-2018:1104