Bug 611401 - cpuCompareXML reports pentium host is incompatible with a core2duo host
cpuCompareXML reports pentium host is incompatible with a core2duo host
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
6.0
All Linux
low Severity medium
: rc
: ---
Assigned To: Jiri Denemark
Virtualization Bugs
:
Depends On:
Blocks: 581275 613760 630615
  Show dependency treegraph
 
Reported: 2010-07-05 02:29 EDT by Dan Kenigsberg
Modified: 2010-11-11 09:50 EST (History)
9 users (show)

See Also:
Fixed In Version: libvirt-0_8_1-14_el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 613760 630615 (view as bug list)
Environment:
Last Closed: 2010-11-11 09:50:15 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Dan Kenigsberg 2010-07-05 02:29:51 EDT
Description of problem:
On a host that happily runs pentium guests, cpuCompareXML fails.

Version-Release number of selected component (if applicable):
libvirt-0.8.1-12.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
host cpu:
    <cpu>
      <arch>x86_64</arch>
      <model>core2duo</model>
      <topology sockets='1' cores='2' threads='1'/>
      <feature name='lahf_lm'/>
      <feature name='xtpr'/>
      <feature name='cx16'/>
      <feature name='tm2'/>
      <feature name='est'/>
      <feature name='vmx'/>
      <feature name='ds_cpl'/>
      <feature name='pbe'/>
      <feature name='tm'/>
      <feature name='ht'/>
      <feature name='ss'/>
      <feature name='acpi'/>
      <feature name='ds'/>
    </cpu>

guest cpu:
<cpu match="minimum">
  <arch>i686</arch>
  <model>pentium</model>
</cpu>

Actual results:
# virsh cpu-compare /tmp/pentium.xml
CPU described in /tmp/pentium.xml is incompatible with host CPU

Expected results:
CPU is compatible

Additional info:
02:29:22.157: debug : virConnectCompareCPU:11869 : conn=0x7fee9009ec80, xmlDesc=<cpu match='minimum'><arch>i686</arch><model>pentium</model></cpu>
, flags=36151920
02:29:22.157: debug : cpuCompareXML:77 : host=0x2543dd0, xml=<cpu match='minimum'><arch>i686</arch><model>pentium</model></cpu>

02:29:22.157: debug : cpuCompare:110 : host=0x2543dd0, cpu=0x7fee88002400
02:29:22.161: debug : x86Compute:968 : Host CPU provides forbidden features in CPUID function 0x1
Comment 2 Jiri Denemark 2010-07-07 08:33:43 EDT
You need to specify guest cpu without the <arch> element. Specifying arch is only allowed for host CPUs. However, I admit that the error is pretty confusing so it needs to be fixed.
Comment 3 Daniel Berrange 2010-07-07 08:59:35 EDT
Shouldn't it be treating 'i686' guest arch as compatible with 'x86_64' host arch ?
Comment 4 Jiri Denemark 2010-07-12 14:36:35 EDT
It turns out there are two things involved:

1) as suggested in comment 2 is that libvirts does not print an error when both 'match' attribute and 'arch' element are used in one 'cpu' element and just ignores the match attribute in that case and treats the XML as host CPU definition

2) comparing host CPUs is wrong, which is the cause for "Host CPU provides forbidden features in CPUID function 0x1" message

The second issue is fixed upstream by http://libvirt.org/git/?p=libvirt.git;a=commit;h=ac3daf0899cced61faeeed3c6e14806d9e846174

I'll clone this bz for the first issue.
Comment 8 Dave Allan 2010-07-14 02:21:58 EDT
libvirt-0_8_1-14_el6 has been built in RHEL-6-candidate with the fix.

Dave
Comment 10 wangyimiao 2010-08-02 05:45:39 EDT
Verified this bug PASS with:
libvirt-0.8.1-20.el6.x86_64
qemu-img-0.12.1.2-2.106.el6.x86_64
qemu-kvm-0.12.1.2-2.106.el6.x86_64
kernel-2.6.32-55.el6.x86_64
Comment 11 Nan Zhang 2010-09-07 04:02:15 EDT
Verified with libvirt-0.8.1-27.el6.x86_64.

# cat cpu-pentium.xml 
<cpu match="minimum">
  <model>pentium</model>
</cpu>

# virsh cpu-compare cpu-pentium.xml
Host CPU is a superset of CPU described in cpu-pentium.xml
Comment 12 releng-rhel@redhat.com 2010-11-11 09:50:15 EST
Red Hat Enterprise Linux 6.0 is now available and should resolve
the problem described in this bug report. This report is therefore being closed
with a resolution of CURRENTRELEASE. You may reopen this bug report if the
solution does not work for you.

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