mirage / xen-arm-builder

Archived - the Xen and ARM support in MirageOS has been superseeded by our PVH support - Build an SDcard image for Xen/ARM, for a Cubieboard
ISC License
57 stars 36 forks source link

Cannot find block device on ARM #47

Closed heidihoward closed 9 years ago

heidihoward commented 9 years ago

The block example from the mirage hello world tutorial cannot find the attached block device (see error below). I am using losetup due to the issues with qemu on ARM, this is a cubieboard2 setup with xen-arm-builder.

the error:

Block.connect /home/mirage/mirage-skeleton/block/disk.img: unable to match '/home/mirage/mirage-skeleton/block/disk.img' to any available devices [ 51713 ]
Block.connect /home/mirage/mirage-skeleton/block/disk.img: could not find device
Fatal error: exception Failure("block1")
Raised at file "src/core/lwt.ml", line 788, characters 22-23
Called from file "main.ml", line 31, characters 2-28
Mirage exiting with status 2
Do_exit called!

the disk seems to be in the correct location

$ sudo losetup -a
/dev/loop0: [b302]:135689 (/home/mirage/mirage-skeleton/block/disk.img)

and cat dev/loop0 returns the expected output.

This is block_test.xl

cat block_test.xl
# Generated by Mirage (Fri, 23 Jan 2015 12:13:00 GMT).

name = 'block_test'
kernel = '/home/mirage/mirage-skeleton/block/mir-block_test.xen'
builder = 'linux'
memory = 256
on_crash = 'preserve'

# You must define the network and block interfaces manually.

# The disk configuration is defined here:
# http://xenbits.xen.org/docs/4.3-testing/misc/xl-disk-configuration.txt
# An example would look like:
disk = [ '/dev/loop0,,xvda1,w' ]

Also the terminal hangs after Do_exit is called until I call xl destroy in another terminal, I would be nice if it exited itself.

talex5 commented 9 years ago

Use CTRL-] to disconnect the console (it if exited by itself, you wouldn't be able to see the error).

Anyway, you need to use the xvda1 block name in the config file, not the file you used for the loopback device (which is private to dom0). See:

http://lists.xenproject.org/archives/html/mirageos-devel/2015-01/msg00112.html

If you want to update the Mirage skeleton example to do the right thing on Xen and Unix, that would be good...

heidihoward commented 9 years ago

works perfectly, put in PR for fix to stop beginners in mirage-skeleton getting tripped up