Red Hat Bugzilla – Bug 1151885
libvirtd loses track of a running restored guest with host-passthrough cpu
Last modified: 2015-03-05 02:46:20 EST
description of problem: guest with passthough model cpu will disappear after restore and restart libvirtd Version-Release number of selected component (if applicable): libvirt-1.2.8-5.el7.x86_64 How reproducible: 100% Steps to Reproduce: 1.# rpm -q libvirt libvirt-1.2.8-5.el7.x86_64 2.# virsh dumpxml test3 |grep pass <cpu mode='host-passthrough'> 3.# virsh managedsave test3 Domain test3 state saved by libvirt 4.# virsh start test3 Domain test3 started 5.# virsh list --all Id Name State ---------------------------------------------------- 4 test3 running 6.# service libvirtd restart Redirecting to /bin/systemctl restart libvirtd.service 7.# virsh list --all Id Name State ---------------------------------------------------- 8.# 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 Actual results: guest disappear after managedsave -> restore ->restart libvirtd Expected results: guest still exist after libvirtd restart 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 Additional info:
Upstream patch: https://www.redhat.com/archives/libvir-list/2014-October/msg01120.html
v2: https://www.redhat.com/archives/libvir-list/2014-November/msg00218.html
v3: https://www.redhat.com/archives/libvir-list/2014-December/msg00345.html
Fixed upstream by: commit 15abebdecb35308ddd4d2967efa6dffa4842fac9 Author: Ján Tomko <jtomko@redhat.com> CommitDate: 2014-12-11 12:03:36 +0100 Ignore CPU features without a model for host-passthrough This fixes reverting to snapshots created by older libvirt and allows libvirt not to lose track of a domain that has this in its live status XML (such as a domain restored from managedsave) https://bugzilla.redhat.com/show_bug.cgi?id=1030793 https://bugzilla.redhat.com/show_bug.cgi?id=1151885 commit dd324bb2703b9cf619c521b2a04f186cd9734f0a Author: Ján Tomko <jtomko@redhat.com> CommitDate: 2014-12-11 12:03:36 +0100 Do not format CPU features without a model For host-passthrough CPU we don't honor the CPU features specified in the XML, but we allow outputting them via the UPDATE_CPU flag for dumpxml, this gives user a rough idea of what features the CPU might have. After restoring a managedsave'd domain, the features might end up in the live status XML (in /var/run) without the model. This XML cannot be parsed by the daemon after restart and the domain might disappear. This fix skips formatting the features for HOST_PASSTHROUGH when UPDATE_CPU is not specified, so the newly restored domains and newly created snapshots won't be affected. Note: this doesn't fix existing snapshots or already restored running domains. https://bugzilla.redhat.com/show_bug.cgi?id=1030793 https://bugzilla.redhat.com/show_bug.cgi?id=1151885 git describe: v1.2.11-rc2-5-g15abebd
Reproduce this bug with libvirt-1.2.8-5.el7.x86_64 1.Prepare a guest with host-passthrough cpu, but without cpu-model #virsh dumpxml rhel7.0 -- <cpu mode='host-passthrough'> </cpu> 2.Start the guest, then do live snapshot with the guest #virsh start rhel7.0 Domain rhel7.0 started #virsh snapshot-create-as rhel7.0 sp1 Domain snapshot sp1 created # virsh snapshot-list rhel7.0 Name Creation Time State ------------------------------------------------------------ sp1 2014-12-26 13:08:00 +0800 running 3.Rever the snapshot with sp1, will fail to revert it # virsh snapshot-revert rhel7.0 sp1 error: XML error: Non-empty feature list specified without CPU model 4.Managedsave the guest, then re-start it # virsh managedsave rhel7.0 Domain rhel7.0 state saved by libvirt # virsh start rhel7.0 Domain rhel7.0 started 5.Restart the libvirtd service, found the guest will be shutoff #service libvirtd restart # virsh list --all Id Name State ---------------------------------------------------- - rhel7.0 shut off could get the following error from the qemu's log -- Domain id=3 is tainted: host-cpu Got following error info from libvirt 2014-12-26 06:33:04.288+0000: 25776: 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-12-26 06:33:04.288+0000: 25776: error : virCPUDefParseXML:371 : XML error: Non-empty feature list specified without CPU model 2014-12-26 06:33:14.975+0000: 25768: warning : qemuDomainObjTaint:1899 : Domain id=2 name='rhel7.0' uuid=3725ae82-5bba-4e7a-afc4-0423ad8d0e65 is tainted: host-cpu 2014-12-26 06:34:39.536+0000: 25769: warning : virFileWrapperFdClose:326 : iohelper reports: 2014-12-26 06:34:44.714+0000: 25770: warning : qemuDomainObjTaint:1899 : Domain id=3 name='rhel7.0' uuid=3725ae82-5bba-4e7a-afc4-0423ad8d0e65 is tainted: host-cpu 2014-12-26 06:35:10.437+0000: 26194: 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-12-26 06:35:10.437+0000: 26194: error : virCPUDefParseXML:371 : XML error: Non-empty feature list specified without CPU model Verify this bug with libvirt-1.2.8-11.el7 Excute the steps in reproduce steps, the guest could do snapshot-revert successfully and also the guest keep in running status after restart the libvirtd service, so mark this bug verifed
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