libguestfs cannot start the qemu process on s390x
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ubuntu on IBM z Systems |
Fix Released
|
High
|
Unassigned | ||
libguestfs (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Xenial |
Won't Fix
|
Undecided
|
Unassigned | ||
Artful |
Won't Fix
|
Undecided
|
Unassigned | ||
Bionic |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[Impact]
* the way libguestfs launches libvirt is not working on s390x
* backport fixes to work on that platform as well
* The TL;DR of the changes is to add arch specific options to the calls being made
[Test Case]
* Note: IBM will assist in verifying those and already has on the PPA
* To run yourself from the original description you can use libguestfs-
1. apt install libguestfs-tools python-libguestfs linux-image-generic qemu
2. sudo libguestfs-
This will by default break on e.g.:
qemu-
libguestfs: error: appliance closed the connection unexpectedly, see earlier error messages
3. (upgrade from ppa or proposed depending on what you test)
4. sudo libguestfs-
[...]
===== TEST FINISHED OK =====
[Regression Potential]
* This modifies how arguments are created, but it does so only for s390x so the regression should be limited to that architecture.
The issue would be that it doesn't start properly, but since that is the current state there is no real regression - it would just replacve one way of failing for another - and since the tests by IBM on the PPA were good we are convinced that even that regression-risk would not trigger.
* The FTBFS is a build time only change and should not trigger regressions later on.
[Other Info]
* Along the fix requested this fixes an FTBFS in Bionic due to the move to a new default JDK version.
---
The libguestfs versions < 1.37.22 don't work on s390x, as they don't
contain the patches which include the s390x specifics to instruct qemu-kvm
correctly. Ubuntu 16.04 contains an older version than that, which makes
libguestfs not usable on s390x.
Steps to reproduce
==================
A chronological list of steps which will bring off the issue I noticed:
mz@s390xhost$ docker run -it --privileged --rm ubuntu:xenial bash
root@
root@
root@
root@
libguestfs-
python-
linux-
qemu
root@
root@
root@
root@
root@
Expected result
===============
The libguestfs-
To check if qemu on s390x works independently from libguestfs, I use this
command:
root@
-enable-kvm \
-nographic \
-kernel /boot/vmlinuz-
-initrd /boot/initrd.
-m 1G \
-M s390-ccw-virtio
[...] # boot
BusyBox v1.22.1 (Ubuntu 1:1.22.0-15ubuntu1) built-in shell (ash)
Enter 'help' for a list of built-in commands.
(initramfs)
Actual result
=============
libguestfs instructs qemu to use pci devices and serial consoles
which doesn't work on s390x, e.g.:
root@
* IMPORTANT NOTICE
*
* When reporting bugs, include the COMPLETE, UNEDITED
* output below in your bug report.
*
libguestfs: trace: set_verbose true
libguestfs: trace: set_verbose = 0
libguestfs: trace: set_verbose true
libguestfs: trace: set_verbose = 0
LIBGUESTFS_
LIBGUESTFS_
PATH=
SELinux: sh: 1: getenforce: not found
libguestfs: trace: add_drive_scratch 104857600
libguestfs: trace: get_tmpdir
libguestfs: trace: get_tmpdir = "/tmp"
libguestfs: trace: disk_create "/tmp/libguestf
libguestfs: trace: disk_create = 0
libguestfs: trace: add_drive "/tmp/libguestf
libguestfs: trace: add_drive = 0
libguestfs: trace: add_drive_scratch = 0
libguestfs: trace: get_append
libguestfs: trace: get_append = "NULL"
guestfs_
libguestfs: trace: get_autosync
libguestfs: trace: get_autosync = 1
guestfs_
libguestfs: trace: get_backend
libguestfs: trace: get_backend = "direct"
guestfs_
libguestfs: trace: get_backend_
libguestfs: trace: get_backend_
guestfs_
libguestfs: trace: get_cachedir
libguestfs: trace: get_cachedir = "/var/tmp"
guestfs_
libguestfs: trace: get_direct
libguestfs: trace: get_direct = 0
guestfs_
libguestfs: trace: get_hv
libguestfs: trace: get_hv = "/usr/bin/
guestfs_get_hv: /usr/bin/
libguestfs: trace: get_memsize
libguestfs: trace: get_memsize = 500
guestfs_
libguestfs: trace: get_network
libguestfs: trace: get_network = 0
guestfs_
libguestfs: trace: get_path
libguestfs: trace: get_path = "/usr/lib/
guestfs_
libguestfs: trace: get_pgroup
libguestfs: trace: get_pgroup = 0
guestfs_
libguestfs: trace: get_program
libguestfs: trace: get_program = "libguestfs-
guestfs_
libguestfs: trace: get_recovery_proc
libguestfs: trace: get_recovery_proc = 1
guestfs_
libguestfs: trace: get_selinux
libguestfs: trace: get_selinux = 0
guestfs_
libguestfs: trace: get_smp
libguestfs: trace: get_smp = 1
guestfs_
libguestfs: trace: get_tmpdir
libguestfs: trace: get_tmpdir = "/tmp"
guestfs_
libguestfs: trace: get_trace
libguestfs: trace: get_trace = 1
guestfs_
libguestfs: trace: get_verbose
libguestfs: trace: get_verbose = 1
guestfs_
host_cpu: s390x
Launching appliance, timeout set to 600 seconds.
libguestfs: trace: launch
libguestfs: trace: version
libguestfs: trace: version = <struct guestfs_version *>
libguestfs: trace: get_backend
libguestfs: trace: get_backend = "direct"
libguestfs: launch: program=
libguestfs: launch: version=1.32.2
libguestfs: launch: backend registered: unix
libguestfs: launch: backend registered: uml
libguestfs: launch: backend registered: libvirt
libguestfs: launch: backend registered: direct
libguestfs: launch: backend=direct
libguestfs: launch: tmpdir=
libguestfs: launch: umask=0022
libguestfs: launch: euid=0
libguestfs: trace: get_backend_setting "force_tcg"
libguestfs: trace: get_backend_setting = NULL (error)
libguestfs: trace: get_cachedir
libguestfs: trace: get_cachedir = "/var/tmp"
libguestfs: [00000ms] begin building supermin appliance
libguestfs: [00000ms] run supermin
libguestfs: command: run: /usr/bin/supermin
libguestfs: command: run: \ --build
libguestfs: command: run: \ --verbose
libguestfs: command: run: \ --if-newer
libguestfs: command: run: \ --lock /var/tmp/
libguestfs: command: run: \ --copy-kernel
libguestfs: command: run: \ -f ext2
libguestfs: command: run: \ --host-cpu s390x
libguestfs: command: run: \ /usr/lib/
libguestfs: command: run: \ -o /var/tmp/
supermin: version: 5.1.14
supermin: package handler: debian/dpkg
supermin: acquiring lock on /var/tmp/
supermin: build: /usr/lib/
supermin: reading the supermin appliance
supermin: build: visiting /usr/lib/
supermin: build: visiting /usr/lib/
supermin: build: visiting /usr/lib/
supermin: build: visiting /usr/lib/
supermin: build: visiting /usr/lib/
supermin: build: visiting /usr/lib/
supermin: build: visiting /usr/lib/
supermin: build: visiting /usr/lib/
supermin: build: visiting /usr/lib/
supermin: build: visiting /usr/lib/
supermin: mapping package names to installed packages
supermin: resolving full list of package dependencies
supermin: build: 194 packages, including dependencies
supermin: build: 6751 files
supermin: build: 3694 files, after matching excludefiles
supermin: build: 3696 files, after adding hostfiles
supermin: build: 3696 files, after removing unreadable files
supermin: build: 3700 files, after munging
supermin: kernel: picked kernel vmlinuz-
supermin: kernel: picked modules path /lib/modules/
supermin: kernel: kernel_version 4.4.0-119-generic
supermin: kernel: modules /lib/modules/
supermin: ext2: creating empty ext2 filesystem '/var/tmp/
supermin: ext2: populating from base image
supermin: ext2: copying files from host filesystem
supermin: ext2: copying kernel modules
supermin: ext2: creating minimal initrd '/var/tmp/
supermin: ext2: wrote 9 modules to minimal initrd
supermin: renaming /var/tmp/
libguestfs: [01090ms] finished building supermin appliance
libguestfs: [01090ms] begin testing qemu features
libguestfs: command: run: /usr/bin/
libguestfs: command: run: \ -display none
libguestfs: command: run: \ -help
libguestfs: command: run: /usr/bin/
libguestfs: command: run: \ -display none
libguestfs: command: run: \ -version
libguestfs: qemu version 2.5
libguestfs: command: run: /usr/bin/
libguestfs: command: run: \ -display none
libguestfs: command: run: \ -machine accel=kvm:tcg
libguestfs: command: run: \ -device ?
libguestfs: [01166ms] finished testing qemu features
libguestfs: trace: get_backend_setting "gdb"
libguestfs: trace: get_backend_setting = NULL (error)
[01172ms] /usr/bin/
-global virtio-
-nodefaults \
-display none \
-machine accel=kvm:tcg \
-cpu host \
-m 500 \
-no-reboot \
-rtc driftfix=slew \
-global kvm-pit.
-kernel /var/tmp/
-initrd /var/tmp/
-device virtio-
-drive file=/tmp/
-device scsi-hd,drive=hd0 \
-drive file=/var/
-device scsi-hd,
-device virtio-serial-pci \
-serial stdio \
-chardev socket,
-device virtserialport,
-append 'panic=1 console=ttyS0 udevtimeout=6000 udev.event-
qemu-
Alarm clock
Environment
===========
This affects ubuntu 16.04 (see below)
host
----
$ lsb_release -a
LSB Version: core-9.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.4 LTS
Release: 16.04
Codename: xenial
container
---------
root@
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.3 LTS
Release: 16.04
Codename: xenial
root@
libguestfs-
Installed: 1:1.32.2-4ubuntu2
Candidate: 1:1.32.2-4ubuntu2
Version table:
*** 1:1.32.2-4ubuntu2 500
500 http://
100 /var/lib/
Additional information
=======
Please be aware that there this is a known libguestfs upstream bug [1]
which is already fixed and backported by RedHat [2][3] and was the
trigger for a patch series on the libguestfs mailing list [4]. As an
example, the latest known needed patch is [5]. As a smoke test, in case
the libguestfs-
binding code in Appendix A below, which is based on [6].
FWIW, I checked Ubuntu 18.04 (beta), and it doesn't work there too.
The packaged version of libguestfs is v1.36 in 18.04 bionic beaver,
which is too old (and/or doesn't contain the needed backports).
References
==========
[1] Bug 1376547 - qemu-system-s390x: -device isa-serial,
id=serial0: 'isa-serial' is not a valid device model name
https:/
[2] [Private] Bug 1479526 - [RFE] libguestfs for z Systems
https:/
[3] The RHEL7.5 branch of libguestfs with backports to v1.36
https:/
[4] The patch series of libguestfs on s390x:
https:/
[5] Fix of an x86 specific item to enable s390x in v1.37.22
https:/
[6] https:/
Appendix A
==========
Smoke test, based on the example from the author of libguestfs [6]:
root@
#!/
# To see the Python docs, do: help (guestfs)
# To see the general docs http://
# For FAQ see http://
import os
import guestfs
g = guestfs.GuestFS()
f = open("/
f.truncate(500 * 1024 * 1024)
f.close()
g.add_
g.launch()
g.part_
g.mkfs("ext2", "/dev/sda1")
g.mount(
f = open("/tmp/ks.cfg", "w")
f.write("# this would be the kickstart file\n")
f.write("#\n")
f.write ("# end of file\n")
f.close()
g.upload(
g.sync()
g.umount_all()
== Comment: #1 - Markus Zoeller <email address hidden> - 2018-04-20 06:51:10 ==
With the Debian Sid repository I could install libguestfs v1.38 in an
Ubuntu 18.04 (bionic beaver) container, all on s390x:
[mz@s390xhost]$ docker run -it --privileged --rm s390x/ubuntu:18.04 bash
$ apt update
$ apt install -y vim
$ apt-cache policy libguestfs-tools
$ apt install -y software-
debian-
dirmngr
$ apt-key adv --keyserver keyserver.
$ apt-key adv --keyserver keyserver.
$ add-apt-repository "deb http://
$ cat << EOF > /etc/apt/
# Note: 2 blank lines are required between entries
Package: *
Pin: release a=bionic
Pin-Priority: 500
Package: *
Pin: origin "ftp.de.debian.org"
Pin-Priority: 300
# Pattern includes 'python-guestfs' and 'libguestfs-tools' and similarily named dependencies
Package: *guestfs*
Pin: origin "ftp.de.debian.org"
Pin-Priority: 700
EOF
$ cat /etc/apt/
$ apt update
$ apt-cache policy libguestfs-tools
$ DEBIAN_
qemu-system \
qemu-kvm
$ apt-cache policy libguestfs-tools
$ export LIBGUESTFS_DEBUG=1
$ export LIBGUESTFS_TRACE=1
$ libguestfs-
[...]
===== TEST FINISHED OK =====
This verifies that libguestfs v1.38 has the needed code to work on s390x.
Related branches
- Andreas Hasenack: Approve
- Canonical Server packageset reviewers: Pending requested
- git-ubuntu developers: Pending requested
-
Diff: 555 lines (+497/-0)9 files modifieddebian/changelog (+9/-0)
debian/patches/lp-1766534-s390x-1-6-launch-libvirt-Use-console-device-sclp-for-app.patch (+55/-0)
debian/patches/lp-1766534-s390x-2-6-launch-direct-Use-sclp-as-serial-console-on-th.patch (+43/-0)
debian/patches/lp-1766534-s390x-3-6-appliance-Use-dev-ttysclp0-for-serial-console.patch (+30/-0)
debian/patches/lp-1766534-s390x-4-6-launch-direct-Use-virtio-ccw-on-this-architect.patch (+83/-0)
debian/patches/lp-1766534-s390x-5-6-tests-regressions-Skip-IDE-tests-on-S-390.patch (+44/-0)
debian/patches/lp-1766534-s390x-6-6-lib-Add-VIRTIO_DEVICE_NAME-macro-to-handle-virtio-mm.patch (+143/-0)
debian/patches/lp-1782138-java-support-OpenJDK-10.patch (+83/-0)
debian/patches/series (+7/-0)
tags: | added: architecture-s39064 bugnameltc-166979 severity-high targetmilestone-inin1604 |
Changed in ubuntu: | |
assignee: | nobody → Skipper Bug Screeners (skipper-screen-team) |
affects: | ubuntu → linux (Ubuntu) |
tags: | added: universe |
Changed in ubuntu-z-systems: | |
status: | New → Triaged |
importance: | Undecided → High |
Changed in ubuntu-z-systems: | |
assignee: | Skipper Bug Screeners (skipper-screen-team) → Canonical Foundations Team (canonical-foundations) |
tags: | added: id-5b04b5dd6052dc18608ce46a |
tags: | removed: bugnameltc-166979 id-5b04b5dd6052dc18608ce46a severity-high universe |
tags: | added: id-5b04b5dd6052dc18608ce46a |
Changed in ubuntu-z-systems: | |
status: | Triaged → In Progress |
Changed in libguestfs (Ubuntu Bionic): | |
status: | Incomplete → In Progress |
Changed in ubuntu-z-systems: | |
status: | In Progress → Fix Released |
Given the current Final Freeze for 18.04 this will (if done) have to be an SRU for 18.04 as well.
I just did the initial triage, but will leave it for the screener team to ensure it is as needed.