Package: autopkgtest
Version: 5.16
Severity: normal
Tags: patch

Dear Maintainer,

I found that autopkgtest-virt-qemu in bullseye doesn't boot my disk 
images. The version in buster was working fine.

Using --show-boot I found that the VM doesn't boot at all:

Booting from Hard Disk...
Boot failed: could not read the boot disk

The reason is that my disk images are raw images, not qcow2. I found 
that autopkgtest runs qemu-img to create an overlay file in qcow2 
format, but it configures qemu with the base image format (format=raw) 
instead of the overlay format (format=qcow2). I converted an image to 
qcow2 format and then it worked fine.

I'm attaching a patch to use format=qcow2 for the overlay image. Please 
let me know if you'd prefer a Salsa merge request instead.

Thank you,
Ryan


-- System Information:
Debian Release: 11.2
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 
'proposed-updates'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.10.0-11-amd64 (SMP w/4 CPU threads)
Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages autopkgtest depends on:
ii  apt-utils       2.2.4
ii  libdpkg-perl    1.20.9
ii  procps          2:3.3.17-5
ii  python3         3.9.2-3
ii  python3-debian  0.1.39

Versions of packages autopkgtest recommends:
pn  autodep8  <none>

Versions of packages autopkgtest suggests:
pn  lxc               <none>
pn  lxd               <none>
pn  ovmf              <none>
pn  qemu-efi-aarch64  <none>
pn  qemu-efi-arm      <none>
pn  qemu-system       <none>
ii  qemu-utils        1:5.2+dfsg-11+deb11u1
ii  schroot           1.6.10-12
pn  vmdb2             <none>

-- no debconf information
>From dc5722886920a030d850cd5e0a492c49ffa96988 Mon Sep 17 00:00:00 2001
From: Ryan Tandy <r...@nardis.ca>
Date: Sat, 22 Jan 2022 19:19:33 -0800
Subject: [PATCH] Fix qemu failing to boot raw base image

The overlay file is created with 'qemu-img -f qcow2', so pass
'format=qcow2' when using an overlay image. Otherwise, use the base
image format.
---
 lib/autopkgtest_qemu.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/autopkgtest_qemu.py b/lib/autopkgtest_qemu.py
index 6733ede..fc8225c 100644
--- a/lib/autopkgtest_qemu.py
+++ b/lib/autopkgtest_qemu.py
@@ -156,13 +156,14 @@ class QemuImage:
 
         if self.overlay is None:
             bits.append('file={}'.format(self.file))
+            bits.append('format={}'.format(self.format))
         else:
             bits.append('file={}'.format(self.overlay))
+            bits.append('format=qcow2')
             bits.append('cache=unsafe')
 
         bits.append('if=virtio')
         bits.append('discard=unmap')
-        bits.append('format={}'.format(self.format))
 
         if self.readonly:
             bits.append('readonly')
-- 
2.30.2

Reply via email to