Skip to content
  • ryang's avatar
    module: Use QEMU_MODULE_DIR as a search path · 900610e6
    ryang authored
    The current paths for modules are CONFIG_QEMU_MODDIR and paths relative
    to the executable. Qemu and its modules can be installed and executed in
    paths that are different from these search paths. This change allows
    a search path to be specified by environment variable.
    
    An example usage for this is postmarketOS[1]. This is a build environment
    for Alpine Linux. It sets up Alpine Linux in a chroot environment.
    Alpine's Qemu packages are installed in the chroot. The Alpine Linux Qemu
    package is used to test compiled Alpine Linux system images. This way there
    isn't a reliance on the which ever version of Qemu the host system / distro
    provides.
    
    postmarketOS executes Qemu on host system outside of the chroot
    The Qemu module search path needs to point to the location of the
    chroot relative to the host system.
    
    e.g.
    The root of the Alpine Linux chroot is:
    ~/.local/var/pmbootstrap/chroot_native/
    
    Alpine's Qemu is installed at
    ~/.local/var/pmbootstrap/chroot_native/usr/bin/
    
    The Qemu module search path needs to be:
    QEMU_MODULE_DIR=~/.local/var/pmbootstrap/chroot_native/usr/lib/qemu/
    
    [1] https://postmarketos.org/
    
    
    
    Signed-off-by: default avatarryang <decatf@gmail.com>
    Message-Id: <20180704181010.GA918@computer>
    Reviewed-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
    Reviewed-by: default avatarFam Zheng <famz@redhat.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    900610e6