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>
This commit is contained in:
Soren Hansen 2010-08-11 23:51:41 +02:00 committed by Eric Blake
parent 3ad8cbd3be
commit 4358f76aa4

View File

@ -538,6 +538,8 @@ brAddTap(brControl *ctl,
goto error; goto error;
if (tapfd) if (tapfd)
*tapfd = fd; *tapfd = fd;
else
close(fd);
return 0; return 0;
error: error: