Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1147584 - save/managedsave doesn't work with host-passthrough
save/managedsave doesn't work with host-passthrough
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt (Show other bugs)
7.1
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Ján Tomko
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2014-09-29 10:21 EDT by Ján Tomko
Modified: 2015-03-05 02:45 EST (History)
7 users (show)

See Also:
Fixed In Version: libvirt-1.2.8-5.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-03-05 02:45:56 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:0323 normal SHIPPED_LIVE Low: libvirt security, bug fix, and enhancement update 2015-03-05 07:10:54 EST

  None (edit)
Description Ján Tomko 2014-09-29 10:21:50 EDT
Description of problem:
On a host with invariant TSC support, a domain with <cpu mode='host-passthrough'/> cannot be restored after being saved.

Version-Release number of selected component (if applicable):
libvirt-1.2.8-4.el7

How reproducible:
100%

Steps to Reproduce:
1. Start a domain with <cpu mode='host-passthrough'/>
2a. virsh save <domain> <savefile>
3a. virsh restore <savefile>

2b. virsh managedsave <domain>
3b. virsh start <domain>

Actual results:
Domain is restored.

Expected results:
error: unsupported configuration: host doesn't support invariant TSC
Comment 1 Ján Tomko 2014-09-29 10:35:25 EDT
Upstream patches:
https://www.redhat.com/archives/libvir-list/2014-September/msg01680.html
Comment 2 Ján Tomko 2014-09-30 05:00:31 EDT
Fixed upstream:
commit f53bb1af90737205fdbfd26dc99865c02457d8c9
Author:     Ján Tomko <jtomko@redhat.com>
CommitDate: 2014-09-30 10:51:08 +0200

    Also filter out non-migratable features out of host-passthrough
    
    Commit de0aeaf filtered them out from the host-model features,
    to allow host-model to be migratable by default.
    
    Even though they are not passed to QEMU for host-passthrough,
    (and not enabled by default) filter them out too
    so the user does not think the domain has them.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1147584

commit ec5f817f2e108ef2164bd4cefd9ad37319cc7518
Author:     Ján Tomko <jtomko@redhat.com>
CommitDate: 2014-09-30 10:47:02 +0200

    Don't verify CPU features with host-passthrough
    
    Commit fba6bc4 introduced the non-migratable invtsc feature,
    breaking save/migration with host-model and host-passthrough.
    
    On hosts with this feature present it was automatically included
    in the CPU definition, regardless of QEMU support.
    
    Commit de0aeaf stopped including it by default for host-model,
    but failed to fix host-passthrough.
    
    This commit ignores checking of CPU features with host-passthrough,
    since we don't pass them to QEMU (only -cpu host is passed),
    allowing domains using host-passthrough that were saved with
    the broken version of libvirtd to be restored.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1147584

git describe: v1.2.9-rc2-2-gf53bb1a
Comment 5 Luyao Huang 2014-10-11 01:36:45 EDT
Hi Jan Tomko,

I found a issue about restore a domain with <cpu mode='host-passthrough'/> will disappear after restore and restart libvirtd.Would you please help me to check out if it is a bug and need open a new bug? or will fix in this bug? 


Steps:
# rpm -q libvirt
libvirt-1.2.8-5.el7.x86_64
# virsh dumpxml test3 |grep pass
  <cpu mode='host-passthrough'>

# virsh managedsave test3

Domain test3 state saved by libvirt

# virsh start test3
Domain test3 started

# virsh list --all
 Id    Name                           State
----------------------------------------------------
 4     test3                          running

# service libvirtd restart
Redirecting to /bin/systemctl restart  libvirtd.service

# virsh list --all
 Id    Name                           State
----------------------------------------------------

# ps aux|grep test3
qemu     25559 14.2  4.1 1738704 295480 ?      Sl   20:57   0:24 /usr/libexec/qemu-kvm -name test3 -S -machine pc-i440fx-rhel7.1.0,accel=kvm,usb=off -cpu host -m 1024 -realtime mlock=off -smp 2,maxcpus=4,sockets=4,cores=1,threads=1 -uuid 7347d748-f7ce-448f-8d49-3d29c9bcac30 -no-user-config -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/test3.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -boot strict=on -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -device


Some log from libvirtd.log:


2014-10-10 12:45:15.219+0000: 24943: info : libvirt version: 1.2.8, package: 5.el7 (Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>, 2014-10-09-08:52:56, x86-030.build.eng.bos.redhat.com)
2014-10-10 12:45:15.219+0000: 24943: error : virCPUDefParseXML:371 : XML error: Non-empty feature list specified without CPU model
2014-10-10 12:45:27.641+0000: 24934: warning : qemuDomainObjTaint:1899 : Domain id=2 name='test3' uuid=7347d748-f7ce-448f-8d49-3d29c9bcac30 is tainted: host-cpu
2014-10-10 12:46:15.777+0000: 25127: info : libvirt version: 1.2.8, package: 5.el7 (Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>, 2014-10-09-08:52:56, x86-030.build.eng.bos.redhat.com)
2014-10-10 12:46:15.777+0000: 25127: error : virCPUDefParseXML:371 : XML error: Non-empty feature list specified without CPU model

Thanks,
Luyao Huang
Comment 6 Ján Tomko 2014-10-12 07:53:37 EDT
Hi, that is a different bug as it's unrelated to the invtsc feature.
Comment 7 Luyao Huang 2014-10-12 21:28:26 EDT
(In reply to Jan Tomko from comment #6)
> Hi, that is a different bug as it's unrelated to the invtsc feature.

Thanks a lot, and filed a new bug 1151885 to trace the new issue.
Comment 8 Luyao Huang 2014-10-14 23:04:34 EDT
I can reproduce this bug with libvirt-1.2.8-4.el7:

Step:
# virsh dumpxml test3 |grep pass
  <cpu mode='host-passthrough'>

# virsh start test3
Domain test3 started

# virsh save test3 test3.save

Domain test3 saved to test3.save

# virsh restore test3.save
error: Failed to restore domain from test3.save
error: unsupported configuration: host doesn't support invariant TSC

# virsh start test3
Domain test3 started

# virsh managedsave test3

Domain test3 state saved by libvirt

# virsh start test3
error: Failed to start domain test3
error: unsupported configuration: host doesn't support invariant TSC


And verify this bug with libvirt-1.2.8-5.el7;

# virsh dumpxml test3|grep pass
  <cpu mode='host-passthrough'>

# virsh start test3
Domain test3 started

# virsh save test3 test3.save

Domain test3 saved to test3.save

# virsh restore test3.save
Domain restored from test3.save

# virsh managedsave test3

Domain test3 state saved by libvirt

# virsh start test3
Domain test3 started

# virsh migrate test3 --live qemu+ssh://lhuang2/system
root@10.66.6.12's password:
Comment 10 errata-xmlrpc 2015-03-05 02:45:56 EST
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/RHSA-2015-0323.html

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