summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorlbonn <lbonn@users.noreply.github.com>2019-08-19 17:43:59 +0200
committerGitHub <noreply@github.com>2019-08-19 17:43:59 +0200
commit5f47b0babeec70ab892c622a07bb0c8edbc65ec5 (patch)
tree55bcd268f351c1cf05792ef066f72f20904f8283 /scripts
parentd74e0e862758abc236d2fbc973b0101df9898203 (diff)
parent0ec79804025bb64175993808423b62734b94ed11 (diff)
downloadmeta-updater-5f47b0babeec70ab892c622a07bb0c8edbc65ec5.tar.gz
Merge pull request #579 from advancedtelematic/backport/rocko-19-08-14
Backport/rocko 19 08 14
Diffstat (limited to 'scripts')
-rw-r--r--scripts/qemucommand.py20
1 files changed, 13 insertions, 7 deletions
diff --git a/scripts/qemucommand.py b/scripts/qemucommand.py
index 8b7da2b..df6907c 100644
--- a/scripts/qemucommand.py
+++ b/scripts/qemucommand.py
@@ -1,4 +1,4 @@
1from os.path import exists, join, realpath, abspath 1from os.path import exists, isdir, join, realpath, abspath
2from os import listdir 2from os import listdir
3import random 3import random
4import socket 4import socket
@@ -42,6 +42,8 @@ class QemuCommand(object):
42 if args.machine: 42 if args.machine:
43 self.machine = args.machine 43 self.machine = args.machine
44 else: 44 else:
45 if not isdir(args.dir):
46 raise ValueError("Directory %s does not exist, please specify a --machine or a valid images directory" % args.dir)
45 machines = listdir(args.dir) 47 machines = listdir(args.dir)
46 if len(machines) == 1: 48 if len(machines) == 1:
47 self.machine = machines[0] 49 self.machine = machines[0]
@@ -100,12 +102,8 @@ class QemuCommand(object):
100 cmdline += [ 102 cmdline += [
101 "-serial", "tcp:127.0.0.1:%d,server,nowait" % self.serial_port, 103 "-serial", "tcp:127.0.0.1:%d,server,nowait" % self.serial_port,
102 "-m", self.mem, 104 "-m", self.mem,
103 "-usb",
104 "-object", "rng-random,id=rng0,filename=/dev/urandom", 105 "-object", "rng-random,id=rng0,filename=/dev/urandom",
105 "-device", "virtio-rng-pci,rng=rng0", 106 "-device", "virtio-rng-pci,rng=rng0",
106 "-device", "usb-tablet",
107 "-show-cursor",
108 "-vga", "std",
109 "-net", netuser, 107 "-net", netuser,
110 "-net", "nic,macaddr=%s" % self.mac_address 108 "-net", "nic,macaddr=%s" % self.mac_address
111 ] 109 ]
@@ -117,9 +115,17 @@ class QemuCommand(object):
117 '-device', 'e1000,netdev=vlan1,mac='+random_mac(), 115 '-device', 'e1000,netdev=vlan1,mac='+random_mac(),
118 ] 116 ]
119 if self.gui: 117 if self.gui:
120 cmdline += ["-serial", "stdio"] 118 cmdline += [
119 "-usb",
120 "-device", "usb-tablet",
121 "-show-cursor",
122 "-vga", "std"
123 ]
121 else: 124 else:
122 cmdline.append('-nographic') 125 cmdline += [
126 "-nographic",
127 "-monitor", "null",
128 ]
123 if self.kvm: 129 if self.kvm:
124 cmdline += ['-enable-kvm', '-cpu', 'host'] 130 cmdline += ['-enable-kvm', '-cpu', 'host']
125 else: 131 else: