I have checked and I definitely have the correct kernel configuration for my domU (including the block frontend driver).

On further investigation, it seems that the file block-device backend driver or something isn't working. In dom0, when I run

Code:

xl block-attach Domain-0 file:/home/data/xen/megatron/root.img xvda w

I can see the output when I run "xl block-list Domain-0". /dev/xvda is missing and dmesg shows nothing. However, when I create a loop device with losetup and run block-attach with phy:/dev/loop1, xl block-attach creates /dev/xvda which I can then mount successfully.

Has anyone else run into this? I'm not sure if file-backend disk support has changed in Xen 4.2 / newer Linux kernel versions, if I have bad configuration somewhere, or if this is a bug in Xen.

----------------------

I found the solution, which was that I didn't have CONFIG_XEN_GNTDEV=y set in my kernel configuration.

I have also noticed that if I enable CONFIG_XEN_NETDEV_FRONTEND=y in the dom0 kernel, domUs don't see their network interfaces (even though they're created and visible on dom0). Strange.

I had CONFIG_XEN_GNTDEV=y in the kernel on Dom0, and loaded the module, but the problem was not solved. If I added the block device dynamically, then nothing happened, and no error was logged anywhere (I looked at). But when I added the block device in the config, it complained about qemu-dm executable missing. So I enabled the qemu use flag for 'app-emulation/xen-tools-4.2.1-r1' and now it seems to work fine.