diff options
author | Stefan Berger <stefanb@linux.vnet.ibm.com> | 2012-07-17 08:07:59 -0400 |
---|---|---|
committer | Stefan Berger <stefanb@us.ibm.com> | 2012-07-17 08:07:59 -0400 |
commit | 387117ad920dd949c55f0621fe649008f8401017 (patch) | |
tree | 26446221490061b103116d63b167d2e4e79db812 /src/vbox | |
parent | qemu: Do not fail virConnectCompareCPU if host CPU is not known (diff) | |
download | libvirt-387117ad920dd949c55f0621fe649008f8401017.tar.gz libvirt-387117ad920dd949c55f0621fe649008f8401017.tar.bz2 libvirt-387117ad920dd949c55f0621fe649008f8401017.zip |
Convert 'raw MAC address' usages to use virMacAddr
Introduce new members in the virMacAddr 'class'
- virMacAddrSet: set virMacAddr from a virMacAddr
- virMacAddrSetRaw: setting virMacAddr from raw 6 byte MAC address buffer
- virMacAddrGetRaw: writing virMacAddr into raw 6 byte MAC address buffer
- virMacAddrCmp: comparing two virMacAddr
- virMacAddrCmpRaw: comparing a virMacAddr with a raw 6 byte MAC address buffer
then replace raw MAC addresses by replacing
- 'unsigned char *' with virMacAddrPtr
- 'unsigned char ... [VIR_MAC_BUFLEN]' with virMacAddr
and introduce usage of above functions where necessary.
Diffstat (limited to 'src/vbox')
-rw-r--r-- | src/vbox/vbox_tmpl.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c index ba7552c93..e0e6db781 100644 --- a/src/vbox/vbox_tmpl.c +++ b/src/vbox/vbox_tmpl.c @@ -3038,7 +3038,7 @@ sharedFoldersCleanup: MACAddress[8], MACAddress[9], MACAddress[10], MACAddress[11]); /* XXX some real error handling here some day ... */ - if (virMacAddrParse(macaddr, def->nets[netAdpIncCnt]->mac) < 0) + if (virMacAddrParse(macaddr, &def->nets[netAdpIncCnt]->mac) < 0) {} netAdpIncCnt++; @@ -4387,15 +4387,15 @@ vboxAttachNetwork(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine) char macaddr[VIR_MAC_STRING_BUFLEN] = {0}; char macaddrvbox[VIR_MAC_STRING_BUFLEN - 5] = {0}; - virMacAddrFormat(def->nets[i]->mac, macaddr); + virMacAddrFormat(&def->nets[i]->mac, macaddr); snprintf(macaddrvbox, VIR_MAC_STRING_BUFLEN - 5, "%02X%02X%02X%02X%02X%02X", - def->nets[i]->mac[0], - def->nets[i]->mac[1], - def->nets[i]->mac[2], - def->nets[i]->mac[3], - def->nets[i]->mac[4], - def->nets[i]->mac[5]); + def->nets[i]->mac.addr[0], + def->nets[i]->mac.addr[1], + def->nets[i]->mac.addr[2], + def->nets[i]->mac.addr[3], + def->nets[i]->mac.addr[4], + def->nets[i]->mac.addr[5]); macaddrvbox[VIR_MAC_STRING_BUFLEN - 6] = '\0'; VIR_DEBUG("NIC(%d): Type: %d", i, def->nets[i]->type); |