summaryrefslogtreecommitdiff
path: root/subplot/qemumgr.py
diff options
context:
space:
mode:
Diffstat (limited to 'subplot/qemumgr.py')
-rwxr-xr-xsubplot/qemumgr.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/subplot/qemumgr.py b/subplot/qemumgr.py
index 8951122..0550bdb 100755
--- a/subplot/qemumgr.py
+++ b/subplot/qemumgr.py
@@ -3,6 +3,7 @@
import logging
import os
+import random
import shlex
import shutil
import signal
@@ -51,6 +52,9 @@ class QemuSystem:
def set_username(self, username):
self._username = username
+ def get_port(self):
+ return self._port
+
def _copy_image(self, base_image, size):
image = self._join("qemu.img")
logging.debug(f"QemuSystem: actual disk image: {image}")
@@ -92,7 +96,7 @@ class QemuSystem:
def start(self):
iso = self._cloud_init_iso()
- self._port = 2222 # FIXME
+ self._port = random.randint(2000, 30000)
pid_file = self._join("qemu.pid")
out_file = self._join("qemu.out")
err_file = self._join("qemu.err")