]> git.ipfire.org Git - thirdparty/libvirt.git/commit
netdev: fail when setting up an SRIOV VF if PF is offline
authorLaine Stump <laine@laine.org>
Tue, 5 May 2015 22:27:47 +0000 (18:27 -0400)
committerLaine Stump <laine@laine.org>
Fri, 22 May 2015 14:12:39 +0000 (10:12 -0400)
commit474523fa2c67566bb61807fd413e5efc5f3510cb
tree4de3f97c7d020d9779728b19983f3d0a4d9befed
parentc4d27bdddf23e4026c2b96ff8dfc8a1dec3b8d29
netdev: fail when setting up an SRIOV VF if PF is offline

If an SRIOV PF is offline, the kernel won't complain if you set the
mac address and vlan tag for a VF via this PF, and it will even let
you assign the VF to a guest using PCI device assignment or macvtap
passthrough. But in this case (the PF isn't online), the device won't
be usable in the guest.

Silently setting the PF online would solve the connectivity problem,
but as pointed out by Dan Berrange, when an interface is set online
with no associated config, the kernel will by default turn on IPv6
autoconf, which could create unexpected security problems for the
host. For this reason, this patch instead logs an error and fails the
operation.

This resolves: https://bugzilla.redhat.com/show_bug.cgi?id=893738

Originally filed against RHEL6, but present in every version of
libvirt until today.
src/util/virnetdev.c