refactor: remove platform-specific code for Darwin and Windows. Clean up Qemu options handling

This commit is contained in:
grossmj committed 2026-10-31 16:49:23 +07:00
1 parent 4d1b9e4700
commit bad48286a5
20 files changed
+77 -532

No files matched your search

+3 -14
View File
@@ -22,11 +22,7 @@ import shutil
import sys
from collections import OrderedDict
if sys.platform.startswith("darwin"):
VMWARE_NETWORKING_FILE = "/Library/Preferences/VMware Fusion/networking"
else:
# location on Linux
VMWARE_NETWORKING_FILE = "/etc/vmware/networking"
VMWARE_NETWORKING_FILE = "/etc/vmware/networking"
if sys.platform.startswith("win"):
DEFAULT_RANGE = [1, 19]
@@ -74,15 +70,8 @@ def write_networking_file(version, pairs):
raise SystemExit(f"Cannot open {VMWARE_NETWORKING_FILE}: {e}")
# restart VMware networking service
if sys.platform.startswith("darwin"):
if not os.path.exists("/Applications/VMware Fusion.app/Contents/Library/vmnet-cli"):
raise SystemExit("VMware Fusion is not installed in Applications")
os.system(r"/Applications/VMware\ Fusion.app/Contents/Library/vmnet-cli --configure")
os.system(r"/Applications/VMware\ Fusion.app/Contents/Library/vmnet-cli --stop")
os.system(r"/Applications/VMware\ Fusion.app/Contents/Library/vmnet-cli --start")
else:
os.system("vmware-networks --stop")
os.system("vmware-networks --start")
os.system("vmware-networks --stop")
os.system("vmware-networks --start")
def parse_vmnet_range(start, end):