diff mbox series

[09/11] runqemu: make port lock directory patchable

Message ID 20261011195949.2118607-10-adrian.freihofer@siemens.com
State New
Headers show
Series runqemu: use QMP for slirp host port allocation | expand

Commit Message

AdrianF Oct. 11, 2026, 7:59 p.m. UTC
From: Adrian Freihofer <adrian.freihofer@siemens.com>

Use a class setting for the shared port-lock directory instead of a
literal path in NFS allocation. Keep the production default unchanged
and let subsequent slirp locking use the same setting.

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
---
 scripts/runqemu | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/scripts/runqemu b/scripts/runqemu
index c569fc7c84..0e0c77076c 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -136,6 +136,8 @@  def get_first_file(globs):
     return ''
 
 class BaseConfig(object):
+    PORT_LOCK_DIR = "/tmp/qemu-port-locks"
+
     def __init__(self):
         # The self.d saved vars from self.set(), part of them are from qemuboot.conf
         self.d = {'QB_KERNEL_ROOT': '/dev/vda'}
@@ -1059,7 +1061,7 @@  to your build configuration.
                 self.nfs_server = '192.168.7.@GATEWAY@'
 
         nfsd_port = 3048 + self.nfs_instance
-        lockdir = "/tmp/qemu-port-locks"
+        lockdir = self.PORT_LOCK_DIR
         self.make_lock_dir(lockdir)
         while not self.check_free_port('localhost', nfsd_port, lockdir):
             self.nfs_instance += 1