diff options
Diffstat (limited to 'scripts/qemucommand.py')
| -rw-r--r-- | scripts/qemucommand.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/scripts/qemucommand.py b/scripts/qemucommand.py index a75ffb6..82a9540 100644 --- a/scripts/qemucommand.py +++ b/scripts/qemucommand.py | |||
| @@ -2,6 +2,7 @@ from os.path import exists, join, realpath, abspath | |||
| 2 | from os import listdir | 2 | from os import listdir |
| 3 | import random | 3 | import random |
| 4 | import socket | 4 | import socket |
| 5 | from subprocess import check_output, CalledProcessError | ||
| 5 | 6 | ||
| 6 | EXTENSIONS = { | 7 | EXTENSIONS = { |
| 7 | 'intel-corei7-64': 'wic', | 8 | 'intel-corei7-64': 'wic', |
| @@ -67,7 +68,15 @@ class QemuCommand(object): | |||
| 67 | self.mac_address = random_mac() | 68 | self.mac_address = random_mac() |
| 68 | self.serial_port = find_local_port(8990) | 69 | self.serial_port = find_local_port(8990) |
| 69 | self.ssh_port = find_local_port(2222) | 70 | self.ssh_port = find_local_port(2222) |
| 70 | self.kvm = not args.no_kvm | 71 | if args.kvm is None: |
| 72 | # Autodetect KVM using 'kvm-ok' | ||
| 73 | try: | ||
| 74 | check_output(['kvm-ok']) | ||
| 75 | self.kvm = True | ||
| 76 | except CalledProcessError: | ||
| 77 | self.kvm = False | ||
| 78 | else: | ||
| 79 | self.kvm = args.kvm | ||
| 71 | self.gui = not args.no_gui | 80 | self.gui = not args.no_gui |
| 72 | self.gdb = args.gdb | 81 | self.gdb = args.gdb |
| 73 | self.pcap = args.pcap | 82 | self.pcap = args.pcap |
