Skip to content

Commit

Permalink
Use constant for domain mac address
Browse files Browse the repository at this point in the history
Now that we don't use a string template to define the domain, we can
extract this constant out of the domain definition.
  • Loading branch information
cfergeau authored and guillaumerose committed Nov 4, 2020
1 parent 2473eac commit f44d684
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/libvirt/domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import (
libvirtxml "github.com/libvirt/libvirt-go-xml"
)

const macAddress = "52:fd:fc:07:21:82"

func domainXML(d *Driver) (string, error) {
domain := libvirtxml.Domain{
Type: "kvm",
Expand Down Expand Up @@ -102,7 +104,7 @@ func domainXML(d *Driver) (string, error) {
domain.Devices.Interfaces = []libvirtxml.DomainInterface{
{
MAC: &libvirtxml.DomainInterfaceMAC{
Address: "52:fd:fc:07:21:82",
Address: macAddress,
},
Source: &libvirtxml.DomainInterfaceSource{
Network: &libvirtxml.DomainInterfaceSourceNetwork{
Expand Down

0 comments on commit f44d684

Please sign in to comment.