Bug#989638: qemu-kvm dependency isn't available on all Architecture: any

Christian Ehrhardt christian.ehrhardt at canonical.com
Wed Jun 9 09:04:53 BST 2021


Package: qemu-web-desktop
Version: 21.05.03-1

Hi,
I've seen that this is blocked migrating in Debian and Ubuntu due to
missing dependencies.

Debian:
qemu-web-desktop/mips64el has unsatisfiable dependency
qemu-web-desktop/mipsel has unsatisfiable dependency
qemu-web-desktop/s390x has unsatisfiable dependency
Ubuntu:
qemu-web-desktop/riscv64 has unsatisfiable dependency

That is due to the explicit listing of qemu-kvm
This package is most likely no more the right package to depend on anyway.
Usually it is expected to depend on just the right qemu-system-$arch
that you'd need - and if you really can't decide at all then qemu-system
which depends on all the others.

qemu-kvm doesn't exist anymore as a package, you only see old ones:
qemu-kvm   | 1:2.1+dfsg-12+deb8u6 | oldoldstable | amd64, i386
qemu-kvm   | 1:2.8+dfsg-6+deb9u9  | oldstable    | amd64, i386
qemu-kvm   | 1:3.1+dfsg-8+deb10u8 | stable       | amd64, i386
But the newer qemu-system-$arch have a provides

root at d10-sid:~# apt-cache show qemu-system-x86 | grep '^Provides'
Provides: qemu-kvm, qemu-system-i386, qemu-system-x86-64

The description of the also old "qemu" outlines it the best IMHO:
142  If you want full system emulation of some architecture, install one or more
143  of qemu-system-ARCH packages. If you want user-mode emulation, install
144  qemu-user or qemu-user-static package. If you need utilities, use
qemu-utils
145  package.

So what does qemu-web-desktop actually use:
$ grep -Hrn qemu-system
README.md:173:qemu-system-x86_64  -m 4096 -smp 4 -hda machine1.qcow2
-name MySuperbVM -boot d -cdrom file.iso -enable-kvm -cpu host -vga
qxl -net user -net nic,model=ne2k_pci
README.md:378:qemu-system-x86_64: -device
vfio-pci,host=0000:4c:00.0,multifunction=on: VFIO_MAP_DMA: -12
README.md:379:qemu-system-x86_64: -device
vfio-pci,host=0000:4c:00.0,multifunction=on:
vfio_dma_map(0x55966269d230, 0x100000, 0xbff00000, 0x7f55b7f00000) =
-12 (Cannot allocate memory)
README.md:411:qemu-system-x86_64  -m 8192 -smp 4 -hda
machine1-snapshot.qcow2 -device ich9-ahci,id=ahci -enable-kvm -cpu
host -vga qxl -netdev user,id=mynet0 -device virtio-net,netdev=mynet0
-device virtio-balloon
src/config.pl:63:$config{qemu_exec}                = "qemu-system-x86_64";

So the default is x86 only, there is nothing in d/rules that overwrites this.

Thereby chances are quite high that this was only ever tested and meant for
x86_64 anyway. Therefore the simple and most reasonable short term fix
would IMHO be:

--- qemu-web-desktop-21.05.03/debian/control 2021-05-17 18:51:33.000000000 +0200
+++ qemu-web-desktop-21.05.03/debian/control 2021-06-09 09:43:35.000000000 +0200
@@ -10,7 +10,7 @@
 Homepage: https://gitlab.com/soleil-data-treatment/soleil-software-projects/remote-desktop

 Package: qemu-web-desktop
-Architecture: any
+Architecture: amd64
 Depends: ${shlibs:Depends}, ${misc:Depends},
   apache2,
   libapache2-mod-perl2,

If you want to really support other architectures then you'd most likely want
to
1. overwrite the default in config.pl at build time per architecture
2. select the architectures you really expect to work (e.g. there is no system
   emulation at all for risscv yet) and mark it only for those
3. depend on the matching qemu-system-$arch
4. after having done so have at least a quick try if it works there at all
   before moving it out of experimental

!Untested! example for this more complex solution:

diff -Nru qemu-web-desktop-21.05.03/debian/control
qemu-web-desktop-21.05.03/debian/control
--- qemu-web-desktop-21.05.03/debian/control 2021-05-17 18:51:33.000000000 +0200
+++ qemu-web-desktop-21.05.03/debian/control 2021-06-09 09:43:44.000000000 +0200
@@ -10,13 +10,15 @@
 Homepage: https://gitlab.com/soleil-data-treatment/soleil-software-projects/remote-desktop

 Package: qemu-web-desktop
-Architecture: any
+Architecture: amd64 ppc64el arm64
 Depends: ${shlibs:Depends}, ${misc:Depends},
   apache2,
   libapache2-mod-perl2,
   libapache2-mpm-itk,
   websockify,
-  qemu-kvm,
+  qemu-system-x86 [amd64],
+  qemu-system-arm [arm64],
+  qemu-system-ppc [ppc64el],
   bridge-utils,
   qemu,
   iptables,
diff -Nru qemu-web-desktop-21.05.03/debian/rules
qemu-web-desktop-21.05.03/debian/rules
--- qemu-web-desktop-21.05.03/debian/rules 2021-05-03 17:06:35.000000000 +0200
+++ qemu-web-desktop-21.05.03/debian/rules 2021-06-09 09:43:44.000000000 +0200
@@ -1,10 +1,19 @@
 #!/usr/bin/make -f

+SYSEMULATOR=qemu-system-x86_64
+ifeq ($(DEB_HOST_ARCH),arm64)
+  SYSEMULATOR=qemu-system-aarch64
+endif
+ifeq ($(DEB_HOST_ARCH),ppc64el)
+  SYSEMULATOR=qemu-system-ppc64
+endif
+
 %:
  dh $@ --with apache2 --with sysuser

 override_dh_auto_build:
  mkdir build
+ sed -e 's/qemu-system-x86_64/$(SYSEMULATOR)/' src/config.pl
  cp src/apache.conf build/qemu-web-desktop.conf
  pandoc -s -o build/qwdctl.1 src/qwdctl.md


-- 
Christian Ehrhardt
Staff Engineer, Ubuntu Server
Canonical Ltd



More information about the debian-science-maintainers mailing list