]> git.ipfire.org Git - thirdparty/libvirt.git/commit
util: netdevbridge: fall back to ioctl from sysfs
authorChristian Ehrhardt <christian.ehrhardt@canonical.com>
Tue, 20 Nov 2018 07:55:49 +0000 (08:55 +0100)
committerChristian Ehrhardt <christian.ehrhardt@canonical.com>
Mon, 26 Nov 2018 06:49:57 +0000 (07:49 +0100)
commit6aa75b94627c9ad3bf6a836cc821750979a2fe05
treed351b168be45a538e69dd24d302f85835a606064
parentfd54e4fdc82050f97cbf48add3975db7e2ca09be
util: netdevbridge: fall back to ioctl from sysfs

There are certain cases e.g. containers where the sysfs path might
exists, but might fail. Unfortunately the exact restrictions are only
known to libvirt when trying to write to it so we need to try it.

But in case it fails there is no need to fully abort, in those cases try
to fall back to the older ioctl interface which can still work.

That makes setting up a bridge in unprivileged LXD containers work.

Fixes: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1802906
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Laine Stump <laine@laine.org>
Reported-by: Brian Candler <b.candler@pobox.com>
src/util/virnetdevbridge.c