diff options
Diffstat (limited to 'libvirtxml.go')
| -rw-r--r-- | libvirtxml.go | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/libvirtxml.go b/libvirtxml.go index 6d8aee8..fe2d723 100644 --- a/libvirtxml.go +++ b/libvirtxml.go @@ -171,7 +171,7 @@ func clearEthernet(domcfg *libvirtxml.Domain) { } // add a new ethernet interface with mac assigned to bridge name -func addEthernet(domcfg *libvirtxml.Domain, mac string, brname string) { +func addEthernetBridge(domcfg *libvirtxml.Domain, mac string, brname string) { // Define a new disk with "mynew.qcow2" // type DomainInterfaceType string @@ -189,6 +189,29 @@ func addEthernet(domcfg *libvirtxml.Domain, mac string, brname string) { Model: &libvirtxml.DomainInterfaceModel{ Type: "virtio", }, + /* this is for raw tap. use this for people who don't + who don't have bridge groups or proper cluster backend networking + literally leaving this blank makes the interface 'tap0' + */ + // Target: &libvirtxml.DomainInterfaceTarget{ + // }, + } + + // Add the new disk to the domain configuration + domcfg.Devices.Interfaces = append(domcfg.Devices.Interfaces, newNet) +} + +// makes an ethernet interface with qemu on dom0 as 'tapXXX' +// doesn't require a bridge group or any changes to dom0 networking (probably) +func addEthernetTap(domcfg *libvirtxml.Domain, mac string) { + newNet := libvirtxml.DomainInterface{ + MAC: &libvirtxml.DomainInterfaceMAC{ + Address: mac, + }, + /* this is for raw tap. use this for people who don't + who don't have bridge groups or proper cluster backend networking + literally leaving this blank makes the interface 'tap0' + */ Target: &libvirtxml.DomainInterfaceTarget{ }, } |
