summaryrefslogtreecommitdiff
path: root/libvirtxml.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-10-26 02:42:12 -0500
committerJeff Carr <[email protected]>2024-10-26 02:42:12 -0500
commit30884aff3b44632ddaa8b7490a20642869bf75ad (patch)
treeeed2f12de364df06705dd3ff3b623fd6b5bb722c /libvirtxml.go
parentf42091a2ce37f54bb8ad365b31ae2395a9af1372 (diff)
seperate tap and bridge group add network functions
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'libvirtxml.go')
-rw-r--r--libvirtxml.go25
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{
},
}