[libvirt] [PATCH] macvtap teardown rework

Ed Swierk eswierk at aristanetworks.com
Wed Feb 17 23:22:05 UTC 2010


On Wed, Feb 17, 2010 at 12:05 PM, Stefan Berger <stefanb at us.ibm.com> wrote:
> I have reworked and simplified the teardown of the macvtap device.
> Basically all devices with the same MAC address and link device are kept
> alive and not attempted to be torn down. If a macvtap device linked to a
> physical interface with a certain MAC address 'M' is to be created it
> will automatically fail if the interface is 'up'ed and another macvtap
> with the same properties (MAC addr 'M', link dev) happens to be 'up'.
> This will prevent the VM from starting or the device from being attached
> to a running VM. Stale interfaces are assumed to be there for some
> reason and not stem from libvirt.
>
> In the VM shutdown path I am assuming that an interface name is always
> available so that if the device type is DIRECT it can be torn down using
> its name.

This is a huge improvement. It makes the normal shutdown path nice and
simple, and returns a clear error message instead of making an
elaborate attempt to work around a prior unclean shutdown.

Just one cosmetic nit: the "name" argument in the delMacvtap()
declaration in macvtap.h should be "ifname" for consistency with the
definition in macvtap.c.

--Ed




More information about the libvir-list mailing list