qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] File descriptor "leak" through /etc/qemu-ifup script


From: Alain Knaff (qemu)
Subject: [Qemu-devel] File descriptor "leak" through /etc/qemu-ifup script
Date: Mon, 10 Sep 2007 01:14:08 +0200
User-agent: Thunderbird 2.0.0.6 (X11/20070830)

Qemu does not close its filedescriptors (or setting the FD_CLOEXEC) when invoking the /etc/qemu-ifup script.

Hence any background process spawned from there (such as a dhcpd) will also inherit the open filedescriptor, preventing the relevant decide (/dev/net/tup) to be reused later on:

If for example you chose a fixed network name using the -net ...ifname= option and have an /etc/init.d/dhcp start in your if-up qemu (in order to instruct dhcpd to handle the new interface), the newly spawned dhcp will inherit the filedescriptor controlling the tun device, a continue hogging it even after the qemu is stopped, and is started again.

Workaround:

Putting the following into the script:
exec 3>/dev/null
exec 4>/dev/null
exec 5>/dev/null
exec 6>/dev/null


But a cleaner solution would be if qemu itself was careful not to leak those descriptors in the first place.

Thanks,

Alain




reply via email to

[Prev in Thread] Current Thread [Next in Thread]