OK, thank you.
----- Original Message -----
From: "Hendrik Schwartke" <hendrik(a)os-t.de>
To: "Laine Stump" <laine(a)laine.org>
Cc: libvirt-users(a)redhat.com, "Jianwei Hu" <jiahu(a)redhat.com>,
netcf-devel(a)lists.fedorahosted.org
Sent: Monday, June 23, 2014 7:32:59 PM
Subject: Re: [libvirt-users] [netcf]IFF_RUNNING flag on a bridge device
On 28.05.2014 15:27, Laine Stump wrote:
On 05/27/2014 09:07 AM, Jianwei Hu wrote:
> Hi All,
>
> I have one netcf question, please help me to resolve it, thanks.
>
> I can set a IFF_RUNNING flag to a bridge device which are no interface device
attached. What status of a flag on a bridge device in current kernel?(w/o interface), is
this a new change in kernel or other component? In netcf, but there is a patch to fix that
flag issue, I can't understand it.
>
> fix wrong status of bridge devices
> The IFF_RUNNING flag is not set on a bridge device if there are no devices attached
to it. So bridges without attached devices are reported as inactive. Destroying inactive
devices leads to an error and thus the device can't be removed (easily) from the
operating system. This patch checks if the device is a bridge and if so ignores the
IFF_RUNNING flag.
Well, I took the patch submitter (Hendrik Schwartke <hendrik(a)os-t.de>)
at his word about the brokenness, and the patch didn't *hurt* anything,
so I pushed it. But now that I try it out I see that, at least on the
kernel version in Fedora 20 (and RHEL6.6) IFF_RUNNING *is* set when a
bridge device is ifconfiged up.
Sorry for my late reply. I was on vacation. I saw
this behaviour on
Ubuntu 14.04. I think the kernel version was 3.13.0, but I'm not quite sure.
The IFF_RUNNING flag is not set on bridges without attached interfaces
even if the bridge is up.
So I'm not sure what had caused the original problem, maybe Hendrik can
eluminate us on that, but it makes sense (since the whole reason for
The problem is
that my application create bridge devices which are
connected to virtual machines. If all vms are destroyed then there are
no devices attached to the bridge anymore. Now I can't destroy the
bridge device because it seems already to be down. If I undefine the
bridge device netcf removes it from /etc/network/interfaces but doesn't
remove the actual device because netcf thinks it's already removed.
adding the check of IFF_RUNNING in the first place was to notice when
an
ethernet is unplugged, but a bridge is *never* plugged or unplugged in
the sense that we're looking for) and doesn't harm anything (and
apparently does fix something for Hendrik).
Yes, that's right. It doesn't
make any sense to check for IFF_RUNNING on
*bridges*. So I'm pretty sure that this patch doesn't harm anything.
BTW, when you have netcf-specific questions of patches, you can send
them to netcf-devel(a)lists.fedorahosted.org
--
Hendrik Schwartke
OpenSource Security Ralf Spenneberg
http://www.os-t.de
Am Bahnhof 3-5 48565 Steinfurt Germany
Fon: +49(0)2552 638 755 Fax: +49(0)2552 638 757