diff --git a/src/util/conf.c b/src/util/conf.c index 8682f7b12368e148054babe8e03b00d7675399ea..0aef2c2ca8c9fa0c2860c3a46cc608660b54995a 100644 --- a/src/util/conf.c +++ b/src/util/conf.c @@ -561,7 +561,7 @@ virConfParseName(virConfParserCtxtPtr ctxt) while ((ctxt->cur < ctxt->end) && (c_isalnum(CUR) || (CUR == '_') || ((ctxt->conf->flags & VIR_CONF_FLAG_VMX_FORMAT) && - ((CUR == ':') || (CUR == '.'))))) + ((CUR == ':') || (CUR == '.') || (CUR == '-'))))) NEXT; ret = strndup(base, ctxt->cur - base); if (ret == NULL) { diff --git a/src/util/conf.h b/src/util/conf.h index 8282bd441bc453788d2690c318815f706d237f9b..e7d470dbaf36da448bb60b17343f343f7473e143 100644 --- a/src/util/conf.h +++ b/src/util/conf.h @@ -25,8 +25,8 @@ typedef enum { } virConfType; typedef enum { - VIR_CONF_FLAG_VMX_FORMAT = 1, /* allow : and . in names for compatibility with - VMware VMX configuration file, but restrict + VIR_CONF_FLAG_VMX_FORMAT = 1, /* allow ':', '.' and '-' in names for compatibility + with VMware VMX configuration file, but restrict allowed value types to string only */ } virConfFlags; diff --git a/tests/vmx2xmldata/vmx2xml-esx-in-the-wild-5.vmx b/tests/vmx2xmldata/vmx2xml-esx-in-the-wild-5.vmx new file mode 100644 index 0000000000000000000000000000000000000000..6b11cc27e4b0f2473553ff24989e32f44f3c113c --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-esx-in-the-wild-5.vmx @@ -0,0 +1,97 @@ +.encoding = "UTF-8" +config.version = "8" +virtualHW.version = "7" +pciBridge0.present = "true" +pciBridge4.present = "true" +pciBridge4.virtualDev = "pcieRootPort" +pciBridge4.functions = "8" +pciBridge5.present = "true" +pciBridge5.virtualDev = "pcieRootPort" +pciBridge5.functions = "8" +pciBridge6.present = "true" +pciBridge6.virtualDev = "pcieRootPort" +pciBridge6.functions = "8" +pciBridge7.present = "true" +pciBridge7.virtualDev = "pcieRootPort" +pciBridge7.functions = "8" +vmci0.present = "true" +nvram = "vmtest.nvram" +virtualHW.productCompatibility = "hosted" +powerType.powerOff = "soft" +powerType.powerOn = "hard" +powerType.suspend = "hard" +powerType.reset = "soft" +displayName = "vmtest.local" +extendedConfigFile = "vmtest.vmxf" +numvcpus = "2" +scsi0.present = "true" +scsi0.sharedBus = "none" +scsi0.virtualDev = "lsilogic" +memsize = "2048" +scsi0:0.present = "true" +scsi0:0.fileName = "vmtest-000001.vmdk" +scsi0:0.deviceType = "scsi-hardDisk" +sched.scsi0:0.shares = "normal" +ide0:0.present = "true" +ide0:0.fileName = "/vmfs/volumes/4af0231d-1eff559a-6369-0024e84773b6/isos/CentOS-5.5-x86_64-bin-DVD-1of2.iso" +ide0:0.deviceType = "cdrom-image" +ide1:0.present = "true" +ide1:0.clientDevice = "true" +ide1:0.deviceType = "atapi-cdrom" +ide1:0.startConnected = "false" +ethernet0.present = "true" +ethernet0.virtualDev = "e1000" +ethernet0.networkName = "VM-LAN" +ethernet0.addressType = "vpx" +ethernet0.generatedAddress = "00:50:56:be:00:15" +guestOS = "centos-64" +uuid.bios = "42 3e 94 a9 a1 c7 b3 1d-71 61 76 c7 58 6c 83 0e" +vc.uuid = "50 3e 06 db f8 d5 45 8e-a2 fb f9 82 02 53 a7 be" +log.fileName = "vmware.log" +snapshot.action = "keep" +sched.cpu.min = "0" +sched.cpu.units = "mhz" +sched.cpu.shares = "normal" +sched.mem.minsize = "0" +sched.mem.shares = "normal" +tools.upgrade.policy = "manual" +cpuid.80000001.eax = "--------------------------------" +cpuid.80000001.eax.amd = "--------------------------------" +cpuid.80000001.ebx = "--------------------------------" +cpuid.80000001.ebx.amd = "--------------------------------" +cpuid.80000001.ecx = "--------------------------------" +cpuid.80000001.ecx.amd = "--------------------------------" +cpuid.80000001.edx = "-----------H--------------------" +cpuid.80000001.edx.amd = "-----------H--------------------" +replay.supported = "FALSE" +replay.filename = "" +scsi0:0.redo = "" +pciBridge0.pciSlotNumber = "17" +pciBridge4.pciSlotNumber = "21" +pciBridge5.pciSlotNumber = "22" +pciBridge6.pciSlotNumber = "23" +pciBridge7.pciSlotNumber = "24" +scsi0.pciSlotNumber = "16" +ethernet0.pciSlotNumber = "33" +vmci0.pciSlotNumber = "32" +scsi0.sasWWID = "50 05 05 6b 91 ac 28 90" +vmotion.checkpointFBSize = "4194304" +hostCPUID.0 = "0000000568747541444d416369746e65" +hostCPUID.1 = "00100f420004080000802009178bfbff" +hostCPUID.80000001 = "00100f42000004ef000037ffefd3fbff" +guestCPUID.0 = "0000000568747541444d416369746e65" +guestCPUID.1 = "00100f420000080080802001078bfbff" +guestCPUID.80000001 = "00100f42000004ef000001e9ebd3fbff" +userCPUID.0 = "0000000568747541444d416369746e65" +userCPUID.1 = "00100f420004080080802001078bfbff" +userCPUID.80000001 = "00100f42000004ef000001e9ebd3fbff" +evcCompatibilityMode = "FALSE" +sched.scsi0:0.throughputCap = "off" +guest.commands.sharedSecretLogin.hostd-quiescedsnap = "9ARGZmWQPtsUVrAVi/XviNUSQUF0td426itHw2cqHwg=" +floppy0.present = "FALSE" +vmci0.id = "1483506446" +tools.syncTime = "FALSE" +annotation = "Centos 5.5 64bit Server" +uuid.location = "56 4d 58 2e 12 3c 07 e4-0b 84 af d9 ea 5d 83 0a" +cleanShutdown = "FALSE" +sched.swap.derivedName = "/vmfs/volumes/4bd1a428-b723f5bb-d406-0024e84773db/vmtest/vmtest-56acee0d.vswp" diff --git a/tests/vmx2xmldata/vmx2xml-esx-in-the-wild-5.xml b/tests/vmx2xmldata/vmx2xml-esx-in-the-wild-5.xml new file mode 100644 index 0000000000000000000000000000000000000000..c3246735e96e8788f6036c4123a5115840854a22 --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-esx-in-the-wild-5.xml @@ -0,0 +1,34 @@ + + vmtest.local + 423e94a9-a1c7-b31d-7161-76c7586c830e + Centos 5.5 64bit Server + 2097152 + 2097152 + 2 + + hvm + + + destroy + restart + destroy + + + + +
+ + + + +
+ + + + + + + + + + diff --git a/tests/vmx2xmltest.c b/tests/vmx2xmltest.c index 67296d6c5a8c66604013e593e009ef5898b0e523..c71f536dc1308342027143c5171ed043c8a41a0d 100644 --- a/tests/vmx2xmltest.c +++ b/tests/vmx2xmltest.c @@ -274,6 +274,7 @@ mymain(int argc, char **argv) DO_TEST("esx-in-the-wild-2", "esx-in-the-wild-2", esxVI_ProductVersion_ESX35); DO_TEST("esx-in-the-wild-3", "esx-in-the-wild-3", esxVI_ProductVersion_ESX35); DO_TEST("esx-in-the-wild-4", "esx-in-the-wild-4", esxVI_ProductVersion_ESX35); + DO_TEST("esx-in-the-wild-5", "esx-in-the-wild-5", esxVI_ProductVersion_ESX40); DO_TEST("gsx-in-the-wild-1", "gsx-in-the-wild-1", esxVI_ProductVersion_ESX35); DO_TEST("gsx-in-the-wild-2", "gsx-in-the-wild-2", esxVI_ProductVersion_ESX35);