I have a following /etc/qemu-ifup script which is executed when I start /usr/bin/qemu-system-i386 binary:#!/bin/shset -xswitch=br0if [ -n $1 ];then        /usr/sbin/tunctl -u `whoami` -t $1        /sbin/ip link set dev $1 up        sleep 0.5s        /sbin/brctl addif $switch $1        exit 0else        echo Error: no interface specified        exit 1fiThe problem is, that tunctl complains that device or resource is busy:root@VM-host:~# qemu -hda /root/1.raw -device e1000,netdev=net0,mac=DE:AD:BE:EF:69:01 -netdev tap,id=net0 -display vnc=:1+ switch=br0+ [ -n tap0 ]+ whoami+ /usr/sbin/tunctl -u root -t tap0TUNSETIFF: Device or resource busy+ /sbin/ip link set dev tap0 up sleep 0.5sError: either dev is duplicate, or sleep is a garbage.+ /sbin/brctl addif br0 tap0+ exit 0When I execute simply the /usr/sbin/tunctl -u root -t tap0, then tap0 is created without any issues:root@VM-host:~# /usr/sbin/tunctl -u root -t tap0Set 'tap0' persistent and owned by uid 0root@VM-host:~# Any ideas what causes such behavior?
tunctl complains that device or resource is busy if used in /etc/qemu-ifup script
qemu