On Thu, Jun 21, 2012 at 12:16:17PM +0100, Roger Pau Monne wrote:
As I said on a previous email, how can you guarantee that the name
you chose and pass to Qemu will not be taken by someone else while
you are calling Qemu?
You might even be launching several guests at the same time, which
will lead you to a race.
This is a problem with name, but not if you use the fd-type setup:
- xl opens /dev/tap, which creates the tap device (so xl knows the name) and
a file descriptor (which I'll call n)
- fork and exec qemu with: -net tap,vlan=0,fd=n
- the xl parent process closes n.
in this setup, qemu reuses the already-existing tape device and doesn't
create a new one, so no race condition possible here.
This should fix the problem.