Bug 1104695 - libxl driver of libvirt uses hardcoded path for pygrub
Summary: libxl driver of libvirt uses hardcoded path for pygrub
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-06-04 13:59 UTC by Alvaro
Modified: 2016-04-10 18:46 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-04-10 18:46:18 UTC
Embargoed:


Attachments (Terms of Use)

Description Alvaro 2014-06-04 13:59:43 UTC
The libvirt libxl driver for Xen has the full path to the pygrub path
hardcoded [1].

[1] http://libvirt.org/git/?p=libvirt.git;a=blob;f=src/libxl/libxl_conf.h;h=433d6daf155cda813922a44055692fb20486e02c;hb=HEAD#l53

If the bootloader is installed in a different path, booting a machine
fails because the executable cannot be found. Moreover, there's a warning in
the logs:

    libxl: debug: libxl_bootloader.c:409:bootloader_disk_attached_cb: Config bootloader value: /usr/bin/pygrub
    libxl: warning: libxl_bootloader.c:413:bootloader_disk_attached_cb: bootloader='/usr/bin/pygrub' is deprecated; use bootloader='pygrub' instead

According to the documentation the full path was only needed for versions
prior to 4.1: "Note: For older versions of Xen Project software (4.1 or
earlier) you need to know where in the filesystem pygrub lies. (...) Newer
versions of the toolstack know how to look for the path themselves." [2].
Setting the bootloader in the libvirt XML domain config file as 
"<bootloader>pygrub</bootloader>" workarounds the problem:

    libxl: debug: libxl_bootloader.c:409:bootloader_disk_attached_cb: Config bootloader value: pygrub
    libxl: debug: libxl_bootloader.c:425:bootloader_disk_attached_cb: Checking for bootloader in libexec path: /usr/lib/xen-4.4/bin/pygrub


[2] http://wiki.xen.org/wiki/PyGrub

Comment 1 Cole Robinson 2016-04-10 18:46:18 UTC
Sorry this didn't receive a timely response, but it was fixed by this commit:

commit d70a51d5ea0b9aecb429334714e8331f44fb9df7
Author: Ian Campbell <Ian.Campbell>
Date:   Fri Nov 21 14:32:53 2014 +0000

    libxl: Allow libxl to find pygrub binary.


Note You need to log in before you can comment on or make changes to this bug.