[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-users] libxl vs pygrub in 4.1.2 on rebooting domU



On Wed, 2012-05-16 at 12:29 +0100, Dmitry Morozhnikov wrote:
> Hello, all.
> 
> There is a bug in 4.1.2, at least in gentoo. The question is if it 
> already fixed or not.
> 
> If someone issue reboot command from inside domU using pygrub 
> bootloader, then libxl, or more precisely, make_bootloader_args() in 
> libxl_bootloader.c will append parameters --kernel, --ramdisk and --args 
> on the second start. So, command line for the pygrub will look like:
> 
> usr/bin/pygrub --kernel=/var/run/libxl/boot_kernel.KyI4aX 
> --ramdisk=/var/run/libxl/boot_ramdisk.th_SXc 
> --args=root=UUID=15c4dce6-e5fe-493f-b738-32b8e7ef829e ro console=hvc0 
> quiet  --output=/var/run/libxl/bl.nVj8nF/fifo --output-format=simple0 
> --output-directory=/var/run/libxl/ /var/xen/vs92.img
> 
> But that is completely wrong from the pygrub side! It bail out with:
> 
> Traceback (most recent call last):
>    File "/usr/bin/pygrub", line 783, in <module>
>      data = fs.open_file(chosencfg["kernel"]).read()
> IOError: [Errno 2] No such file or directory
> 
> Because there is no /var/run/libxl/boot_kernel.KyI4aX in inside of domU 
> disk image.

Right, this is definitely a bug. Thanks for reporting.

The problem is that the libxl bootloader infrastructure is updating the
caller provided domain configuration with the result of running the
bootloader, but this is only valid for the current guest, not the
rebooted version. Which means that when it gets re-used on reboot it all
goes wrong.

As it happens xen-unstable does not suffer from this because it always
reparses the config file (and hence reinitialises the domain
configuration) on reboot.

However, that's a bit of a coincidence, and IMHO it is ugly for the
libxl to replace information in user supplied datastructures like this.
I have just proposed a patch to remove this trap.

Unfortunately the possibilities for fixing this in 4.1 are rather
limited since it doesn't provide the same level of infrastructure for
doing this.

> Solution is simple, remove code to append this parameters:

That breaks the ability to use pygrub+kernel to boot a specific kernel
from the guest fs. I don't know if people use this functionality but I'd
be reluctant to remove it.

Ian.


_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxx
http://lists.xen.org/xen-users


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.