• Bug#873714: virt-install --location fails for s390x guests

    From Viktor Mihajlovski@21:1/5 to All on Wed Aug 30 14:50:02 2017
    XPost: linux.debian.bugs.dist

    This is a multi-part message in MIME format.
    Package: virt-manager
    Version: 1:1.4.0-5
    Tags: patch, stretch, d-i
    X-Debbugs-CC: debian-s390@lists.debian.org

    Dear Maintainer,

    when I try to install a s390x KVM guest using the following command

    virt-install --name testing --ram 1024 --disk /var/lib/libvirt/images/testing.qcow2,bus=virtio --location http://ftp.de.debian.org/debian/dists/testing/main/installer-s390x

    I get the following error message:
    ======================================
    ERROR Error validating install location: Could not find an
    installable distribution at 'http://ftp.de.debian.org/debian/dists/testing/main/installer-s390x'

    The location must be the root directory of an install tree.
    See virt-install man page for various distro examples =======================================

    even though the location URL is correct. This is because the install
    files location differs from i386/amd64. The attached patch - also
    available upstream - will fix this (for Debian and Ubuntu).

    --

    Kind Regards
    Viktor Mihajlovski


    --- a/virtinst/urlfetcher.py
    +++ b/virtinst/urlfetcher.py
    @@ -1106,6 +1106,12 @@
    kernel_basename = "linux"
    if self._treeArch in ["ppc64el"]:
    kernel_basename = "vmlinux"
    +
    + if self._treeArch == "s390x":
    + hvmroot = "%s/generic/" % self._url_prefix
    + kernel_basename = "kernel.%s" % self.name.lower()
    + initrd_basename = "initrd.%s" % self.name.lower()
    +
    self._hvm_kernel_paths = [
    (hvmroot + kernel_basename, hvmroot + initrd_basename)]

    @@ -1124,7 +1130,11 @@
    return False

    filename = "%s/MANIFEST" % self._url_prefix
    - regex = ".*%s.*" % self._installer_dirname
    + if self.arch == "s390x":
    + regex = ".*generic/kernel\.%s.*" % self.name.lower()
    + else:
    + regex = ".*%s.*" % self._installer_dirname
    +
    if not self._fetchAndMatchRegex(filename, regex):
    logging.debug("Regex didn't match, not a %s distro", self.name)