util: Change virMacAddrFormat to lowercase hex characters

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.
This commit is contained in:
Peter Krempa 2013-03-26 11:45:29 +01:00
parent f84b92ea19
commit ab4bf20ead
19 changed files with 21 additions and 21 deletions

View File

@ -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';

View File

@ -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'/>

View File

@ -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' />

View File

@ -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>

View File

@ -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' />

View File

@ -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>

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"