Fix error when system uses /usr/bin/qemu-kvm, as in CentOS 7.2.
Got "libvirt.libvirtError" error when using "/usr/bin/qemu-kvm" on CentOS7.2. CentOS 7.2 uses "/usr/libexec/qemu-kvm", this patch fixes it. Change-Id: Icf2951701fddfac8e2f0641f6f555adb8a3c185b Closes-Bug: #1649449
This commit is contained in:
parent
b7f001f441
commit
0f37379525
@ -110,10 +110,15 @@ def main():
|
|||||||
if args.emulator:
|
if args.emulator:
|
||||||
params['emulator'] = args.emulator
|
params['emulator'] = args.emulator
|
||||||
else:
|
else:
|
||||||
if os.path.exists("/usr/bin/kvm"): # Debian
|
qemu_kvm_locations = ['/usr/bin/kvm',
|
||||||
params['emulator'] = "/usr/bin/kvm"
|
'/usr/bin/qemu-kvm',
|
||||||
elif os.path.exists("/usr/bin/qemu-kvm"): # Redhat
|
'/usr/libexec/qemu-kvm']
|
||||||
params['emulator'] = "/usr/bin/qemu-kvm"
|
for location in qemu_kvm_locations:
|
||||||
|
if os.path.exists(location):
|
||||||
|
params['emulator'] = location
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
raise RuntimeError("Unable to find location of kvm executable")
|
||||||
|
|
||||||
if args.console_log:
|
if args.console_log:
|
||||||
params['console'] = CONSOLE_LOG % {'console_log': args.console_log}
|
params['console'] = CONSOLE_LOG % {'console_log': args.console_log}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user