From nobody Sat Oct 25 11:06:50 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1524824090591875.3801578861076; Fri, 27 Apr 2018 03:14:50 -0700 (PDT) Received: from localhost ([::1]:47021 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fC0Or-000278-FP for importer@patchew.org; Fri, 27 Apr 2018 06:14:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37346) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fBzsI-0002Oi-AE for qemu-devel@nongnu.org; Fri, 27 Apr 2018 05:41:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fBzsH-0003xF-Gm for qemu-devel@nongnu.org; Fri, 27 Apr 2018 05:41:06 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:56296 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fBzsB-0003rC-Uq; Fri, 27 Apr 2018 05:41:00 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0B0DD40858CF; Fri, 27 Apr 2018 09:40:57 +0000 (UTC) Received: from thh440s.redhat.com (ovpn-116-17.ams2.redhat.com [10.36.116.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id F144DAB3F1; Fri, 27 Apr 2018 09:40:55 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org, John Snow Date: Fri, 27 Apr 2018 11:40:43 +0200 Message-Id: <1524822046-22779-2-git-send-email-thuth@redhat.com> In-Reply-To: <1524822046-22779-1-git-send-email-thuth@redhat.com> References: <1524822046-22779-1-git-send-email-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Fri, 27 Apr 2018 09:40:57 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Fri, 27 Apr 2018 09:40:57 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'thuth@redhat.com' RCPT:'' Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH v3 1/4] tests/boot-sector: Add magic bytes to s390x boot code header X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-block@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" We're going to use the s390x boot code for testing CD-ROM booting. But the ISO loader of the s390-ccw bios is a little bit more picky than the network loader and expects some magic bytes in the header of the file (see linux_s390_magic in pc-bios/s390-ccw/bootmap.c), so we've got to add them in our boot code here, too. Reviewed-by: Christian Borntraeger Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Michael S. Tsirkin Reviewed-by: Herv=C3=A9 Poussineau Acked-By: Mark Cave-Ayland Signed-off-by: Thomas Huth --- tests/boot-sector.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/boot-sector.c b/tests/boot-sector.c index c373f0e..7824286 100644 --- a/tests/boot-sector.c +++ b/tests/boot-sector.c @@ -68,8 +68,11 @@ static uint8_t x86_boot_sector[512] =3D { }; =20 /* For s390x, use a mini "kernel" with the appropriate signature */ -static const uint8_t s390x_psw[] =3D { - 0x00, 0x08, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00 +static const uint8_t s390x_psw_and_magic[] =3D { + 0x00, 0x08, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, /* Program status wor= d */ + 0x02, 0x00, 0x00, 0x18, 0x60, 0x00, 0x00, 0x50, /* Magic: = */ + 0x02, 0x00, 0x00, 0x68, 0x60, 0x00, 0x00, 0x50, /* see linux_s390_mag= ic */ + 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 /* in the s390-ccw bi= os */ }; static const uint8_t s390x_code[] =3D { 0xa7, 0xf4, 0x00, 0x0a, /* j 0x10010 */ @@ -110,7 +113,7 @@ int boot_sector_init(char *fname) } else if (g_str_equal(arch, "s390x")) { len =3D 0x10000 + sizeof(s390x_code); boot_code =3D g_malloc0(len); - memcpy(boot_code, s390x_psw, sizeof(s390x_psw)); + memcpy(boot_code, s390x_psw_and_magic, sizeof(s390x_psw_and_magic)= ); memcpy(&boot_code[0x10000], s390x_code, sizeof(s390x_code)); } else { g_assert_not_reached(); --=20 1.8.3.1 From nobody Sat Oct 25 11:06:50 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1524824461513466.17769983214555; Fri, 27 Apr 2018 03:21:01 -0700 (PDT) Received: from localhost ([::1]:47071 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fC0Uo-0006iV-Rg for importer@patchew.org; Fri, 27 Apr 2018 06:20:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37388) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fBzsK-0002QY-0I for qemu-devel@nongnu.org; Fri, 27 Apr 2018 05:41:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fBzsI-0003zk-KU for qemu-devel@nongnu.org; Fri, 27 Apr 2018 05:41:08 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:36321 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fBzsB-0003rD-Uj; Fri, 27 Apr 2018 05:41:00 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 72727722F3; Fri, 27 Apr 2018 09:40:58 +0000 (UTC) Received: from thh440s.redhat.com (ovpn-116-17.ams2.redhat.com [10.36.116.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id 66E96AB3F2; Fri, 27 Apr 2018 09:40:57 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org, John Snow Date: Fri, 27 Apr 2018 11:40:44 +0200 Message-Id: <1524822046-22779-3-git-send-email-thuth@redhat.com> In-Reply-To: <1524822046-22779-1-git-send-email-thuth@redhat.com> References: <1524822046-22779-1-git-send-email-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Fri, 27 Apr 2018 09:40:58 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Fri, 27 Apr 2018 09:40:58 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'thuth@redhat.com' RCPT:'' Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH v3 2/4] tests/cdrom-test: Test booting from CD-ROM ISO image file X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-block@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" We already have the code for a boot file in tests/boot-sector.c, so if the genisoimage program is available, we can easily create a bootable CD ISO image that we can use for testing whether our CD-ROM emulation and the BIOS CD-ROM boot works correctly. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Michael S. Tsirkin Reviewed-by: Herv=C3=A9 Poussineau Acked-By: Mark Cave-Ayland Signed-off-by: Thomas Huth --- tests/Makefile.include | 2 + tests/cdrom-test.c | 164 +++++++++++++++++++++++++++++++++++++++++++++= ++++ 2 files changed, 166 insertions(+) create mode 100644 tests/cdrom-test.c diff --git a/tests/Makefile.include b/tests/Makefile.include index 3b9a5e3..41abda0 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -179,6 +179,7 @@ check-qtest-generic-y =3D tests/qmp-test$(EXESUF) gcov-files-generic-y =3D monitor.c qapi/qmp-dispatch.c check-qtest-generic-y +=3D tests/device-introspect-test$(EXESUF) gcov-files-generic-y =3D qdev-monitor.c qmp.c +check-qtest-generic-y +=3D tests/cdrom-test$(EXESUF) =20 gcov-files-ipack-y +=3D hw/ipack/ipack.c check-qtest-ipack-y +=3D tests/ipoctal232-test$(EXESUF) @@ -835,6 +836,7 @@ tests/test-qapi-util$(EXESUF): tests/test-qapi-util.o $= (test-util-obj-y) tests/numa-test$(EXESUF): tests/numa-test.o tests/vmgenid-test$(EXESUF): tests/vmgenid-test.o tests/boot-sector.o test= s/acpi-utils.o tests/sdhci-test$(EXESUF): tests/sdhci-test.o $(libqos-pc-obj-y) +tests/cdrom-test$(EXESUF): tests/cdrom-test.o tests/boot-sector.o $(libqos= -obj-y) =20 tests/migration/stress$(EXESUF): tests/migration/stress.o $(call quiet-command, $(LINKPROG) -static -O3 $(PTHREAD_LIB) -o $@ $< ,"L= INK","$(TARGET_DIR)$@") diff --git a/tests/cdrom-test.c b/tests/cdrom-test.c new file mode 100644 index 0000000..5bbf322 --- /dev/null +++ b/tests/cdrom-test.c @@ -0,0 +1,164 @@ +/* + * Various tests for emulated CD-ROM drives. + * + * Copyright (c) 2018 Red Hat Inc. + * + * Author: + * Thomas Huth + * + * This work is licensed under the terms of the GNU GPL, version 2 + * or later. See the COPYING file in the top-level directory. + */ + +#include "qemu/osdep.h" +#include "libqtest.h" +#include "boot-sector.h" + +static char isoimage[] =3D "cdrom-boot-iso-XXXXXX"; + +static int exec_genisoimg(const char **args) +{ + gchar *out_err =3D NULL; + gint exit_status =3D -1; + bool success; + + success =3D g_spawn_sync(NULL, (gchar **)args, NULL, + G_SPAWN_SEARCH_PATH | G_SPAWN_STDOUT_TO_DEV_NUL= L, + NULL, NULL, NULL, &out_err, &exit_status, NULL); + if (!success) { + return -ENOENT; + } + if (out_err) { + fputs(out_err, stderr); + g_free(out_err); + } + + return exit_status; +} + +static int prepare_image(const char *arch, char *isoimage) +{ + char srcdir[] =3D "cdrom-test-dir-XXXXXX"; + char *codefile =3D NULL; + int ifh, ret =3D -1; + const char *args[] =3D { + "genisoimage", "-quiet", "-l", "-no-emul-boot", + "-b", NULL, "-o", isoimage, srcdir, NULL + }; + + ifh =3D mkstemp(isoimage); + if (ifh < 0) { + perror("Error creating temporary iso image file"); + return -1; + } + if (!mkdtemp(srcdir)) { + perror("Error creating temporary directory"); + goto cleanup; + } + + if (g_str_equal(arch, "i386") || g_str_equal(arch, "x86_64") || + g_str_equal(arch, "s390x")) { + codefile =3D g_strdup_printf("%s/bootcode-XXXXXX", srcdir); + ret =3D boot_sector_init(codefile); + if (ret) { + goto cleanup; + } + } else { + /* Just create a dummy file */ + char txt[] =3D "empty disc"; + codefile =3D g_strdup_printf("%s/readme.txt", srcdir); + if (!g_file_set_contents(codefile, txt, sizeof(txt) - 1, NULL)) { + fprintf(stderr, "Failed to create '%s'\n", codefile); + goto cleanup; + } + } + + args[5] =3D strchr(codefile, '/') + 1; + ret =3D exec_genisoimg(args); + if (ret) { + fprintf(stderr, "genisoimage failed: %i\n", ret); + } + + unlink(codefile); + +cleanup: + g_free(codefile); + rmdir(srcdir); + close(ifh); + + return ret; +} + +static void test_cdboot(gconstpointer data) +{ + QTestState *qts; + + qts =3D qtest_startf("-accel kvm:tcg -no-shutdown %s%s", (const char *= )data, + isoimage); + boot_sector_test(qts); + qtest_quit(qts); +} + +static void add_x86_tests(void) +{ + qtest_add_data_func("cdrom/boot/default", "-cdrom ", test_cdboot); + qtest_add_data_func("cdrom/boot/virtio-scsi", + "-device virtio-scsi -device scsi-cd,drive=3Dcdr " + "-blockdev file,node-name=3Dcdr,filename=3D", test= _cdboot); + qtest_add_data_func("cdrom/boot/isapc", "-M isapc " + "-drive if=3Dide,media=3Dcdrom,file=3D", test_cdbo= ot); + qtest_add_data_func("cdrom/boot/am53c974", + "-device am53c974 -device scsi-cd,drive=3Dcd1 " + "-drive if=3Dnone,id=3Dcd1,format=3Draw,file=3D", = test_cdboot); + qtest_add_data_func("cdrom/boot/dc390", + "-device dc390 -device scsi-cd,drive=3Dcd1 " + "-blockdev file,node-name=3Dcd1,filename=3D", test= _cdboot); + qtest_add_data_func("cdrom/boot/lsi53c895a", + "-device lsi53c895a -device scsi-cd,drive=3Dcd1 " + "-blockdev file,node-name=3Dcd1,filename=3D", test= _cdboot); + qtest_add_data_func("cdrom/boot/megasas", "-M q35 " + "-device megasas -device scsi-cd,drive=3Dcd1 " + "-blockdev file,node-name=3Dcd1,filename=3D", test= _cdboot); + qtest_add_data_func("cdrom/boot/megasas-gen2", "-M q35 " + "-device megasas-gen2 -device scsi-cd,drive=3Dcd1 " + "-blockdev file,node-name=3Dcd1,filename=3D", test= _cdboot); +} + +static void add_s390x_tests(void) +{ + qtest_add_data_func("cdrom/boot/default", "-cdrom ", test_cdboot); + qtest_add_data_func("cdrom/boot/virtio-scsi", + "-device virtio-scsi -device scsi-cd,drive=3Dcdr " + "-blockdev file,node-name=3Dcdr,filename=3D", test= _cdboot); +} + +int main(int argc, char **argv) +{ + int ret; + const char *arch =3D qtest_get_arch(); + const char *genisocheck[] =3D { "genisoimage", "-version", NULL }; + + g_test_init(&argc, &argv, NULL); + + if (exec_genisoimg(genisocheck)) { + /* genisoimage not available - so can't run tests */ + return 0; + } + + ret =3D prepare_image(arch, isoimage); + if (ret) { + return ret; + } + + if (g_str_equal(arch, "i386") || g_str_equal(arch, "x86_64")) { + add_x86_tests(); + } else if (g_str_equal(arch, "s390x")) { + add_s390x_tests(); + } + + ret =3D g_test_run(); + + unlink(isoimage); + + return ret; +} --=20 1.8.3.1 From nobody Sat Oct 25 11:06:50 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 152482288466336.908851586121614; Fri, 27 Apr 2018 02:54:44 -0700 (PDT) Received: from localhost ([::1]:46871 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fC05R-0006sd-IY for importer@patchew.org; Fri, 27 Apr 2018 05:54:41 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37375) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fBzsJ-0002Pi-Cp for qemu-devel@nongnu.org; Fri, 27 Apr 2018 05:41:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fBzsI-0003z6-9r for qemu-devel@nongnu.org; Fri, 27 Apr 2018 05:41:07 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:56298 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fBzsC-0003rX-A4; Fri, 27 Apr 2018 05:41:00 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DC93E406AE22; Fri, 27 Apr 2018 09:40:59 +0000 (UTC) Received: from thh440s.redhat.com (ovpn-116-17.ams2.redhat.com [10.36.116.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id D0C07AB3F3; Fri, 27 Apr 2018 09:40:58 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org, John Snow Date: Fri, 27 Apr 2018 11:40:45 +0200 Message-Id: <1524822046-22779-4-git-send-email-thuth@redhat.com> In-Reply-To: <1524822046-22779-1-git-send-email-thuth@redhat.com> References: <1524822046-22779-1-git-send-email-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Fri, 27 Apr 2018 09:40:59 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Fri, 27 Apr 2018 09:40:59 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'thuth@redhat.com' RCPT:'' Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH v3 3/4] tests/cdrom-test: Test that -cdrom parameter is working X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-block@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Commit 1454509726719e0933c800 recently broke the "-cdrom" parameter on a couple of boards without us noticing it immediately. Thus let's add a test which checks that "-cdrom" can at least be used to start QEMU with certain machine types. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Michael S. Tsirkin Reviewed-by: Herv=C3=A9 Poussineau Acked-By: Mark Cave-Ayland Signed-off-by: Thomas Huth --- tests/cdrom-test.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++= ++++ 1 file changed, 58 insertions(+) diff --git a/tests/cdrom-test.c b/tests/cdrom-test.c index 5bbf322..7a1fce5 100644 --- a/tests/cdrom-test.c +++ b/tests/cdrom-test.c @@ -13,6 +13,7 @@ #include "qemu/osdep.h" #include "libqtest.h" #include "boot-sector.h" +#include "qapi/qmp/qdict.h" =20 static char isoimage[] =3D "cdrom-boot-iso-XXXXXX"; =20 @@ -89,6 +90,32 @@ cleanup: return ret; } =20 +/** + * Check that at least the -cdrom parameter is basically working, i.e. we = can + * see the filename of the ISO image in the output of "info block" afterwa= rds + */ +static void test_cdrom_param(gconstpointer data) +{ + QTestState *qts; + char *resp; + + qts =3D qtest_startf("-M %s -cdrom %s", (const char *)data, isoimage); + resp =3D qtest_hmp(qts, "info block"); + g_assert(strstr(resp, isoimage) !=3D 0); + g_free(resp); + qtest_quit(qts); +} + +static void add_cdrom_param_tests(const char **machines) +{ + while (*machines) { + char *testname =3D g_strdup_printf("cdrom/param/%s", *machines); + qtest_add_data_func(testname, *machines, test_cdrom_param); + g_free(testname); + machines++; + } +} + static void test_cdboot(gconstpointer data) { QTestState *qts; @@ -154,6 +181,37 @@ int main(int argc, char **argv) add_x86_tests(); } else if (g_str_equal(arch, "s390x")) { add_s390x_tests(); + } else if (g_str_equal(arch, "ppc64")) { + const char *ppcmachines[] =3D { + "pseries", "mac99", "g3beige", "40p", "prep", NULL + }; + add_cdrom_param_tests(ppcmachines); + } else if (g_str_equal(arch, "sparc")) { + const char *sparcmachines[] =3D { + "LX", "SPARCClassic", "SPARCbook", "SS-10", "SS-20", "SS-4", + "SS-5", "SS-600MP", "Voyager", "leon3_generic", NULL + }; + add_cdrom_param_tests(sparcmachines); + } else if (g_str_equal(arch, "sparc64")) { + const char *sparc64machines[] =3D { + "niagara", "sun4u", "sun4v", NULL + }; + add_cdrom_param_tests(sparc64machines); + } else if (!strncmp(arch, "mips64", 6)) { + const char *mips64machines[] =3D { + "magnum", "malta", "mips", "pica61", NULL + }; + add_cdrom_param_tests(mips64machines); + } else if (g_str_equal(arch, "arm") || g_str_equal(arch, "aarch64")) { + const char *armmachines[] =3D { + "realview-eb", "realview-eb-mpcore", "realview-pb-a8", + "realview-pbx-a9", "versatileab", "versatilepb", "vexpress-a15= ", + "vexpress-a9", "virt", NULL + }; + add_cdrom_param_tests(armmachines); + } else { + const char *nonemachine[] =3D { "none", NULL }; + add_cdrom_param_tests(nonemachine); } =20 ret =3D g_test_run(); --=20 1.8.3.1 From nobody Sat Oct 25 11:06:50 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1524824323532255.42678825168343; Fri, 27 Apr 2018 03:18:43 -0700 (PDT) Received: from localhost ([::1]:47055 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fC0Sg-0005DC-Q2 for importer@patchew.org; Fri, 27 Apr 2018 06:18:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37368) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fBzsI-0002PI-VA for qemu-devel@nongnu.org; Fri, 27 Apr 2018 05:41:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fBzsI-0003yn-52 for qemu-devel@nongnu.org; Fri, 27 Apr 2018 05:41:07 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:36326 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fBzsD-0003sP-Nm; Fri, 27 Apr 2018 05:41:01 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 51379722F3; Fri, 27 Apr 2018 09:41:01 +0000 (UTC) Received: from thh440s.redhat.com (ovpn-116-17.ams2.redhat.com [10.36.116.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id 468ECAB3F1; Fri, 27 Apr 2018 09:41:00 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org, John Snow Date: Fri, 27 Apr 2018 11:40:46 +0200 Message-Id: <1524822046-22779-5-git-send-email-thuth@redhat.com> In-Reply-To: <1524822046-22779-1-git-send-email-thuth@redhat.com> References: <1524822046-22779-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Fri, 27 Apr 2018 09:41:01 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Fri, 27 Apr 2018 09:41:01 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'thuth@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH v3 4/4] MAINTAINERS: Add the cdrom-test to John's section X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-block@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The cdrom-test checks various block types - IDE, SCSI and virtio, so it's a little bit hard to decide where this should belong to in the MAINTAINERS file. But John volunteered to take it, so let's put it into the IDE section for now. Signed-off-by: Thomas Huth --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 24b7016..6cceb10 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -998,6 +998,7 @@ F: hw/block/cdrom.c F: hw/block/hd-geometry.c F: tests/ide-test.c F: tests/ahci-test.c +F: tests/cdrom-test.c F: tests/libqos/ahci* T: git git://github.com/jnsnow/qemu.git ide =20 --=20 1.8.3.1