]> xenbits.xensource.com Git - libvirt.git/commit
util: new function virNetDevMacVLanIsMacvtap()
authorLaine Stump <laine@redhat.com>
Mon, 26 Aug 2019 05:24:08 +0000 (01:24 -0400)
committerLaine Stump <laine@redhat.com>
Mon, 9 Sep 2019 18:29:33 +0000 (14:29 -0400)
commit1b46566eed0c9c23251d05c8fedb3522d711f5c0
tree8ca01acfef6816577283d151756039c5617a143a
parent4ef4ba49742292f7fef908bf9fa31f567c093e1b
util: new function virNetDevMacVLanIsMacvtap()

This function returns T if the given name is a macvtap device. This is
determined by 1) getting the ifindex of the device with that name (if
there is one), and 2) checking for existence of /dev/tapXX, where "XX"
is the ifindex learned in (1).

It's also possible to learn this by getting a netlink dump of the
interface and parsing through it to look for some attributes, but that
is complicated to figure out, takes longer to execute, and I'm lazy.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
src/libvirt_private.syms
src/util/virnetdevmacvlan.c
src/util/virnetdevmacvlan.h