diff options
author | Kostiantyn Bushko <kbushko@intellias.com> | 2020-01-14 00:08:51 +0200 |
---|---|---|
committer | Patrick Vacek <patrickvacek@gmail.com> | 2020-01-15 11:04:54 +0100 |
commit | 438c23bfe2d615f26e3894a53fd754a144b069af (patch) | |
tree | 7281f48c8710665ba5c5a6b77809905a26035d55 /scripts/qemucommand.py | |
parent | 405b4525eb4541a571731487d2c9ca8ddabf1d5c (diff) | |
download | meta-updater-438c23bfe2d615f26e3894a53fd754a144b069af.tar.gz |
run-qemu-ota: passing hostfwd as command line argument
Signed-off-by: Kostiantyn Bushko <kbushko@intellias.com>
Diffstat (limited to 'scripts/qemucommand.py')
-rw-r--r-- | scripts/qemucommand.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/qemucommand.py b/scripts/qemucommand.py index cef434d..85b12c6 100644 --- a/scripts/qemucommand.py +++ b/scripts/qemucommand.py | |||
@@ -42,6 +42,8 @@ class QemuCommand(object): | |||
42 | def __init__(self, args): | 42 | def __init__(self, args): |
43 | self.dry_run = args.dry_run | 43 | self.dry_run = args.dry_run |
44 | self.overlay = args.overlay | 44 | self.overlay = args.overlay |
45 | self.host_fwd = None | ||
46 | |||
45 | if args.machine: | 47 | if args.machine: |
46 | self.machine = args.machine | 48 | self.machine = args.machine |
47 | else: | 49 | else: |
@@ -125,10 +127,17 @@ class QemuCommand(object): | |||
125 | self.pcap = args.pcap | 127 | self.pcap = args.pcap |
126 | self.secondary_network = args.secondary_network | 128 | self.secondary_network = args.secondary_network |
127 | 129 | ||
130 | # Append additional port forwarding to QEMU command line. | ||
131 | if args.host_forward: | ||
132 | self.host_fwd = args.host_forward | ||
133 | |||
128 | def command_line(self): | 134 | def command_line(self): |
129 | netuser = 'user,hostfwd=tcp:0.0.0.0:%d-:22,restrict=off' % self.ssh_port | 135 | netuser = 'user,hostfwd=tcp:0.0.0.0:%d-:22,restrict=off' % self.ssh_port |
130 | if self.gdb: | 136 | if self.gdb: |
131 | netuser += ',hostfwd=tcp:0.0.0.0:2159-:2159' | 137 | netuser += ',hostfwd=tcp:0.0.0.0:2159-:2159' |
138 | if self.host_fwd: | ||
139 | netuser += ",hostfwd=" + self.host_fwd | ||
140 | |||
132 | cmdline = [ | 141 | cmdline = [ |
133 | "qemu-system-x86_64", | 142 | "qemu-system-x86_64", |
134 | "-bios", self.bios | 143 | "-bios", self.bios |