This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours
Bug 804224 - libvirt incorrectly identifies supported CPU types
libvirt incorrectly identifies supported CPU types
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: libvirt (Show other bugs)
rawhide
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Jiri Denemark
Fedora Extras Quality Assurance
:
: 708927 723739 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-16 18:03 EDT by Andrew Cathrow
Modified: 2014-09-07 18:54 EDT (History)
16 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-06-07 10:39:02 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
virsh capabilities output (3.73 KB, text/plain)
2012-03-16 18:04 EDT, Andrew Cathrow
no flags Details
libvirt xml snippet + kvm cpu commandline (989 bytes, application/octet-stream)
2012-03-16 18:07 EDT, Andrew Cathrow
no flags Details
libvirt xml snippit with no fallback and resulting error (902 bytes, application/octet-stream)
2012-03-16 18:10 EDT, Andrew Cathrow
no flags Details

  None (edit)
Description Andrew Cathrow 2012-03-16 18:03:12 EDT
Tested in rawhide/f17alpha but seems present in f16

qemu-kvm-1.0-6.fc17.x86_64
libvirt-0.9.10-2.fc17.x86_64

virsh capabilities shows Westmere 
<capabilities>

  <host>
    <uuid>819a0871-d050-cb11-968b-c921c1cdc254</uuid>
    <cpu>
      <arch>x86_64</arch>
      <model>Westmere</model>
      <vendor>Intel</vendor>

qemu-kvm -cpu shows valid cpu types
qemu-kvm -cpu ? 
x86       Opteron_G3
x86       Opteron_G2
x86       Opteron_G1
x86          Nehalem
x86           Penryn
x86           Conroe
x86           [n270]
x86         [athlon]
x86       [pentium3]
x86       [pentium2]
x86        [pentium]
x86            [486]
x86        [coreduo]
x86          [kvm32]
x86         [qemu32]
x86          [kvm64]
x86       [core2duo]
x86         [phenom]
x86         [qemu64]

Creating a VM with cpu type westmere with following xml (snippit)
  <cpu mode='custom' match='exact'>
    <model fallback='allow'>Westmere</model>
    <vendor>Intel</vendor>

Produces the following qemu-kvm command line 
-cpu core2duo,+lahf_lm,+rdtscp,+aes,+popcnt,+x2apic,+sse4.2,+sse4.1,+xtpr,+cx16,+tm2,+est,+vmx,+ds_cpl,+pbe,+tm,+ht,+ss,+acpi,+ds

Changing xml to forbid fallback produces following message

error: unsupported configuration: CPU model Westmere is not supported by hypervisor
Comment 1 Andrew Cathrow 2012-03-16 18:04:21 EDT
Created attachment 570719 [details]
virsh capabilities output
Comment 2 Andrew Cathrow 2012-03-16 18:07:34 EDT
Created attachment 570720 [details]
libvirt xml snippet + kvm cpu commandline
Comment 3 Andrew Cathrow 2012-03-16 18:10:43 EDT
Created attachment 570725 [details]
libvirt xml snippit with no fallback and resulting error
Comment 4 Martin Kletzander 2012-03-19 10:52:39 EDT
*** Bug 708927 has been marked as a duplicate of this bug. ***
Comment 5 Martin Kletzander 2012-03-19 12:46:55 EDT
Hello,

may I ask what exactly is supposed to be the bug? I see that QEMU doesn't support Westmere, so libvirt uses '-cpu core2duo,<flags>...' to specify the CPU with correct features etc.
The host model you can see in virsh capabilities is reflecting just the host CPU capability and has nothing to do with any hypervisor.

Could you run that machine with "Nehalem" specified as cpu and check what will be specified in qemu's command line?
Thanks
Comment 6 Andrew Cathrow 2012-03-19 12:57:18 EDT
Sorry, I think I mixed xmls.

On a host that qemu-kvm -cpu ? says supports Nehalem and that shows Nehalem in virsh capabilities, setting libvirt xml to Nahlem drops down to 

-cpu kvm64,+lahf_lm,+popcnt,+sse4.2,+sse4.1,+ssse3
Comment 7 Jiri Denemark 2012-03-20 03:52:06 EDT
This is a result of our usage of -nodefconfig qemu option, which makes qemu ignore /etc/qemu/target-x86_64.conf where all the modern CPU models are defined. Try running qemu-kvm -cpu ? -nodefconfig, you will only see models in []. Cooperation with qemu upstream (which has already been started, btw) is needed to fix this issue.
Comment 8 Andrew Cathrow 2012-04-22 10:16:19 EDT
*** Bug 723739 has been marked as a duplicate of this bug. ***
Comment 9 Ayal Baron 2012-05-01 17:16:49 EDT
any update on this?
Comment 10 Martin Kletzander 2012-05-02 04:23:53 EDT
Hello, we are still waiting for qemu to implement one feature that will make libvirt able to run it without -nodefconfig option.
Eduardo posted the patches upstream, but these are not in the code, yet.
We have also patches for the implementation in libvirt sent by Jiri, however these must wait for qemu to implement their functionality.
Comment 11 Jiri Denemark 2012-05-15 15:43:44 EDT
QEMU patches were pushed yesterday and are part of qemu-1.1-rc2. Corresponding libvirt change went in today as

commit 63b4243624b8fdabebaf5e6ec912095b2b5fdf5c
Author: Jiri Denemark <jdenemar@redhat.com>
Date:   Thu Apr 26 12:11:49 2012 +0200

    qemu: Add support for -no-user-config

    Thanks to this new option we are now able to use modern CPU models (such
    as Westmere) defined in external configuration file.
Comment 12 Cole Robinson 2012-06-07 10:39:02 EDT
Since this requires a qemu 1.1 command line arg, this isn't a very good backport candidate. qemu 1.1 and a new libvirt release will be in rawhide within a month, so just closing as UPSTREAM

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