Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Add -cpu kvm=off flag

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 https://gist.github.com/claudiok/890ab6dfe76fa45b30081e58038a9215 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

Add -cpu kvm=off flag

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 https://gist.github.com/claudiok/890ab6dfe76fa45b30081e58038a9215 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....

#!/usr/bin/python

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: 
        new_args.append(sys.argv[i])
        continue
    if sys.argv[i-1] != "-cpu":
        new_args.append(sys.argv[i])
        continue

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

    subargs.insert(1,"kvm=off")
    subargs.insert(2,"hv_vendor_id=MyFake_KVM")

    new_arg = ",".join(subargs)

    new_args.append(new_arg)

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

Add -cpu kvm=off flag

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 https://gist.github.com/claudiok/890ab6dfe76fa45b30081e58038a9215 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....

#!/usr/bin/python

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: 
        new_args.append(sys.argv[i])
        continue
    if sys.argv[i-1] != "-cpu":
        new_args.append(sys.argv[i])
        continue

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

    subargs.insert(1,"kvm=off")
    subargs.insert(2,"hv_vendor_id=MyFake_KVM")

    new_arg = ",".join(subargs)

    new_args.append(new_arg)

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".

Add -cpu kvm=off flag

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 https://gist.github.com/claudiok/890ab6dfe76fa45b30081e58038a9215 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....

#!/usr/bin/python

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: 
        new_args.append(sys.argv[i])
        continue
    if sys.argv[i-1] != "-cpu":
        new_args.append(sys.argv[i])
        continue

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

    subargs.insert(1,"kvm=off")
    subargs.insert(2,"hv_vendor_id=MyFake_KVM")

    new_arg = ",".join(subargs)

    new_args.append(new_arg)

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".