fix(compute): ignore null settings of custom adapters

When only a port is renamed in a template's custom adapters, the adapter is
saved with "adapter_type": null. The emulators read it with
custom_adapter.get("adapter_type", self._adapter_type), which returns None
for a key set to null: QEMU was then started with "-device None,..." and
died ("'None' is not a valid device model name"), GNS3 only reporting
"Could not start Telnet QEMU console". VirtualBox and VMware read the
adapter type the same way.

Drop the null settings in _get_custom_adapter_settings so the node's own
adapter type (and MAC address) applies.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
tikD1337andClaude Opus 5.5 committed 2026-10-23 09:56:48 +02:00
1 parent 4d55cb1b9c
commit b9cf9158ca
2 files changed
+18 -1

No files matched your search

+3 -1
View File
@@ -1561,5 +1561,7 @@ class BaseNode:
if self.custom_adapters:
for custom_adapter in self.custom_adapters:
if custom_adapter["adapter_number"] == adapter_number:
return custom_adapter
# settings left unset are null (e.g. "adapter_type" when only the
# port is renamed): drop them so callers fall back to the node's own
return {key: value for key, value in custom_adapter.items() if value is not None}
return {}