losetup -f finds an unused loop device.
[invirt/packages/invirt-xen-config.git] / files / usr / sbin / qemu-dm-sipb
1 #!/bin/sh
2 domid=
3 for i; do
4     if [ "$domid" = "_NEXT_" ]; then
5         domid=$i
6         break
7     elif [ "$i" = "-d" ]; then
8         domid=_NEXT_
9     fi
10 done
11 export domid
12 echo 'BEGIN qemu-dm-sipb LOG' >> /tmp/log
13 echo "$0 $@" >> /tmp/log
14 env >> /tmp/log
15 echo 'END qemu-dm-sipb LOG' >> /tmp/log
16 exec "/usr/lib/xen-$(/usr/lib/xen-common/bin/xen-utils-version -q)/bin/qemu-dm" "$@"