sipb-xen-losetup: a half-sane way to use losetup
You should use this instead of plain losetup; everything that uses this will at least not have races with other things using this.
If it's missing a feature (e.g. a losetup argument) you want, it shouldn't be hard to add.