[libvirt] [PATCH 1/3] Close fd's of persistent tap devices

When passing a NULL tapfd argument to brAddTap, we need to close the fd of the tap device. If we don't, libvirt will keep the fd open indefinitely and renders the the guest unable to configure its side of the tap device. Signed-off-by: Soren Hansen <soren@linux2go.dk> --- src/util/bridge.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/src/util/bridge.c b/src/util/bridge.c index 7d0caae..da62c5e 100644 --- a/src/util/bridge.c +++ b/src/util/bridge.c @@ -538,6 +538,8 @@ brAddTap(brControl *ctl, goto error; if (tapfd) *tapfd = fd; + else + close(fd); return 0; error: -- 1.7.0.4

On 08/11/2010 03:51 PM, Soren Hansen wrote:
When passing a NULL tapfd argument to brAddTap, we need to close the fd of the tap device. If we don't, libvirt will keep the fd open indefinitely and renders the the guest unable to configure its side of the tap device.
Signed-off-by: Soren Hansen <soren@linux2go.dk> --- src/util/bridge.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/src/util/bridge.c b/src/util/bridge.c index 7d0caae..da62c5e 100644 --- a/src/util/bridge.c +++ b/src/util/bridge.c @@ -538,6 +538,8 @@ brAddTap(brControl *ctl, goto error; if (tapfd) *tapfd = fd; + else + close(fd);
ACK; applied. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org
participants (2)
-
Eric Blake
-
Soren Hansen