Ask Your Question

Add -cpu kvm=off flag

asked 2017-01-17 11:09:35 -0600

kvasko gravatar image

updated 2017-01-17 13:38:01 -0600

I am trying to do PCI-Passthrough but I cannot figure out how to add this flag to get consumer grade equipment to work.

I found this link ( and the "workaround" doesn't work as the -cpu flag isn't in the parameter list. If I append "-cpu kvm=off" to the end of the parameter list I'm given...this error.

"unable to find CPU definition: kvm=off" error

this is the script in question....


import os
import sys

new_args = []

# only change the "-cpu" options (inject kvm=off and hv_vendor_id=MyFake_KVM)
for i in range(len(sys.argv)):
    if i<=1: 
    if sys.argv[i-1] != "-cpu":

    subargs = sys.argv[i].split(",")


    new_arg = ",".join(subargs)


os.execv('/usr/bin/qemu-system-x86_64.orig', new_args)

The problem is when my python script is called I see "-S -no-user-config -nodefaults -nographic -M none -qmp unix:/var/lib/libvirt/qemu/capabilities.monitor.sock,server,nowait -pidfile /var/lib/libvirt/qemu/capabilties.pidfile -daemonize".

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2017-01-17 12:44:01 -0600

volenbovsky gravatar image

Hi, -syntax 'cpu kvm=off' does not make sense to me.

I think it should be smth like -cpu host,kvm=off, but most likely you can omit -cpu part (you need just to add kvm=off)

The format -cpu <model>, but doing -cpu host (=use CPU model from host) might be not necessary, as you probably can rely on defaults of QEMU.

SIde note: doing those things via QEMU wrapper script sounds as too much hacking/is not 'sustainable'...

edit flag offensive delete link more


The script I found here. ( But yes it is supposed to do the following -cpu <somecpu>,kvm=off (e.g. -cpu Haswell,kvm=off).</somecpu>

I realize this is a hack, but have no idea how to add the kvm=off flag. Do you have a better solution?

kvasko gravatar imagekvasko ( 2017-01-17 13:33:04 -0600 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2017-01-17 11:09:35 -0600

Seen: 746 times

Last updated: Jan 17 '17