Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 459082 - >=app-emulation/xen-tools-4.2.1 xl cannot read file:/*.img HD's (phy:/* seems fine)
Summary: >=app-emulation/xen-tools-4.2.1 xl cannot read file:/*.img HD's (phy:/* seems...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Ian Delaney (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-24 23:02 UTC by Travis Osterman
Modified: 2013-05-15 08:41 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Travis Osterman 2013-02-24 23:02:23 UTC
After upgrading app-emulation/xen app-emulation/xen-tools from 4.1 to 4.2, guests that previous worked without issue no longer seem able to read the file:/*.img files.

When I mount the image file via loopback, and move the kernel and initrd to dom0, the guest boots normally.  Here are the changes needed.

/data/xen/prime.pv
(-)disk = ['file:/data/xen/prime.img,xvda,w']
(+)disk = ['phy:/dev/loop0p2,xvda,w']
(-)kernel = "/usr/lib/xen/boot/pv-grub-x86_64.gz"
(+)kernel = "/data/xen/kernel-genkernel-x86_64-3.7.5-hardened-2013-02-18-1632"
(+)ramdisk = "/data/xen/initramfs-genkernel-x86_64-3.7.5-hardened-2013-02-18-1632"

Here is the full error I get when pvgrub tries to use the image files.
xl -vvv create -c /data/xen/prime.pv
http://pastebin.com/92PW3QRH

Reproducible: Always

Steps to Reproduce:
1. dd if=/dev/zero of=/root/hd.img bs=512 count=0 seek=4M
2. losetup /dev/loop0 /root/hd.img
3. fdisk /dev/loop0 (create part 1 for ext2 boot and part 2 for root ext4)
4. partprobe /dev/loop0
5. mkfs.ext2 /dev/loop0p1
6. mkfs.ext4 /dev/loop0p2
7. mount /dev/loop0p2 /mnt/gentoo && mkdir /mnt/gentoo/boot
8. mount /dev/loop0p1 /mnt/gentoo/boot
9. copy or create filesystem (optional copy kernel and initrd to host)
10. umount /mnt/gentoo{/boot,/}
11. losetup -d /dev/loop0
12. try to boot via pvgrub or using copied kernel and initrd with disk = ['file:/root/hd.img,xvda,w']
13. repeat steps 2 & 4 then boot with disk = ['phy:/dev/loop0p2,xvda,w']
Actual Results:  
Fails to boot but can access shell where no /dev/xvd? or /dev/sd? is listed.  When booting from physical device, /dev/xvd? is appropriately created.

Expected Results:  
There should be no change is ability to read file:/*.img files in xen-tools 4.2

emerge --info
http://pastebin.com/VKSfKjCW

xl info
http://pastebin.com/ba2Xxv7w

Submitted to the xen mailing list http://lists.xen.org/archives/html/xen-users/2013-02/msg00344.html as well.
Comment 1 Travis Osterman 2013-02-25 17:17:35 UTC
It looks like xen-tools did not create /var/run/xen

# cat /var/log/xen/qemu-dm-prime.log
 bind(unix:/var/run/xen/qmp-libxl-4): No such file or directory
 chardev: opening backend "socket" failed: No such file or directory

# ls /var/run/xen*
/var/run/xenconsoled.pid  /var/run/xenstored.pid

/var/run/xenstored:
socket  socket_ro

After manually creating /var/run/xen, *.img files are read appropriately.

The codebase should probably be updated to reflect this.  Thanks to Ian on the xen mailing list for diagnosing the problem http://lists.xen.org/archives/html/xen-users/2013-02/msg00356.html.
Comment 2 jannis 2013-04-06 10:02:24 UTC
I have exactly the same problem with app-emulation/xen-tools-4.2.0-r3. I tried to set up a domU-machine using a qcow2 disk image (dynamically expanding) and the disk just wasn't attached to the domU-machine. Creating /var/run/xen manually fixed the problem and the domU booted right up.
Comment 3 Travis Osterman 2013-04-06 13:08:38 UTC
I can still not use the raw disk file in my config when the steps outlined above are used.  I'll try it with a qcow2 disk like Janis, but I'm not sure what the difference is.  For now, I can mount my disk images on /dev/loop and use those w/o a problems.  That's a bad work around for large systems though.
Comment 4 László Szalma 2013-04-25 12:22:26 UTC
I just put

mkdir -p /run/xen

in the start() block of /etc/init.d/xenstored

and it solved the problem permanently. I hope this will be applied to the xen-tools initscript soon, file based storage is a main feature of Xen (I think) and it doesn't work at the moment, without manually editing the init script, or creating the directory with other boot time initscript.
Comment 5 jannis 2013-05-11 20:12:34 UTC
Any news on this one? It's basically adding one line to an init script and it's a pretty obscure error that might keep some people from using Xen on Gentoo
Comment 6 Ian Delaney (RETIRED) gentoo-dev 2013-05-12 15:53:56 UTC
ok tomorrow's homework
Comment 7 Ian Delaney (RETIRED) gentoo-dev 2013-05-15 08:41:30 UTC
  15 May 2013; Ian Delaney <idella4@gentoo.org> files/xenstored.initd:
  Fix to xenstored.initd wrt Bug #459082