Bug 1190851 - "Copy host CPU configuration" generates invalid CPU XML
Summary: "Copy host CPU configuration" generates invalid CPU XML
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: virt-manager
Version: 21
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Cole Robinson
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1193469 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-02-09 19:10 UTC by Robert Hancock
Modified: 2015-04-07 07:28 UTC (History)
14 users (show)

Fixed In Version: virt-manager-1.1.0-5.git310f6527.fc21
Clone Of:
Environment:
Last Closed: 2015-04-07 07:28:10 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Robert Hancock 2015-02-09 19:10:35 UTC
Description of problem:
After updating to libvirt-1.2.9.2-1.fc21.x86_64, I started getting this error on starting an existing VM on a Haswell host machine that was previously set to "copy host CPU configuration":

Error starting domain: unsupported configuration: guest and host CPU are not compatible: Host CPU does not provide required features: rtm, hle

Looking at the VM settings in virt-manager, the "copy host CPU configuration" checkbox was now unset and the CPU type was set to Haswell. Checking the checkbox again and trying to apply now produces this error:

Error changing VM configuration: XML error: CPU vendor specified without CPU model

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/addhardware.py", line 1384, in change_config_helper
    vm.redefine_cached()
  File "/usr/share/virt-manager/virtManager/libvirtobject.py", line 227, in redefine_cached
    self._redefine_xml(xml)
  File "/usr/share/virt-manager/virtManager/libvirtobject.py", line 252, in _redefine_xml
    return self._redefine_helper(origxml, newxml)
  File "/usr/share/virt-manager/virtManager/libvirtobject.py", line 244, in _redefine_helper
    self._define(newxml)
  File "/usr/share/virt-manager/virtManager/domain.py", line 1037, in _define
    self.conn.define_domain(newxml)
  File "/usr/share/virt-manager/virtManager/connection.py", line 679, in define_domain
    return self._backend.defineXML(xml)
  File "/usr/lib64/python2.7/site-packages/libvirt.py", line 3484, in defineXML
    if ret is None:raise libvirtError('virDomainDefineXML() failed', conn=self)
libvirtError: XML error: CPU vendor specified without CPU model

Version-Release number of selected component (if applicable):
libvirt-1.2.9.2-1.fc21.x86_64

How reproducible:
Every time

Steps to Reproduce:
1.Start existing VM on Haswell machine, or try to re-enable copying host CPU config
2.
3.

Actual results:
VM fails to start or to be edited

Expected results:
VM starts and CPU setting can be changed

Additional info:

From /proc/cpuinfo:

processor	: 0
vendor_id	: GenuineIntel
cpu family	: 6
model		: 60
model name	: Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
stepping	: 3
microcode	: 0x1c
cpu MHz		: 3186.703
cache size	: 8192 KB
physical id	: 0
siblings	: 8
core id		: 0
cpu cores	: 4
apicid		: 0
initial apicid	: 0
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm ida arat epb pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt
bugs		:
bogomips	: 6784.29
clflush size	: 64
cache_alignment	: 64
address sizes	: 39 bits physical, 48 bits virtual
power management:

Comment 1 Robert Hancock 2015-02-09 19:22:57 UTC
I may have been wrong about this being introduced by a libvirt update - this might actually have been triggered by a microcode_ctl update. This is therefore similar to bug 1182650, but that one doesn't seem to mention the "copy host CPU" option in the virt-manager GUI being broken as well.

Comment 2 Ján Tomko 2015-02-10 09:50:44 UTC
Can you attach the output of 'virt-manager --debug' after you check the checkbox again?

Comment 3 Robert Hancock 2015-02-10 16:04:46 UTC
[Tue, 10 Feb 2015 10:03:40 virt-manager 20815] DEBUG (libvirtobject:71) Redefining <vmmDomain name=SL6uds-71fixes> with XML diff:
--- Original XML
+++ New XML
@@ -13,8 +13,7 @@
     <apic/>
     <pae/>
   </features>
-  <cpu mode="custom" match="exact">
-    <model fallback="allow">Haswell</model>
+  <cpu mode="host-model" match="exact">
     <vendor>Intel</vendor>
     <topology sockets="1" cores="4" threads="2"/>
     <feature policy="require" name="tm2"/>

[Tue, 10 Feb 2015 10:03:40 virt-manager 20815] DEBUG (error:80) error dialog message:
summary=Error changing VM configuration: XML error: CPU vendor specified without CPU model
details=Error changing VM configuration: XML error: CPU vendor specified without CPU model

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/addhardware.py", line 1384, in change_config_helper
    vm.redefine_cached()
  File "/usr/share/virt-manager/virtManager/libvirtobject.py", line 227, in redefine_cached
    self._redefine_xml(xml)
  File "/usr/share/virt-manager/virtManager/libvirtobject.py", line 252, in _redefine_xml
    return self._redefine_helper(origxml, newxml)
  File "/usr/share/virt-manager/virtManager/libvirtobject.py", line 244, in _redefine_helper
    self._define(newxml)
  File "/usr/share/virt-manager/virtManager/domain.py", line 1037, in _define
    self.conn.define_domain(newxml)
  File "/usr/share/virt-manager/virtManager/connection.py", line 679, in define_domain
    return self._backend.defineXML(xml)
  File "/usr/lib64/python2.7/site-packages/libvirt.py", line 3484, in defineXML
    if ret is None:raise libvirtError('virDomainDefineXML() failed', conn=self)
libvirtError: XML error: CPU vendor specified without CPU model

Comment 4 Ján Tomko 2015-02-11 13:11:33 UTC
virt-manager shouldn't be using <cpu> that has a <vendor> but no <model>

Comment 5 Cole Robinson 2015-03-24 22:57:00 UTC
*** Bug 1193469 has been marked as a duplicate of this bug. ***

Comment 6 Cole Robinson 2015-03-26 21:09:26 UTC
Fixed upstream:

commit dc1737e623aef0f661cc28c0c5b87f847fc2526b
Author: Cole Robinson <crobinso>
Date:   Thu Mar 26 17:08:15 2015 -0400

    cpu: Drop vendor and features if setting host-model (bz 1190851)

Comment 7 Fedora Update System 2015-03-27 21:12:31 UTC
virt-manager-1.1.0-5.git310f6527.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/virt-manager-1.1.0-5.git310f6527.fc21

Comment 8 Fedora Update System 2015-03-30 06:59:47 UTC
Package virt-manager-1.1.0-5.git310f6527.fc21:
* should fix your issue,
* was pushed to the Fedora 21 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing virt-manager-1.1.0-5.git310f6527.fc21'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2015-4962/virt-manager-1.1.0-5.git310f6527.fc21
then log in and leave karma (feedback).

Comment 9 Fedora Update System 2015-04-07 07:28:10 UTC
virt-manager-1.1.0-5.git310f6527.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.


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