#!/bin/sh
domid=
for i; do
    if [ "$domid" = "_NEXT_" ]; then
	domid=$i
	break
    elif [ "$i" = "-d" ]; then
	domid=_NEXT_
    fi
done
export domid
echo 'BEGIN qemu-dm-sipb LOG' >> /tmp/log
echo "$0 $@" >> /tmp/log
env >> /tmp/log
echo 'END qemu-dm-sipb LOG' >> /tmp/log
exec "/usr/lib/xen/bin/qemu-dm.debug" "$@"
