Bug 1147584 - save/managedsave doesn't work with host-passthrough
Summary: save/managedsave doesn't work with host-passthrough
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Ján Tomko
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-09-29 14:21 UTC by Ján Tomko
Modified: 2015-03-05 07:45 UTC (History)
7 users (show)

Fixed In Version: libvirt-1.2.8-5.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-03-05 07:45:56 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System 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 12:10:54 UTC
Red Hat Bugzilla 1138221 None None None Never

Internal Links: 1138221

Description Ján Tomko 2014-09-29 14:21:50 UTC
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 14:35:25 UTC
Upstream patches:
https://www.redhat.com/archives/libvir-list/2014-September/msg01680.html

Comment 2 Ján Tomko 2014-09-30 09:00:31 UTC
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 05:36:45 UTC
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 11:53:37 UTC
Hi, that is a different bug as it's unrelated to the invtsc feature.

Comment 7 Luyao Huang 2014-10-13 01:28:26 UTC
(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-15 03:04:34 UTC
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 07:45:56 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://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.