in the /etc/xen/scripts/block script it creates the loopback device twice
First it does it with losetup /dev/loopx /some-image
Then if you want read-only it does
losetup -r /dev/loopx /some-image
and this second one fails cause the first one already mounted it read/write.
The issue is very simple:
in the /etc/xen/ scripts/ block script it creates the loopback device twice
First it does it with losetup /dev/loopx /some-image
Then if you want read-only it does
losetup -r /dev/loopx /some-image
and this second one fails cause the first one already mounted it read/write.