Bug 1160318 - internal error: Cannot find suitable CPU model for given data
Summary: internal error: Cannot find suitable CPU model for given data
Alias: None
Product: Fedora
Classification: Fedora
Component: libvirt
Version: 21
Hardware: x86_64
OS: Linux
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2014-11-04 14:41 UTC by Matías Kreder
Modified: 2015-01-30 09:53 UTC (History)
13 users (show)

Fixed In Version: libvirt-
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1252363 (view as bug list)
Last Closed: 2014-11-18 12:20:31 UTC
Type: Bug

Attachments (Terms of Use)
libvirtd log with intel-vt disabled (3.96 MB, application/x-gzip)
2014-11-04 15:00 UTC, Matías Kreder
no flags Details
capabilities xml (5.01 KB, text/plain)
2014-11-04 15:10 UTC, Matías Kreder
no flags Details

System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1178054 0 unspecified CLOSED gnome-boxes (libvirt) won't start my Windows XP virtual machine on Fedora 21: "QEMU 2.1.2 is too new for help parsing" 2021-02-22 00:41:40 UTC

Internal Links: 1178054

Description Matías Kreder 2014-11-04 14:41:46 UTC
Description of problem:

After installing Fedora 21 Workstation Alpha on Lenovo Thinkpad T410. virt-manager is not able to create any VM. 

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Install Fedora 21 Alpha on T410
2. Try to create VM on virt-manager
3. Get to the end of the wizard

Actual results:
It fails with error "internal error: Cannot find suitable CPU model for given data"

Expected results:
It should create the VM.

Additional info:
Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 89, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/create.py", line 1854, in do_install
  File "/usr/share/virt-manager/virtinst/guest.py", line 411, in start_install
  File "/usr/share/virt-manager/virtinst/guest.py", line 475, in _create_guest
    dom = self.conn.createLinux(start_xml or final_xml, 0)
  File "/usr/lib64/python2.7/site-packages/libvirt.py", line 3361, in
    if ret is None:raise libvirtError('virDomainCreateLinux() failed',
libvirtError: internal error: Cannot find suitable CPU model for given data

On "systemctl status libvirtd" I can see:

Nov 04 10:23:41 lappie.mkeder.com libvirtd[3822]: Preferred CPU model
Westmere not allowed by hypervisor; closest supported model will be
Nov 04 10:23:41 lappie.mkeder.com libvirtd[3822]: internal error:
Cannot find suitable CPU model for given data

I haven't tried Fedora 20 on it but I might re-install it soon. Just
wanted to give my feedback for Fedora 21.
Doing a google search it seems that some people had the same problem a
few months ago and they solved but by updating. Seems to be some sort
of problem between libvirt and qemu-kvm. Like this:


Logs are on fpaste:

virsh capabilities -> http://paste.fedoraproject.org/147736/15110815/
libvirtd debug -> http://fpaste.org/147741/51114361/

Comment 1 Matías Kreder 2014-11-04 14:46:49 UTC
This was fixed by stopping libvirt, removing all files on /var/cache/libvirt/qemu/capabilities/ and starting it again.

After the installation on Fedora 21 Alpha, when trying to create the VM the first time the BIOS setting for Intel Virtualization was disabled. After I enabled it I was getting the error reported on this bug. It was fixed by removing the cached files. 

It will be good if the cache files are cleaned up on this error or something so this doesn't happen to an average user.

Comment 2 Matías Kreder 2014-11-04 15:00:30 UTC
Created attachment 953648 [details]
libvirtd log with intel-vt disabled

libvirtd log with intel-vt disabled

Comment 3 Matías Kreder 2014-11-04 15:10:12 UTC
Created attachment 953657 [details]
capabilities xml

Comment 4 Jiri Denemark 2014-11-12 16:08:40 UTC
So the problem is in the /usr/bin/qemu-kvm wrapper, which runs qemu-system-x86_64 with -machine accel=kvm to force KVM. When libvirt starts, it probes QEMU binaries by running them with "-S -no-user-config -nodefaults -nographic -M none -qmp ... -pidfile ... -daemonize" to get a dummy process with QMP monitor which we can ask for available QMP commands, machine types, and lots of other things. Howver, when qemu-kvm wrapper forces the dummy process to enable KVM, it fails to start if KVM cannot be enabled for some reason (missing module, disabled by BIOS, ...). If that happens, we fall back to the old way of parsing -help, -cpu ?, etc. output. And since we implemented QMP probing for QEMU 1.2.0, we don't keep up with any changes made in "-cpu ?" output and thus fail to parse it properly. But we shouldn't even try to use the old way of probing QEMU capabilities because we know it's not going to work...

Comment 5 Jiri Denemark 2014-11-12 16:10:03 UTC
Patch sent upstream for review: https://www.redhat.com/archives/libvir-list/2014-November/msg00407.html

Comment 6 Cole Robinson 2014-11-12 16:15:25 UTC
Another option could be to alter the qemu-kvm wrapper script and change it to not use accel=kvm if -nodefaults is passed, that way we don't need to work around it in libvirt

Comment 7 Cole Robinson 2014-11-12 16:16:28 UTC
(Although that patch looks useful anyways)

Comment 8 Eduardo Habkost 2014-11-12 16:24:14 UTC
Can't the qemu-kvm wrapper simply use accel=kvm:tcg, and fallback to TCG if KVM is not available? (Wasn't it the behavior of qemu-kvm in the past, before the upstream merge?)

Comment 9 Jiri Denemark 2014-11-13 23:23:52 UTC
Pushed upstream as v1.2.10-104-gae3e29e6:

commit ae3e29e6e7a9a208732f22721e735d238b2aa8cb
Author: Jiri Denemark <jdenemar>
Date:   Wed Nov 12 16:49:59 2014 +0100

    qemu: Don't try to parse -help for new QEMU
    Since QEMU 1.2.0, we switched to QMP probing instead of parsing -help
    (and other commands, such as -cpu ?) output. However, if QMP probing
    failed, we still tried starting QEMU with various options and parsing
    the output, which was guaranteed to fail because the output changed.
    Let's just refuse parsing -help for QEMU >= 1.2.0.
    Signed-off-by: Jiri Denemark <jdenemar>

Comment 10 Fedora Update System 2014-11-16 01:23:23 UTC
libvirt- has been submitted as an update for Fedora 21.

Comment 11 Fedora Update System 2014-11-16 14:41:50 UTC
Package libvirt-
* 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 libvirt-'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).

Comment 12 Fedora Update System 2014-11-18 12:20:31 UTC
libvirt- 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.