Bug 1104695

Summary: libxl driver of libvirt uses hardcoded path for pygrub
Product: [Community] Virtualization Tools Reporter: Alvaro <aloga>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: crobinso, rbalakri
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-04-10 18:46:18 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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.