[PATCH 1/3] util: Change virMacAddrFormat to lowercase hex characters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The domain XML generator creates the mac addres strings with lowercase
strings with a separate piece of code. This patch changes the formating
helper to do the same stuff to allow using it to normalize a string
provided by the user. After this change some of the tests that are
outputing the mac address will need to be changed.
---
 src/util/virmacaddr.c                                | 2 +-
 tests/networkxml2xmlout/bandwidth-network.xml        | 2 +-
 tests/networkxml2xmlout/dhcp6host-routed-network.xml | 2 +-
 tests/networkxml2xmlout/empty-allow-ipv6.xml         | 2 +-
 tests/networkxml2xmlout/isolated-network.xml         | 2 +-
 tests/networkxml2xmlout/routed-network.xml           | 2 +-
 tests/xml2vmxdata/xml2vmx-esx-in-the-wild-1.vmx      | 2 +-
 tests/xml2vmxdata/xml2vmx-esx-in-the-wild-2.vmx      | 2 +-
 tests/xml2vmxdata/xml2vmx-esx-in-the-wild-3.vmx      | 2 +-
 tests/xml2vmxdata/xml2vmx-esx-in-the-wild-4.vmx      | 4 ++--
 tests/xml2vmxdata/xml2vmx-esx-in-the-wild-5.vmx      | 2 +-
 tests/xml2vmxdata/xml2vmx-esx-in-the-wild-6.vmx      | 2 +-
 tests/xml2vmxdata/xml2vmx-ethernet-generated.vmx     | 2 +-
 tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-1.vmx      | 2 +-
 tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-2.vmx      | 2 +-
 tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-3.vmx      | 4 ++--
 tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-4.vmx      | 2 +-
 tests/xml2vmxdata/xml2vmx-ws-in-the-wild-1.vmx       | 2 +-
 tests/xml2vmxdata/xml2vmx-ws-in-the-wild-2.vmx       | 2 +-
 19 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/src/util/virmacaddr.c b/src/util/virmacaddr.c
index 9d6ab7c..c4ca0a8 100644
--- a/src/util/virmacaddr.c
+++ b/src/util/virmacaddr.c
@@ -191,7 +191,7 @@ virMacAddrFormat(const virMacAddrPtr addr,
                  char *str)
 {
     snprintf(str, VIR_MAC_STRING_BUFLEN,
-             "%02X:%02X:%02X:%02X:%02X:%02X",
+             "%02x:%02x:%02x:%02x:%02x:%02x",
              addr->addr[0], addr->addr[1], addr->addr[2],
              addr->addr[3], addr->addr[4], addr->addr[5]);
     str[VIR_MAC_STRING_BUFLEN-1] = '\0';
diff --git a/tests/networkxml2xmlout/bandwidth-network.xml b/tests/networkxml2xmlout/bandwidth-network.xml
index 555ee18..c0c8ac3 100644
--- a/tests/networkxml2xmlout/bandwidth-network.xml
+++ b/tests/networkxml2xmlout/bandwidth-network.xml
@@ -3,7 +3,7 @@
   <uuid>986fed9e-a488-186d-ef2d-17ebfd1993f8</uuid>
   <forward mode='nat'/>
   <bridge name='virbr1' stp='on' delay='0' />
-  <mac address='52:54:00:E6:A2:C9'/>
+  <mac address='52:54:00:e6:a2:c9'/>
   <bandwidth>
     <inbound average='1000' peak='2000' burst='1024'/>
     <outbound average='2000'/>
diff --git a/tests/networkxml2xmlout/dhcp6host-routed-network.xml b/tests/networkxml2xmlout/dhcp6host-routed-network.xml
index 7305043..1d3035b 100644
--- a/tests/networkxml2xmlout/dhcp6host-routed-network.xml
+++ b/tests/networkxml2xmlout/dhcp6host-routed-network.xml
@@ -5,7 +5,7 @@
     <interface dev='eth1'/>
   </forward>
   <bridge name='virbr1' stp='on' delay='0' />
-  <mac address='12:34:56:78:9A:BC'/>
+  <mac address='12:34:56:78:9a:bc'/>
   <ip address='192.168.122.1' netmask='255.255.255.0'>
     <dhcp>
       <host mac='00:16:3e:77:e2:ed' name='a.example.com' ip='192.168.122.10' />
diff --git a/tests/networkxml2xmlout/empty-allow-ipv6.xml b/tests/networkxml2xmlout/empty-allow-ipv6.xml
index 6ee55ad..53e4fa7 100644
--- a/tests/networkxml2xmlout/empty-allow-ipv6.xml
+++ b/tests/networkxml2xmlout/empty-allow-ipv6.xml
@@ -2,5 +2,5 @@
   <name>empty</name>
   <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9c</uuid>
   <bridge name='virbr7' stp='on' delay='0' />
-  <mac address='52:54:00:17:3F:47'/>
+  <mac address='52:54:00:17:3f:47'/>
 </network>
diff --git a/tests/networkxml2xmlout/isolated-network.xml b/tests/networkxml2xmlout/isolated-network.xml
index cc320a9..9ff1f55 100644
--- a/tests/networkxml2xmlout/isolated-network.xml
+++ b/tests/networkxml2xmlout/isolated-network.xml
@@ -2,7 +2,7 @@
   <name>private</name>
   <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9b</uuid>
   <bridge name='virbr2' stp='on' delay='0' />
-  <mac address='52:54:00:17:3F:37'/>
+  <mac address='52:54:00:17:3f:37'/>
   <ip address='192.168.152.1' netmask='255.255.255.0'>
     <dhcp>
       <range start='192.168.152.2' end='192.168.152.254' />
diff --git a/tests/networkxml2xmlout/routed-network.xml b/tests/networkxml2xmlout/routed-network.xml
index 9235e15..cb81bae 100644
--- a/tests/networkxml2xmlout/routed-network.xml
+++ b/tests/networkxml2xmlout/routed-network.xml
@@ -5,7 +5,7 @@
     <interface dev='eth1'/>
   </forward>
   <bridge name='virbr1' stp='on' delay='0' />
-  <mac address='12:34:56:78:9A:BC'/>
+  <mac address='12:34:56:78:9a:bc'/>
   <ip address='192.168.122.1' netmask='255.255.255.0'>
   </ip>
 </network>
diff --git a/tests/xml2vmxdata/xml2vmx-esx-in-the-wild-1.vmx b/tests/xml2vmxdata/xml2vmx-esx-in-the-wild-1.vmx
index 9059197..b2b5668 100644
--- a/tests/xml2vmxdata/xml2vmx-esx-in-the-wild-1.vmx
+++ b/tests/xml2vmxdata/xml2vmx-esx-in-the-wild-1.vmx
@@ -18,4 +18,4 @@ ethernet0.present = "true"
 ethernet0.networkName = "VM Network"
 ethernet0.connectionType = "bridged"
 ethernet0.addressType = "vpx"
-ethernet0.generatedAddress = "00:50:56:91:48:C7"
+ethernet0.generatedAddress = "00:50:56:91:48:c7"
diff --git a/tests/xml2vmxdata/xml2vmx-esx-in-the-wild-2.vmx b/tests/xml2vmxdata/xml2vmx-esx-in-the-wild-2.vmx
index 68f069b..a0199cc 100644
--- a/tests/xml2vmxdata/xml2vmx-esx-in-the-wild-2.vmx
+++ b/tests/xml2vmxdata/xml2vmx-esx-in-the-wild-2.vmx
@@ -37,5 +37,5 @@ ethernet0.virtualDev = "vlance"
 ethernet0.networkName = "VM Network"
 ethernet0.connectionType = "bridged"
 ethernet0.addressType = "generated"
-ethernet0.generatedAddress = "00:0C:29:3C:98:3E"
+ethernet0.generatedAddress = "00:0c:29:3c:98:3e"
 ethernet0.generatedAddressOffset = "0"
diff --git a/tests/xml2vmxdata/xml2vmx-esx-in-the-wild-3.vmx b/tests/xml2vmxdata/xml2vmx-esx-in-the-wild-3.vmx
index e09c694..4ab2574 100644
--- a/tests/xml2vmxdata/xml2vmx-esx-in-the-wild-3.vmx
+++ b/tests/xml2vmxdata/xml2vmx-esx-in-the-wild-3.vmx
@@ -23,5 +23,5 @@ ethernet0.present = "true"
 ethernet0.networkName = "VM Network"
 ethernet0.connectionType = "bridged"
 ethernet0.addressType = "generated"
-ethernet0.generatedAddress = "00:0C:29:F5:C3:0C"
+ethernet0.generatedAddress = "00:0c:29:f5:c3:0c"
 ethernet0.generatedAddressOffset = "0"
diff --git a/tests/xml2vmxdata/xml2vmx-esx-in-the-wild-4.vmx b/tests/xml2vmxdata/xml2vmx-esx-in-the-wild-4.vmx
index 504997f..a2d679f 100644
--- a/tests/xml2vmxdata/xml2vmx-esx-in-the-wild-4.vmx
+++ b/tests/xml2vmxdata/xml2vmx-esx-in-the-wild-4.vmx
@@ -18,12 +18,12 @@ ethernet0.present = "true"
 ethernet0.networkName = "VM Network"
 ethernet0.connectionType = "bridged"
 ethernet0.addressType = "vpx"
-ethernet0.generatedAddress = "00:50:56:91:66:D4"
+ethernet0.generatedAddress = "00:50:56:91:66:d4"
 ethernet1.present = "true"
 ethernet1.networkName = "VM Switch 2"
 ethernet1.connectionType = "bridged"
 ethernet1.addressType = "vpx"
-ethernet1.generatedAddress = "00:50:56:91:0C:51"
+ethernet1.generatedAddress = "00:50:56:91:0c:51"
 serial0.present = "true"
 serial0.fileType = "file"
 serial0.fileName = "/vmfs/volumes/498076b2-02796c1a-ef5b-000ae484a6a3/virtMonServ1/serial1.file"
diff --git a/tests/xml2vmxdata/xml2vmx-esx-in-the-wild-5.vmx b/tests/xml2vmxdata/xml2vmx-esx-in-the-wild-5.vmx
index 2e3b856..192867e 100644
--- a/tests/xml2vmxdata/xml2vmx-esx-in-the-wild-5.vmx
+++ b/tests/xml2vmxdata/xml2vmx-esx-in-the-wild-5.vmx
@@ -24,4 +24,4 @@ ethernet0.virtualDev = "e1000"
 ethernet0.networkName = "VM-LAN"
 ethernet0.connectionType = "bridged"
 ethernet0.addressType = "vpx"
-ethernet0.generatedAddress = "00:50:56:BE:00:15"
+ethernet0.generatedAddress = "00:50:56:be:00:15"
diff --git a/tests/xml2vmxdata/xml2vmx-esx-in-the-wild-6.vmx b/tests/xml2vmxdata/xml2vmx-esx-in-the-wild-6.vmx
index 1f29ae5..bc6a835 100644
--- a/tests/xml2vmxdata/xml2vmx-esx-in-the-wild-6.vmx
+++ b/tests/xml2vmxdata/xml2vmx-esx-in-the-wild-6.vmx
@@ -21,6 +21,6 @@ ethernet0.virtualDev = "vmxnet3"
 ethernet0.networkName = "VM Network"
 ethernet0.connectionType = "bridged"
 ethernet0.addressType = "generated"
-ethernet0.generatedAddress = "00:0C:29:2C:3A:FC"
+ethernet0.generatedAddress = "00:0c:29:2c:3a:fc"
 ethernet0.generatedAddressOffset = "0"
 svga.vramSize = "8388608"
diff --git a/tests/xml2vmxdata/xml2vmx-ethernet-generated.vmx b/tests/xml2vmxdata/xml2vmx-ethernet-generated.vmx
index 4f5c47b..18a6b67 100644
--- a/tests/xml2vmxdata/xml2vmx-ethernet-generated.vmx
+++ b/tests/xml2vmxdata/xml2vmx-ethernet-generated.vmx
@@ -12,5 +12,5 @@ ethernet0.present = "true"
 ethernet0.networkName = "VM Network"
 ethernet0.connectionType = "bridged"
 ethernet0.addressType = "generated"
-ethernet0.generatedAddress = "00:0C:29:11:22:33"
+ethernet0.generatedAddress = "00:0c:29:11:22:33"
 ethernet0.generatedAddressOffset = "0"
diff --git a/tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-1.vmx b/tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-1.vmx
index 48476d6..9893595 100644
--- a/tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-1.vmx
+++ b/tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-1.vmx
@@ -16,5 +16,5 @@ ethernet0.networkName = "net1"
 ethernet0.connectionType = "custom"
 ethernet0.vnet = "/dev/vmnet1"
 ethernet0.addressType = "generated"
-ethernet0.generatedAddress = "00:0C:29:D6:2B:D3"
+ethernet0.generatedAddress = "00:0c:29:d6:2b:d3"
 ethernet0.generatedAddressOffset = "0"
diff --git a/tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-2.vmx b/tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-2.vmx
index 757083a..c597807 100644
--- a/tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-2.vmx
+++ b/tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-2.vmx
@@ -16,5 +16,5 @@ ethernet0.networkName = "net1"
 ethernet0.connectionType = "custom"
 ethernet0.vnet = "/dev/vmnet1"
 ethernet0.addressType = "generated"
-ethernet0.generatedAddress = "00:0C:29:D6:CB:A4"
+ethernet0.generatedAddress = "00:0c:29:d6:cb:a4"
 ethernet0.generatedAddressOffset = "0"
diff --git a/tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-3.vmx b/tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-3.vmx
index 74cd47d..a07ecfe 100644
--- a/tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-3.vmx
+++ b/tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-3.vmx
@@ -16,12 +16,12 @@ ethernet0.networkName = "net1"
 ethernet0.connectionType = "custom"
 ethernet0.vnet = "/dev/vmnet1"
 ethernet0.addressType = "generated"
-ethernet0.generatedAddress = "00:0C:29:C4:BE:5A"
+ethernet0.generatedAddress = "00:0c:29:c4:be:5a"
 ethernet0.generatedAddressOffset = "0"
 ethernet1.present = "true"
 ethernet1.networkName = "net2"
 ethernet1.connectionType = "custom"
 ethernet1.vnet = "/dev/vmnet2"
 ethernet1.addressType = "generated"
-ethernet1.generatedAddress = "00:0C:29:C4:BE:64"
+ethernet1.generatedAddress = "00:0c:29:c4:be:64"
 ethernet1.generatedAddressOffset = "0"
diff --git a/tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-4.vmx b/tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-4.vmx
index c9da229..1361954 100644
--- a/tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-4.vmx
+++ b/tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-4.vmx
@@ -16,5 +16,5 @@ ethernet0.networkName = "net2"
 ethernet0.connectionType = "custom"
 ethernet0.vnet = "/dev/vmnet2"
 ethernet0.addressType = "generated"
-ethernet0.generatedAddress = "00:0C:29:C5:E3:5D"
+ethernet0.generatedAddress = "00:0c:29:c5:e3:5d"
 ethernet0.generatedAddressOffset = "0"
diff --git a/tests/xml2vmxdata/xml2vmx-ws-in-the-wild-1.vmx b/tests/xml2vmxdata/xml2vmx-ws-in-the-wild-1.vmx
index 539a371..4211a67 100644
--- a/tests/xml2vmxdata/xml2vmx-ws-in-the-wild-1.vmx
+++ b/tests/xml2vmxdata/xml2vmx-ws-in-the-wild-1.vmx
@@ -17,6 +17,6 @@ ethernet0.present = "true"
 ethernet0.virtualDev = "e1000"
 ethernet0.connectionType = "nat"
 ethernet0.addressType = "static"
-ethernet0.address = "00:90:B9:DC:EA:81"
+ethernet0.address = "00:90:b9:dc:ea:81"
 ethernet0.checkMACAddress = "false"
 svga.vramSize = "4194304"
diff --git a/tests/xml2vmxdata/xml2vmx-ws-in-the-wild-2.vmx b/tests/xml2vmxdata/xml2vmx-ws-in-the-wild-2.vmx
index 7035ac3..ad68df9 100644
--- a/tests/xml2vmxdata/xml2vmx-ws-in-the-wild-2.vmx
+++ b/tests/xml2vmxdata/xml2vmx-ws-in-the-wild-2.vmx
@@ -17,6 +17,6 @@ ethernet0.present = "true"
 ethernet0.virtualDev = "e1000"
 ethernet0.connectionType = "bridged"
 ethernet0.addressType = "static"
-ethernet0.address = "00:90:B9:DC:EA:81"
+ethernet0.address = "00:90:b9:dc:ea:81"
 ethernet0.checkMACAddress = "false"
 svga.vramSize = "4194304"
-- 
1.8.1.5

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux