1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-12-03 21:58:13 +00:00

Use hex encoding on VirtualBox pipe names

This allows arbitrary characters in VirtualBox VM names, while also ensuring all different weird names can coexist.

Example of two VMs that previously couldn't both have a serial console - "VM 1" and "VM_1", because the former's pipe name is converted to the latter, while the latter would remain unchanged.
This commit is contained in:
Vasil Rangelov 2015-04-10 23:26:08 +03:00
parent eac751948e
commit 60219d9a45

View File

@ -583,8 +583,7 @@ class VirtualBoxVM(BaseVM):
:returns: pipe path (string) :returns: pipe path (string)
""" """
p = re.compile('\s+', re.UNICODE) pipe_name = self._vmname.encode("hex", "strict")
pipe_name = p.sub("_", self._vmname)
if sys.platform.startswith("win"): if sys.platform.startswith("win"):
pipe_name = r"\\.\pipe\VBOX\{}".format(pipe_name) pipe_name = r"\\.\pipe\VBOX\{}".format(pipe_name)
else: else: