STRCASEEQ(connectionType, "bridged") ||
STRCASEEQ(connectionType, "custom")) {
if (virVMXGetConfigString(conf, networkName_name, &networkName,
- false) < 0)
+ true) < 0)
goto cleanup;
}
}
/* Setup virDomainNetDef */
- if (connectionType == NULL || STRCASEEQ(connectionType, "bridged")) {
+ if (connectionType == NULL && networkName == NULL) {
+ /*
+ * Having neither a connectionType nor a network name can mean two
+ * things:
+ *
+ * 1) there is no connection of that nic
+ * 2) the nic is connected to VMWare Distributed Switch
+ *
+ * But we do not see any difference between these and hence we report
+ * the closest thing to at least make virt-v2v and others work when they
+ * read the domain XML.
+ */
+ (*def)->type = VIR_DOMAIN_NET_TYPE_DUMMY;
+ } else if (connectionType == NULL || STRCASEEQ(connectionType, "bridged")) {
(*def)->type = VIR_DOMAIN_NET_TYPE_BRIDGE;
(*def)->data.bridge.brname = g_steal_pointer(&networkName);
} else if (STRCASEEQ(connectionType, "hostonly")) {
controller);
break;
+ case VIR_DOMAIN_NET_TYPE_DUMMY:
+ break;
+
case VIR_DOMAIN_NET_TYPE_ETHERNET:
case VIR_DOMAIN_NET_TYPE_VHOSTUSER:
case VIR_DOMAIN_NET_TYPE_SERVER:
case VIR_DOMAIN_NET_TYPE_HOSTDEV:
case VIR_DOMAIN_NET_TYPE_UDP:
case VIR_DOMAIN_NET_TYPE_VDPA:
- case VIR_DOMAIN_NET_TYPE_DUMMY:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("Unsupported net type '%s'"),
virDomainNetTypeToString(def->type));
return -1;
--- /dev/null
+config.version = "8"
+virtualHW.version = "4"
+ethernet0.present = "true"
+ethernet0.virtualDev = "e1000e"
+ethernet0.addressType = "vpx"
+ethernet0.generatedAddress = "00:50:56:87:65:43"
+displayName = "test"
--- /dev/null
+<domain type='vmware'>
+ <name>test</name>
+ <uuid>00000000-0000-0000-0000-000000000000</uuid>
+ <memory unit='KiB'>32768</memory>
+ <currentMemory unit='KiB'>32768</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='i686'>hvm</type>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <interface type='dummy'>
+ <mac address='00:50:56:87:65:43' type='generated'/>
+ <model type='e1000e'/>
+ </interface>
+ <video>
+ <model type='vmvga' vram='4096' primary='yes'/>
+ </video>
+ </devices>
+</domain>
DO_TEST("ethernet-static");
DO_TEST("ethernet-vpx");
DO_TEST("ethernet-other");
+ DO_TEST("ethernet-unmanaged-nodev");
DO_TEST("serial-file");
DO_TEST("serial-device");
--- /dev/null
+.encoding = "UTF-8"
+config.version = "8"
+virtualHW.version = "4"
+guestOS = "other"
+uuid.bios = "56 4d 9b ef ac d9 b4 e0-c8 f0 ae a8 b9 10 35 15"
+displayName = "ethernet-vpx"
+memsize = "4"
+numvcpus = "1"
+floppy0.present = "false"
+floppy1.present = "false"
+ethernet0.present = "true"
+ethernet0.addressType = "vpx"
+ethernet0.generatedAddress = "00:50:56:87:65:43"
--- /dev/null
+<domain type='vmware'>
+ <name>ethernet-vpx</name>
+ <uuid>564d9bef-acd9-b4e0-c8f0-aea8b9103515</uuid>
+ <memory unit='KiB'>4096</memory>
+ <os>
+ <type>hvm</type>
+ </os>
+ <devices>
+ <interface type='dummy'>
+ <mac address='00:50:56:87:65:43'/>
+ </interface>
+ </devices>
+</domain>
DO_TEST("ethernet-other", "ethernet-other", 4);
DO_TEST("ethernet-mac-type", "ethernet-mac-type", 4);
+ DO_TEST("ethernet-unmanaged-nodev", "ethernet-unmanaged-nodev", 4);
+
DO_TEST("serial-file", "serial-file", 4);
DO_TEST("serial-device", "serial-device", 4);
DO_TEST("serial-pipe", "serial-pipe", 4);