libvirt/tests/xml2vmxdata
Daniel P. Berrangé 6d3cb071b4 vmx: fix logic handling mac address type
With the current formatter, the XML snippets:

    <interface type='bridge'>
      <mac address='00:0c:29:dd:ee:fe' type='static'/>
      <source bridge='br1'/>
    </interface>
    <interface type='bridge'>
      <mac address='aa:bb:cc:dd:ee:fd' type='generated'/>
      <source bridge='br2'/>
    </interface>

result in

 ethernet1.present = "true"
 ethernet1.networkName = "br1"
 ethernet1.connectionType = "bridged"
 ethernet1.addressType = "static"
 ethernet1.address = "00:0c:29:dd:ee:fe"
 ethernet1.checkMACAddress = "false"

 ethernet2.present = "true"
 ethernet2.networkName = "br2"
 ethernet2.connectionType = "bridged"
 ethernet2.addressType = "static"
 ethernet2.address = "aa:bb:cc:dd:ee:fd"
 ethernet2.checkMACAddress = "false"

which is flawed, as both type='static' and type='generated' in the XML
turn into 'static' in the VMX config.

The existence of the 'static' attribute is further overriding whether
the checkMACAddress config option is set as a side effect.

Both these pieces of flawed logic were introduced in

  commit 454e5961ab
  Author: Bastien Orivel <bastien.orivel@diateam.net>
  Date:   Mon Jul 13 16:28:53 2020 +0200

    Add a type attribute on the mac address element

which intentionally added the 'checkMACAddress' side effect based on
the 'type' attribute.

With this change, we're reverting the handling of checkMACAddress
to match what existed historically. The 'type' attribute now directly
maps to the addressType attribute, so the above config becomes:

 ethernet1.present = "true"
 ethernet1.networkName = "br1"
 ethernet1.connectionType = "bridged"
 ethernet1.addressType = "static"
 ethernet1.address = "00:0c:29:dd:ee:fe"

 ethernet2.present = "true"
 ethernet2.networkName = "br2"
 ethernet2.connectionType = "bridged"
 ethernet2.addressType = "generated"
 ethernet2.generatedAddress = "aa:bb:cc:dd:ee:fd"
 ethernet2.generatedAddressOffset = "0"

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-07-23 16:11:31 +01:00
..
xml2vmx-annotation.vmx esx: Explictly declare VMX file content as UTF-8 2010-10-15 17:51:28 +02:00
xml2vmx-annotation.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2vmx-cdrom-ide-device.vmx esx: Explictly declare VMX file content as UTF-8 2010-10-15 17:51:28 +02:00
xml2vmx-cdrom-ide-device.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2vmx-cdrom-ide-empty.vmx vmx: Adapt to emptyBackingString for cdrom-image 2016-01-25 08:34:23 +01:00
xml2vmx-cdrom-ide-empty.xml vmx: Adapt to emptyBackingString for cdrom-image 2016-01-25 08:34:23 +01:00
xml2vmx-cdrom-ide-file.vmx esx: Explictly declare VMX file content as UTF-8 2010-10-15 17:51:28 +02:00
xml2vmx-cdrom-ide-file.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2vmx-cdrom-ide-raw-auto-detect.vmx VMX: Add support for 'auto detect' fileNames 2013-09-17 14:10:40 -05:00
xml2vmx-cdrom-ide-raw-auto-detect.xml VMX: Add support for 'auto detect' fileNames 2013-09-17 14:10:40 -05:00
xml2vmx-cdrom-ide-raw-device.vmx VMX: Add cdrom-raw dev type from VMWare Fusion 2013-09-02 17:41:30 -05:00
xml2vmx-cdrom-ide-raw-device.xml VMX: Add cdrom-raw dev type from VMWare Fusion 2013-09-02 17:41:30 -05:00
xml2vmx-cdrom-scsi-device.vmx esx: Explictly declare VMX file content as UTF-8 2010-10-15 17:51:28 +02:00
xml2vmx-cdrom-scsi-device.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2vmx-cdrom-scsi-empty.vmx vmx: Adapt to emptyBackingString for cdrom-image 2016-01-25 08:34:23 +01:00
xml2vmx-cdrom-scsi-empty.xml vmx: Adapt to emptyBackingString for cdrom-image 2016-01-25 08:34:23 +01:00
xml2vmx-cdrom-scsi-file.vmx esx: Explictly declare VMX file content as UTF-8 2010-10-15 17:51:28 +02:00
xml2vmx-cdrom-scsi-file.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2vmx-cdrom-scsi-passthru.vmx vmx: Add handling for CDROM devices with SCSI passthru 2015-09-07 22:19:42 +02:00
xml2vmx-cdrom-scsi-passthru.xml vmx: Add handling for CDROM devices with SCSI passthru 2015-09-07 22:19:42 +02:00
xml2vmx-cdrom-scsi-raw-auto-detect.vmx VMX: Add support for 'auto detect' fileNames 2013-09-17 14:10:40 -05:00
xml2vmx-cdrom-scsi-raw-auto-detect.xml VMX: Add support for 'auto detect' fileNames 2013-09-17 14:10:40 -05:00
xml2vmx-cdrom-scsi-raw-device.vmx VMX: Add cdrom-raw dev type from VMWare Fusion 2013-09-02 17:41:30 -05:00
xml2vmx-cdrom-scsi-raw-device.xml VMX: Add cdrom-raw dev type from VMWare Fusion 2013-09-02 17:41:30 -05:00
xml2vmx-datacenterpath.vmx vmx: Expose datacenter path in domain XML 2015-09-17 11:34:54 +01:00
xml2vmx-datacenterpath.xml vmx: Expose datacenter path in domain XML 2015-09-17 11:34:54 +01:00
xml2vmx-esx-in-the-wild-1.vmx util: Change virMacAddrFormat to lowercase hex characters 2013-04-02 15:53:43 +02:00
xml2vmx-esx-in-the-wild-1.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2vmx-esx-in-the-wild-2.vmx util: Change virMacAddrFormat to lowercase hex characters 2013-04-02 15:53:43 +02:00
xml2vmx-esx-in-the-wild-2.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2vmx-esx-in-the-wild-3.vmx util: Change virMacAddrFormat to lowercase hex characters 2013-04-02 15:53:43 +02:00
xml2vmx-esx-in-the-wild-3.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2vmx-esx-in-the-wild-4.vmx util: Change virMacAddrFormat to lowercase hex characters 2013-04-02 15:53:43 +02:00
xml2vmx-esx-in-the-wild-4.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2vmx-esx-in-the-wild-5.vmx util: Change virMacAddrFormat to lowercase hex characters 2013-04-02 15:53:43 +02:00
xml2vmx-esx-in-the-wild-5.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2vmx-esx-in-the-wild-6.vmx util: Change virMacAddrFormat to lowercase hex characters 2013-04-02 15:53:43 +02:00
xml2vmx-esx-in-the-wild-6.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2vmx-esx-in-the-wild-7.vmx vmx: Add handling for CDROM devices with SCSI passthru 2015-09-07 22:19:42 +02:00
xml2vmx-esx-in-the-wild-7.xml vmx: Add handling for CDROM devices with SCSI passthru 2015-09-07 22:19:42 +02:00
xml2vmx-esx-in-the-wild-9.vmx vmx: write cpuid.coresPerSocket back from CPU topology 2018-04-20 09:11:01 +02:00
xml2vmx-esx-in-the-wild-9.xml vmx: write cpuid.coresPerSocket back from CPU topology 2018-04-20 09:11:01 +02:00
xml2vmx-ethernet-bridged.vmx esx: Explictly declare VMX file content as UTF-8 2010-10-15 17:51:28 +02:00
xml2vmx-ethernet-bridged.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2vmx-ethernet-custom.vmx esx: Explictly declare VMX file content as UTF-8 2010-10-15 17:51:28 +02:00
xml2vmx-ethernet-custom.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2vmx-ethernet-e1000.vmx esx: Explictly declare VMX file content as UTF-8 2010-10-15 17:51:28 +02:00
xml2vmx-ethernet-e1000.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2vmx-ethernet-generated.vmx util: Change virMacAddrFormat to lowercase hex characters 2013-04-02 15:53:43 +02:00
xml2vmx-ethernet-generated.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2vmx-ethernet-mac-type.vmx vmx: fix logic handling mac address type 2020-07-23 16:11:31 +01:00
xml2vmx-ethernet-mac-type.xml Add a type attribute on the mac address element 2020-07-13 18:47:44 +02:00
xml2vmx-ethernet-nat.vmx vmx: Better Workstation vmx handling 2012-02-24 11:53:23 +01:00
xml2vmx-ethernet-nat.xml vmx: Better Workstation vmx handling 2012-02-24 11:53:23 +01:00
xml2vmx-ethernet-other.vmx esx: Explictly declare VMX file content as UTF-8 2010-10-15 17:51:28 +02:00
xml2vmx-ethernet-other.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2vmx-ethernet-static.vmx esx: Explictly declare VMX file content as UTF-8 2010-10-15 17:51:28 +02:00
xml2vmx-ethernet-static.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2vmx-ethernet-vmxnet2.vmx esx: Explictly declare VMX file content as UTF-8 2010-10-15 17:51:28 +02:00
xml2vmx-ethernet-vmxnet2.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2vmx-ethernet-vpx.vmx esx: Explictly declare VMX file content as UTF-8 2010-10-15 17:51:28 +02:00
xml2vmx-ethernet-vpx.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2vmx-firmware-efi.vmx vmx: write firmware back from autoselection 2019-04-15 20:03:55 -04:00
xml2vmx-firmware-efi.xml vmx: write firmware back from autoselection 2019-04-15 20:03:55 -04:00
xml2vmx-floppy-device.vmx esx: Explictly declare VMX file content as UTF-8 2010-10-15 17:51:28 +02:00
xml2vmx-floppy-device.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2vmx-floppy-file.vmx esx: Fix floppy.fileName handling in the vmx file parser 2013-10-15 11:39:02 +01:00
xml2vmx-floppy-file.xml esx: Fix floppy.fileName handling in the vmx file parser 2013-10-15 11:39:02 +01:00
xml2vmx-fusion-in-the-wild-1.vmx esx: Add VMCI device for virtualHW >= 7 2016-05-26 11:17:06 +02:00
xml2vmx-fusion-in-the-wild-1.xml VMX: Add a VMWare Fusion 5 configuration for tests 2013-09-17 14:10:41 -05:00
xml2vmx-graphics-vnc.vmx vmx: Add support for video device VRAM size 2011-01-06 18:18:35 +01:00
xml2vmx-graphics-vnc.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2vmx-gsx-in-the-wild-1.vmx util: Change virMacAddrFormat to lowercase hex characters 2013-04-02 15:53:43 +02:00
xml2vmx-gsx-in-the-wild-1.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2vmx-gsx-in-the-wild-2.vmx util: Change virMacAddrFormat to lowercase hex characters 2013-04-02 15:53:43 +02:00
xml2vmx-gsx-in-the-wild-2.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2vmx-gsx-in-the-wild-3.vmx util: Change virMacAddrFormat to lowercase hex characters 2013-04-02 15:53:43 +02:00
xml2vmx-gsx-in-the-wild-3.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2vmx-gsx-in-the-wild-4.vmx util: Change virMacAddrFormat to lowercase hex characters 2013-04-02 15:53:43 +02:00
xml2vmx-gsx-in-the-wild-4.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2vmx-harddisk-ide-file.vmx esx: Explictly declare VMX file content as UTF-8 2010-10-15 17:51:28 +02:00
xml2vmx-harddisk-ide-file.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2vmx-harddisk-scsi-file.vmx esx: Explictly declare VMX file content as UTF-8 2010-10-15 17:51:28 +02:00
xml2vmx-harddisk-scsi-file.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2vmx-minimal-64bit.vmx esx: Explictly declare VMX file content as UTF-8 2010-10-15 17:51:28 +02:00
xml2vmx-minimal-64bit.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2vmx-minimal.vmx esx: Explictly declare VMX file content as UTF-8 2010-10-15 17:51:28 +02:00
xml2vmx-minimal.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2vmx-parallel-device.vmx esx: Explictly declare VMX file content as UTF-8 2010-10-15 17:51:28 +02:00
xml2vmx-parallel-device.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2vmx-parallel-file.vmx esx: Explictly declare VMX file content as UTF-8 2010-10-15 17:51:28 +02:00
xml2vmx-parallel-file.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2vmx-scsi-driver.vmx esx: Explictly declare VMX file content as UTF-8 2010-10-15 17:51:28 +02:00
xml2vmx-scsi-driver.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2vmx-scsi-writethrough.vmx esx: Explictly declare VMX file content as UTF-8 2010-10-15 17:51:28 +02:00
xml2vmx-scsi-writethrough.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2vmx-serial-device.vmx esx: Explictly declare VMX file content as UTF-8 2010-10-15 17:51:28 +02:00
xml2vmx-serial-device.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2vmx-serial-file.vmx esx: Explictly declare VMX file content as UTF-8 2010-10-15 17:51:28 +02:00
xml2vmx-serial-file.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2vmx-serial-network-client.vmx esx: Add VMCI device for virtualHW >= 7 2016-05-26 11:17:06 +02:00
xml2vmx-serial-network-client.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2vmx-serial-network-server.vmx esx: Add VMCI device for virtualHW >= 7 2016-05-26 11:17:06 +02:00
xml2vmx-serial-network-server.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2vmx-serial-pipe.vmx esx: Explictly declare VMX file content as UTF-8 2010-10-15 17:51:28 +02:00
xml2vmx-serial-pipe.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2vmx-sharedfolder.vmx vmx: handle shared folders formatting 2012-07-21 19:45:02 +02:00
xml2vmx-sharedfolder.xml vmx: handle shared folders formatting 2012-07-21 19:45:02 +02:00
xml2vmx-smbios.vmx esx: Support SMBIOS host mode 2010-11-11 19:18:19 +01:00
xml2vmx-smbios.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2vmx-svga.vmx vmx: Add support for video device VRAM size 2011-01-06 18:18:35 +01:00
xml2vmx-svga.xml xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xml2vmx-ws-in-the-wild-1.vmx esx: Add VMCI device for virtualHW >= 7 2016-05-26 11:17:06 +02:00
xml2vmx-ws-in-the-wild-1.xml vmx: Better Workstation vmx handling 2012-02-24 11:53:23 +01:00
xml2vmx-ws-in-the-wild-2.vmx esx: Add VMCI device for virtualHW >= 7 2016-05-26 11:17:06 +02:00
xml2vmx-ws-in-the-wild-2.xml vmx: Better Workstation vmx handling 2012-02-24 11:53:23 +01:00