{"id":2231351,"url":"http://patchwork.ozlabs.org/api/patches/2231351/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20260430160307.634093-8-cohuck@redhat.com/","project":{"id":14,"url":"http://patchwork.ozlabs.org/api/projects/14/?format=json","name":"QEMU Development","link_name":"qemu-devel","list_id":"qemu-devel.nongnu.org","list_email":"qemu-devel@nongnu.org","web_url":"","scm_url":"","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20260430160307.634093-8-cohuck@redhat.com>","list_archive_url":null,"date":"2026-04-30T16:03:03","name":"[PULL,v2,07/11] tests/functional/s390x: Add test for booting from a disk with 4k sectors","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"8f22db2e6e081f4cc0438d199a4af6fd6701b29c","submitter":{"id":71914,"url":"http://patchwork.ozlabs.org/api/people/71914/?format=json","name":"Cornelia Huck","email":"cohuck@redhat.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20260430160307.634093-8-cohuck@redhat.com/mbox/","series":[{"id":502335,"url":"http://patchwork.ozlabs.org/api/series/502335/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/list/?series=502335","date":"2026-04-30T16:02:58","name":"[PULL,v2,01/11] target/s390x/kvm: Simplify the async pfault handling code","version":2,"mbox":"http://patchwork.ozlabs.org/series/502335/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2231351/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2231351/checks/","tags":{},"related":[],"headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=NUioWFKe;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists1p.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)"],"Received":["from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g5zbq30HBz1xqf\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 01 May 2026 02:08:07 +1000 (AEST)","from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists1p.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1wITs1-00013K-Vt; Thu, 30 Apr 2026 12:04:10 -0400","from eggs.gnu.org ([2001:470:142:3::10])\n by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <cohuck@redhat.com>) id 1wITrS-0007rF-HZ\n for qemu-devel@nongnu.org; Thu, 30 Apr 2026 12:03:34 -0400","from us-smtp-delivery-124.mimecast.com ([170.10.129.124])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <cohuck@redhat.com>) id 1wITrQ-0007Eb-9T\n for qemu-devel@nongnu.org; Thu, 30 Apr 2026 12:03:34 -0400","from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com\n (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by\n relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n cipher=TLS_AES_256_GCM_SHA384) id us-mta-237-n_8fTX0YNiGzAdAJeyKvwg-1; Thu,\n 30 Apr 2026 12:03:29 -0400","from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com\n (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS\n id 09B3519560B2; Thu, 30 Apr 2026 16:03:28 +0000 (UTC)","from gondolin.redhat.com (unknown [10.44.50.47])\n by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP\n id 4FC571800446; Thu, 30 Apr 2026 16:03:26 +0000 (UTC)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1777565011;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=1/1GlS2T+jJeVU5ZLNkbivtz/FW9fVBSvejzXEldY3E=;\n b=NUioWFKeWewsJtKBVn2ltX6LT7qMhX1EA+xWC5XmnEZHieELL0MQwGAKS8wF4zT+TYQU+6\n cpATUm940UlFDD/0ErAj5KM2Gh8mM/MfrZ8lK2YdPmAMxR13fZmC7Ff+v4G44+KNheleCo\n +xVpnT2UKllDBxTE++XUR+/zK/Us42E=","X-MC-Unique":"n_8fTX0YNiGzAdAJeyKvwg-1","X-Mimecast-MFC-AGG-ID":"n_8fTX0YNiGzAdAJeyKvwg_1777565008","From":"Cornelia Huck <cohuck@redhat.com>","To":"qemu-devel@nongnu.org","Cc":"qemu-s390x@nongnu.org, Thomas Huth <thuth@redhat.com>,\n Eric Farman <farman@linux.ibm.com>, Cornelia Huck <cohuck@redhat.com>","Subject":"[PULL v2 07/11] tests/functional/s390x: Add test for booting from a\n disk with 4k sectors","Date":"Thu, 30 Apr 2026 18:03:03 +0200","Message-ID":"<20260430160307.634093-8-cohuck@redhat.com>","In-Reply-To":"<20260430160307.634093-1-cohuck@redhat.com>","References":"<20260430160307.634093-1-cohuck@redhat.com>","MIME-Version":"1.0","Content-type":"text/plain","Content-Transfer-Encoding":"8bit","X-Scanned-By":"MIMEDefang 3.4.1 on 10.30.177.111","Received-SPF":"pass client-ip=170.10.129.124; envelope-from=cohuck@redhat.com;\n helo=us-smtp-delivery-124.mimecast.com","X-Spam_score_int":"-20","X-Spam_score":"-2.1","X-Spam_bar":"--","X-Spam_report":"(-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001,\n DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001,\n SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no","X-Spam_action":"no action","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"qemu development <qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<https://lists.nongnu.org/archive/html/qemu-devel>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org"},"content":"From: Thomas Huth <thuth@redhat.com>\n\nThe DASD disks on s390x have a different sector size (4k) and use\na different layout of the boot loader data compared to the usual\n\"SCSI\"-style disks with 512 sectors that are used with most modern\nguests. To make sure that there are no regressions with 4k disk\nbooting, add a test case that uses a disk image with these 4k sectors\nand check that we can successfully show the boot menu and and load the\nright kernel in all supported cases.\n\nSigned-off-by: Thomas Huth <thuth@redhat.com>\nReviewed-by: Eric Farman <farman@linux.ibm.com>\nMessage-ID: <20260323171423.112205-1-thuth@redhat.com>\nSigned-off-by: Cornelia Huck <cohuck@redhat.com>\n---\n tests/functional/s390x/meson.build     |   1 +\n tests/functional/s390x/test_boot_4k.py | 138 +++++++++++++++++++++++++\n 2 files changed, 139 insertions(+)\n create mode 100755 tests/functional/s390x/test_boot_4k.py","diff":"diff --git a/tests/functional/s390x/meson.build b/tests/functional/s390x/meson.build\nindex 0f03e1c9db8a..b065b666bc2e 100644\n--- a/tests/functional/s390x/meson.build\n+++ b/tests/functional/s390x/meson.build\n@@ -10,6 +10,7 @@ tests_s390x_system_quick = [\n ]\n \n tests_s390x_system_thorough = [\n+  'boot_4k',\n   'ccw_virtio',\n   'pxelinux',\n   'replay',\ndiff --git a/tests/functional/s390x/test_boot_4k.py b/tests/functional/s390x/test_boot_4k.py\nnew file mode 100755\nindex 000000000000..965123ebd311\n--- /dev/null\n+++ b/tests/functional/s390x/test_boot_4k.py\n@@ -0,0 +1,138 @@\n+#!/usr/bin/env python3\n+#\n+# SPDX-License-Identifier: GPL-2.0-or-later\n+#\n+# Copyright 2026 Red Hat, Inc.\n+#\n+# Author:\n+#  Thomas Huth <thuth@redhat.com>\n+'''\n+Functional test that boots from a (incomplete) disk with 4k sectors\n+(DASD/ECKD geometry) and multiple kernels installed, so we can check\n+the boot menu and various LOADPARM options.\n+'''\n+\n+from qemu_test import QemuSystemTest, Asset, skipFlakyTest\n+from qemu_test import wait_for_console_pattern\n+\n+\n+class S390Boot4k(QemuSystemTest):\n+\n+    # This disk image has been taken from a DASD with 4k sectors.\n+    # Note: It's incomplete (to keep it small), it contains just enough\n+    # data for booting the kernels that are installed on the disk image\n+    ASSET_DISK = Asset(\n+        ('https://github.com/huth/qemu-paddock/raw/refs/heads/main/s390x/'\n+         'f32-4k-bootmenu.raw.xz'),\n+        'f4e2c91b4ec50a4756e8816b7a7c8ca01cc0d929f7a711cfd8124640c304ea41')\n+\n+    def wait_for_pattern(self, success_message, vm=None):\n+        wait_for_console_pattern(self, success_message, vm=vm,\n+                                 failure_message='panic')\n+\n+    def basic_machine_setup(self):\n+        self.set_machine('s390-ccw-virtio')\n+        disk_path = self.uncompress(self.ASSET_DISK, format=\"xz\")\n+\n+        self.vm.set_console()\n+        self.vm.add_args(\"-nographic\", \"-no-shutdown\", \"-blockdev\",\n+                         f\"driver=file,filename={disk_path},node-name=d1\")\n+\n+    def test_default(self):\n+        '''\n+        Check that the default kernel boots up correctly from a ccw device\n+        '''\n+        self.basic_machine_setup()\n+        self.vm.add_args(\"-device\", \"virtio-blk-ccw,drive=d1\")\n+        self.vm.launch()\n+        self.wait_for_pattern(\"Linux version 5.8.15-301.fc33.s390x\")\n+        self.wait_for_pattern(\"Trying to unpack rootfs image as initramfs\")\n+\n+    def test_loadparm_machine(self):\n+        '''\n+        Check that we can select a kernel via \"-machine loadparm=...\"\n+        '''\n+        self.basic_machine_setup()\n+        self.vm.add_args(\"-device\", \"virtio-blk-ccw,drive=d1\",\n+                         \"-machine\", \"loadparm=2\")\n+        self.vm.launch()\n+        self.wait_for_pattern(\"Linux version 5.6.6-300.fc32.s390x\")\n+\n+    def test_loadparm_device(self):\n+        '''\n+        Check that we can select a kernel via  \"-device ...,loadparm=...\"\n+        '''\n+        self.basic_machine_setup()\n+        self.vm.add_args(\"-device\",\n+                         \"virtio-blk-ccw,drive=d1,bootindex=1,loadparm=3\")\n+        self.vm.launch()\n+        self.wait_for_pattern(\"Linux version 5.6.6-300.fc32.s390x\")\n+\n+    @skipFlakyTest(\"https://gitlab.com/qemu-project/qemu/-/work_items/3350\")\n+    def test_loadparm_pci(self):\n+        '''\n+        Check that we can select a kernel via  \"-device ...-pci,loadparm=...\"\n+        '''\n+        self.require_device('virtio-blk-pci')\n+        self.basic_machine_setup()\n+        self.vm.add_args(\"-device\",\n+                         \"virtio-blk-pci,drive=d1,bootindex=1,loadparm=2\")\n+        self.vm.launch()\n+        self.wait_for_pattern(\"Linux version 5.6.6-300.fc32.s390x\")\n+\n+    def test_scsi_default(self):\n+        '''\n+        Check that we can boot via SCSI, too (need to set logical block size\n+        here to avoid that the auto-detection in the bios fails)\n+        '''\n+        self.basic_machine_setup()\n+        self.vm.add_args(\"-device\", \"virtio-scsi\", \"-device\",\n+            \"scsi-hd,drive=d1,physical_block_size=4096,logical_block_size=4096\")\n+        self.vm.launch()\n+        self.wait_for_pattern(\"Linux version 5.8.15-301.fc33.s390x\")\n+\n+    def test_scsi_loadparm(self):\n+        '''\n+        Check that we can boot via SCSI with loadparm\n+        '''\n+        self.basic_machine_setup()\n+        self.vm.add_args(\"-device\", \"virtio-scsi\", \"-device\",\n+                         (\"scsi-hd,drive=d1,bootindex=1,loadparm=3,\"\n+                          \"physical_block_size=4096,logical_block_size=4096\"))\n+        self.vm.launch()\n+        self.wait_for_pattern(\"Linux version 5.6.6-300.fc32.s390x\")\n+\n+    def test_menu(self):\n+        '''\n+        Check that boot menu shows up correctly\n+        '''\n+        self.basic_machine_setup()\n+        self.vm.add_args(\"-device\", \"virtio-blk-ccw,drive=d1,bootindex=1\",\n+                         \"-boot\", \"menu=on\")\n+        self.vm.launch()\n+        self.wait_for_pattern(\"1. Fedora (5.8.15-301.fc33.s390x) 33\")\n+        self.wait_for_pattern(\"2. Fedora (5.6.6-300.fc32.s390x) 32\")\n+        self.wait_for_pattern(\"3. Fedora (0-rescue-b7218f0092704c5a9\")\n+        self.wait_for_pattern(\"Please choose:\")\n+        # For some unknown reason, sending a key to the bios does not work\n+        # in the testing framework yet:\n+        # exec_command_and_wait_for_pattern(self, '2',\n+        #                              \"Linux version 5.6.6-300.fc32.s390x\")\n+\n+    def test_menu_timeout(self):\n+        '''\n+        Check that boot menu shows up and boot continues automatically\n+        when a timeout has been specified\n+        '''\n+        self.basic_machine_setup()\n+        self.vm.add_args(\"-device\", \"virtio-blk-ccw,drive=d1,bootindex=1\",\n+                         \"-boot\", \"menu=on,splash-time=1\")\n+        self.vm.launch()\n+        self.wait_for_pattern(\"s390-ccw zIPL Boot Menu\")\n+        self.wait_for_pattern(\"0. default (Fedora (5.8.15-301.fc33.s390x)\")\n+        self.wait_for_pattern(\"(default will boot in 0 seconds)\")\n+        self.wait_for_pattern(\"Linux version 5.8.15-301.fc33.s390x\")\n+\n+\n+if __name__ == '__main__':\n+    QemuSystemTest.main()\n","prefixes":["PULL","v2","07/11"]}