Skip to content

Commit

Permalink
libvirt: handle both tun and tuntap interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
lebauce committed Jul 17, 2021
1 parent 7dcdeac commit 4d1abf3
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions topology/probes/libvirt/libvirt.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@ import (
"strings"
"sync"

libvirt "github.com/digitalocean/go-libvirt"

"github.com/skydive-project/skydive/graffiti/filters"
"github.com/skydive-project/skydive/graffiti/graph"
"github.com/skydive-project/skydive/probe"
"github.com/skydive-project/skydive/topology"
"github.com/skydive-project/skydive/topology/probes"

libvirt "github.com/digitalocean/go-libvirt"
"github.com/skydive-project/skydive/graffiti/graph"
tp "github.com/skydive-project/skydive/topology/probes"
)

Expand Down Expand Up @@ -411,8 +412,12 @@ func (probe *Probe) Do(ctx context.Context, wg *sync.WaitGroup) error {
func NewProbe(ctx tp.Context, bundle *probe.Bundle) (probe.Handler, error) {
uri := ctx.Config.GetString("agent.topology.libvirt.url")
probe := &Probe{
Ctx: ctx,
tunProcessor: graph.NewProcessor(ctx.Graph, ctx.Graph, graph.Metadata{"Type": "tun"}, "Name"),
Ctx: ctx,
tunProcessor: graph.NewProcessor(ctx.Graph, ctx.Graph, graph.NewElementFilter(
filters.NewOrFilter(
filters.NewTermStringFilter("Type", "tun"),
filters.NewTermStringFilter("Type", "tuntap"),
)), "Name"),
interfaceMap: make(map[string]*Interface),
uri: uri,
}
Expand Down

0 comments on commit 4d1abf3

Please sign in to comment.