From patchwork Fri Mar 19 13:25:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1455856 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4F24SZ5lTmz9s1l for ; Sat, 20 Mar 2021 00:27:26 +1100 (AEDT) Received: from localhost ([::1]:55720 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lNF9w-0000hU-Q5 for incoming@patchwork.ozlabs.org; Fri, 19 Mar 2021 09:27:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60766) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNF8U-0000L0-QG; Fri, 19 Mar 2021 09:25:54 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:38431) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNF8P-0003gs-6m; Fri, 19 Mar 2021 09:25:54 -0400 Received: from localhost.localdomain ([82.142.20.38]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MD9jV-1lWHgt2c2T-009AdL; Fri, 19 Mar 2021 14:25:42 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PATCH v2 1/6] qdev: define list of archs with virtio-pci or virtio-ccw Date: Fri, 19 Mar 2021 14:25:32 +0100 Message-Id: <20210319132537.2046339-2-laurent@vivier.eu> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210319132537.2046339-1-laurent@vivier.eu> References: <20210319132537.2046339-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:+A6+/tfs+3tqqwj+IyJ/NFc6Ktm+AYuoxtB09vWAtfzoCpVJFLr kPW5483n+z9QJaJraCEJ2Ml/zSJbowXUfjfHu8P/ZthshANrYIukX7Orp6pNngX6BS7HOan 8bZ88HgTdv1Q87fvuw90miTo088lFxRKtzUFlPA/TfZUGi5331Za9Ji8nwZpdPD8gdAxCy+ To/OXqbuIer0JzdVsaYdQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:H9HugrLtpp8=:OuON+Xh0ztH3hoAn/1odGj bqCxMhjkIx20Ax9tmtEKyKkNhtnXWN3DFbWBnftx0wXDgd6Y9ZwYJ/QJ04kTjS8fDsGlGErC7 Q4T1vg3tPZqzc/x/UniG8ePXGW8FBEf5wbyx/XtIL47lzzMf6d16aLiY8wtW3PIXhvKLQMacq euO10nvGO/SSDXGAEWc04Aav0rufQffZFbXPCufHxOUKWM+/OicSO+OFOjYzTspX7pbVi0wTq ++LItpZhiRwb/rpqjBqsBb8Bdim3HdMQuAPphlySSdIy9nHg4afW/3mJpzZfDTpF4HN7huMNF wtu9hTehN1y48lj6tW6dfZNVullPchxzlLpCAwD5geY0dGzTvMCsX1BQfTwzBOR2HxtkvPiyS jccZnBbSih1ygpUZUCZLpQFXRQfqDO01qyb3Rv+/j48POgQ4MdusMoVO+6HzVqqQRWJMb2VAO A4dbSdHZeA== Received-SPF: none client-ip=212.227.126.187; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Peter Maydell , Thomas Huth , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , qemu-block@nongnu.org, Cornelia Huck , Markus Armbruster , Max Reitz , qemu-s390x@nongnu.org, Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This is used to define virtio-*-pci and virtio-*-ccw aliases rather than substracting the CCW architecture from all the others. Signed-off-by: Laurent Vivier Reviewed-by: Cornelia Huck --- include/sysemu/arch_init.h | 7 +++++ softmmu/qdev-monitor.c | 53 ++++++++++++++++++-------------------- 2 files changed, 32 insertions(+), 28 deletions(-) diff --git a/include/sysemu/arch_init.h b/include/sysemu/arch_init.h index 54f069d49126..7217a822a14b 100644 --- a/include/sysemu/arch_init.h +++ b/include/sysemu/arch_init.h @@ -35,4 +35,11 @@ extern const uint32_t arch_type; int kvm_available(void); int xen_available(void); +#define QEMU_ARCH_VIRTIO_PCI (QEMU_ARCH_ALPHA | QEMU_ARCH_ARM | \ + QEMU_ARCH_HPPA | QEMU_ARCH_I386 | \ + QEMU_ARCH_MIPS | QEMU_ARCH_PPC | \ + QEMU_ARCH_RISCV | QEMU_ARCH_SH4 | \ + QEMU_ARCH_SPARC | QEMU_ARCH_XTENSA) +#define QEMU_ARCH_VIRTIO_CCW (QEMU_ARCH_S390X) + #endif diff --git a/softmmu/qdev-monitor.c b/softmmu/qdev-monitor.c index 8dc656becca9..0b40c97c6e50 100644 --- a/softmmu/qdev-monitor.c +++ b/softmmu/qdev-monitor.c @@ -60,34 +60,31 @@ static const QDevAlias qdev_alias_table[] = { { "ES1370", "es1370" }, /* -soundhw name */ { "ich9-ahci", "ahci" }, { "lsi53c895a", "lsi" }, - { "virtio-9p-ccw", "virtio-9p", QEMU_ARCH_S390X }, - { "virtio-9p-pci", "virtio-9p", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X }, - { "virtio-balloon-ccw", "virtio-balloon", QEMU_ARCH_S390X }, - { "virtio-balloon-pci", "virtio-balloon", - QEMU_ARCH_ALL & ~QEMU_ARCH_S390X }, - { "virtio-blk-ccw", "virtio-blk", QEMU_ARCH_S390X }, - { "virtio-blk-pci", "virtio-blk", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X }, - { "virtio-gpu-ccw", "virtio-gpu", QEMU_ARCH_S390X }, - { "virtio-gpu-pci", "virtio-gpu", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X }, - { "virtio-input-host-ccw", "virtio-input-host", QEMU_ARCH_S390X }, - { "virtio-input-host-pci", "virtio-input-host", - QEMU_ARCH_ALL & ~QEMU_ARCH_S390X }, - { "virtio-iommu-pci", "virtio-iommu", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X }, - { "virtio-keyboard-ccw", "virtio-keyboard", QEMU_ARCH_S390X }, - { "virtio-keyboard-pci", "virtio-keyboard", - QEMU_ARCH_ALL & ~QEMU_ARCH_S390X }, - { "virtio-mouse-ccw", "virtio-mouse", QEMU_ARCH_S390X }, - { "virtio-mouse-pci", "virtio-mouse", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X }, - { "virtio-net-ccw", "virtio-net", QEMU_ARCH_S390X }, - { "virtio-net-pci", "virtio-net", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X }, - { "virtio-rng-ccw", "virtio-rng", QEMU_ARCH_S390X }, - { "virtio-rng-pci", "virtio-rng", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X }, - { "virtio-scsi-ccw", "virtio-scsi", QEMU_ARCH_S390X }, - { "virtio-scsi-pci", "virtio-scsi", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X }, - { "virtio-serial-ccw", "virtio-serial", QEMU_ARCH_S390X }, - { "virtio-serial-pci", "virtio-serial", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X }, - { "virtio-tablet-ccw", "virtio-tablet", QEMU_ARCH_S390X }, - { "virtio-tablet-pci", "virtio-tablet", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X }, + { "virtio-9p-ccw", "virtio-9p", QEMU_ARCH_VIRTIO_CCW }, + { "virtio-9p-pci", "virtio-9p", QEMU_ARCH_VIRTIO_PCI }, + { "virtio-balloon-ccw", "virtio-balloon", QEMU_ARCH_VIRTIO_CCW }, + { "virtio-balloon-pci", "virtio-balloon", QEMU_ARCH_VIRTIO_PCI }, + { "virtio-blk-ccw", "virtio-blk", QEMU_ARCH_VIRTIO_CCW }, + { "virtio-blk-pci", "virtio-blk", QEMU_ARCH_VIRTIO_PCI }, + { "virtio-gpu-ccw", "virtio-gpu", QEMU_ARCH_VIRTIO_CCW }, + { "virtio-gpu-pci", "virtio-gpu", QEMU_ARCH_VIRTIO_PCI }, + { "virtio-input-host-ccw", "virtio-input-host", QEMU_ARCH_VIRTIO_CCW }, + { "virtio-input-host-pci", "virtio-input-host", QEMU_ARCH_VIRTIO_PCI }, + { "virtio-iommu-pci", "virtio-iommu", QEMU_ARCH_VIRTIO_PCI }, + { "virtio-keyboard-ccw", "virtio-keyboard", QEMU_ARCH_VIRTIO_CCW }, + { "virtio-keyboard-pci", "virtio-keyboard", QEMU_ARCH_VIRTIO_PCI }, + { "virtio-mouse-ccw", "virtio-mouse", QEMU_ARCH_VIRTIO_CCW }, + { "virtio-mouse-pci", "virtio-mouse", QEMU_ARCH_VIRTIO_PCI }, + { "virtio-net-ccw", "virtio-net", QEMU_ARCH_VIRTIO_CCW }, + { "virtio-net-pci", "virtio-net", QEMU_ARCH_VIRTIO_PCI }, + { "virtio-rng-ccw", "virtio-rng", QEMU_ARCH_VIRTIO_CCW }, + { "virtio-rng-pci", "virtio-rng", QEMU_ARCH_VIRTIO_PCI }, + { "virtio-scsi-ccw", "virtio-scsi", QEMU_ARCH_VIRTIO_CCW }, + { "virtio-scsi-pci", "virtio-scsi", QEMU_ARCH_VIRTIO_PCI }, + { "virtio-serial-ccw", "virtio-serial", QEMU_ARCH_VIRTIO_CCW }, + { "virtio-serial-pci", "virtio-serial", QEMU_ARCH_VIRTIO_PCI}, + { "virtio-tablet-ccw", "virtio-tablet", QEMU_ARCH_VIRTIO_CCW }, + { "virtio-tablet-pci", "virtio-tablet", QEMU_ARCH_VIRTIO_PCI }, { } }; From patchwork Fri Mar 19 13:25:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1455865 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4F24YN0j1dz9sWj for ; Sat, 20 Mar 2021 00:31:34 +1100 (AEDT) Received: from localhost ([::1]:40740 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lNFDw-0006Jb-VZ for incoming@patchwork.ozlabs.org; Fri, 19 Mar 2021 09:31:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60784) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNF8V-0000MK-IB; Fri, 19 Mar 2021 09:25:55 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:54837) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNF8P-0003hX-R9; Fri, 19 Mar 2021 09:25:55 -0400 Received: from localhost.localdomain ([82.142.20.38]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MofLl-1m3AfG2fo9-00p527; Fri, 19 Mar 2021 14:25:43 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PATCH v2 2/6] m68k: add the virtio devices aliases Date: Fri, 19 Mar 2021 14:25:33 +0100 Message-Id: <20210319132537.2046339-3-laurent@vivier.eu> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210319132537.2046339-1-laurent@vivier.eu> References: <20210319132537.2046339-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:OgUOTu8qY2H+iTDZSZBpxuzyifI3Hh8o+sOHBOsRX3HNH4SZeWQ upONh8sF3JsxXEa3FxaIK3we92TxSH5AWL6mDleKRytB6h+qlK1aluaI7cG1uEQxlb9ZYaI LhsIcCTbfCJgbVvHoQqHFlX9TKIpfEhVb/s8FO1IblxC0BJ08kzDhY+cWoniDExOIOe/8Fr 5NWooLsg1eqmdRLYZldyg== X-UI-Out-Filterresults: notjunk:1;V03:K0:WAam94Wuxfg=:PMRwxtB/wfDnUtYByQtt5P 4lBDN2+5hEW6SSdFPSTb2N2Nq0/fvttfWTWKhrJgrKXJwwFBjU7XXUdB9Vc44Sy6i3rInnI4s /mOZCUDFq+8uTa2BbiWrV6gktB8j19M09I/s/ASfnIeE1kEDI7S2bFKGTE0SUFTbz35rZDJT5 PhBmIegQJy/1TgzZ1VcAv0vPtF0uD8k1gow37sW/gX+se0qxbc2zOggp8zGlA1SUO3X18hjsu teAFuvyAzRKxB7P1BRhxHtSgCwakA6tgTp9Jd+EwxMxuttCWE+RGHdVQF5/1p1KUAtbZsQyZv POycOrO3LAI7mPpqaP6vX0bRb/9EGVZRRflOJFRFs1V8e5pn7HUKauLKmvtx8asBsFuu16HrK oELWJL9Ay3gH4v/9XAI8EgITVWEoV/IwXUCCxrDoa6Xi7w3CcLZAf71eBs1Z0 Received-SPF: none client-ip=212.227.126.135; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Peter Maydell , Thomas Huth , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , qemu-block@nongnu.org, Cornelia Huck , Markus Armbruster , Max Reitz , qemu-s390x@nongnu.org, Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Similarly to 5f629d943cb0 ("s390x: fix s390 virtio aliases"), define the virtio aliases. This allows to start machines with virtio devices without knowledge of the implementation type. For instance, we can use "-device virtio-scsi" on m68k, s390x or PC, and the device will be respectively "virtio-scsi-device", "virtio-scsi-ccw" or "virtio-scsi-pci". This already exists for s390x and -ccw interfaces, add them for m68k and MMIO (-device) interfaces. Signed-off-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Cornelia Huck --- include/sysemu/arch_init.h | 1 + softmmu/qdev-monitor.c | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/include/sysemu/arch_init.h b/include/sysemu/arch_init.h index 7217a822a14b..c6e34124e8a3 100644 --- a/include/sysemu/arch_init.h +++ b/include/sysemu/arch_init.h @@ -41,5 +41,6 @@ int xen_available(void); QEMU_ARCH_RISCV | QEMU_ARCH_SH4 | \ QEMU_ARCH_SPARC | QEMU_ARCH_XTENSA) #define QEMU_ARCH_VIRTIO_CCW (QEMU_ARCH_S390X) +#define QEMU_ARCH_VIRTIO_MMIO (QEMU_ARCH_M68K) #endif diff --git a/softmmu/qdev-monitor.c b/softmmu/qdev-monitor.c index 0b40c97c6e50..a9955b97a078 100644 --- a/softmmu/qdev-monitor.c +++ b/softmmu/qdev-monitor.c @@ -60,29 +60,41 @@ static const QDevAlias qdev_alias_table[] = { { "ES1370", "es1370" }, /* -soundhw name */ { "ich9-ahci", "ahci" }, { "lsi53c895a", "lsi" }, + { "virtio-9p-device", "virtio-9p", QEMU_ARCH_VIRTIO_MMIO }, { "virtio-9p-ccw", "virtio-9p", QEMU_ARCH_VIRTIO_CCW }, { "virtio-9p-pci", "virtio-9p", QEMU_ARCH_VIRTIO_PCI }, + { "virtio-balloon-device", "virtio-balloon", QEMU_ARCH_VIRTIO_MMIO }, { "virtio-balloon-ccw", "virtio-balloon", QEMU_ARCH_VIRTIO_CCW }, { "virtio-balloon-pci", "virtio-balloon", QEMU_ARCH_VIRTIO_PCI }, + { "virtio-blk-device", "virtio-blk", QEMU_ARCH_VIRTIO_MMIO }, { "virtio-blk-ccw", "virtio-blk", QEMU_ARCH_VIRTIO_CCW }, { "virtio-blk-pci", "virtio-blk", QEMU_ARCH_VIRTIO_PCI }, + { "virtio-gpu-device", "virtio-gpu", QEMU_ARCH_VIRTIO_MMIO }, { "virtio-gpu-ccw", "virtio-gpu", QEMU_ARCH_VIRTIO_CCW }, { "virtio-gpu-pci", "virtio-gpu", QEMU_ARCH_VIRTIO_PCI }, + { "virtio-input-host-device", "virtio-input-host", QEMU_ARCH_VIRTIO_MMIO }, { "virtio-input-host-ccw", "virtio-input-host", QEMU_ARCH_VIRTIO_CCW }, { "virtio-input-host-pci", "virtio-input-host", QEMU_ARCH_VIRTIO_PCI }, { "virtio-iommu-pci", "virtio-iommu", QEMU_ARCH_VIRTIO_PCI }, + { "virtio-keyboard-device", "virtio-keyboard", QEMU_ARCH_VIRTIO_MMIO }, { "virtio-keyboard-ccw", "virtio-keyboard", QEMU_ARCH_VIRTIO_CCW }, { "virtio-keyboard-pci", "virtio-keyboard", QEMU_ARCH_VIRTIO_PCI }, + { "virtio-mouse-device", "virtio-mouse", QEMU_ARCH_VIRTIO_MMIO }, { "virtio-mouse-ccw", "virtio-mouse", QEMU_ARCH_VIRTIO_CCW }, { "virtio-mouse-pci", "virtio-mouse", QEMU_ARCH_VIRTIO_PCI }, + { "virtio-net-device", "virtio-net", QEMU_ARCH_VIRTIO_MMIO }, { "virtio-net-ccw", "virtio-net", QEMU_ARCH_VIRTIO_CCW }, { "virtio-net-pci", "virtio-net", QEMU_ARCH_VIRTIO_PCI }, + { "virtio-rng-device", "virtio-rng", QEMU_ARCH_VIRTIO_MMIO }, { "virtio-rng-ccw", "virtio-rng", QEMU_ARCH_VIRTIO_CCW }, { "virtio-rng-pci", "virtio-rng", QEMU_ARCH_VIRTIO_PCI }, + { "virtio-scsi-device", "virtio-scsi", QEMU_ARCH_VIRTIO_MMIO }, { "virtio-scsi-ccw", "virtio-scsi", QEMU_ARCH_VIRTIO_CCW }, { "virtio-scsi-pci", "virtio-scsi", QEMU_ARCH_VIRTIO_PCI }, + { "virtio-serial-device", "virtio-serial", QEMU_ARCH_VIRTIO_MMIO }, { "virtio-serial-ccw", "virtio-serial", QEMU_ARCH_VIRTIO_CCW }, { "virtio-serial-pci", "virtio-serial", QEMU_ARCH_VIRTIO_PCI}, + { "virtio-tablet-device", "virtio-tablet", QEMU_ARCH_VIRTIO_MMIO }, { "virtio-tablet-ccw", "virtio-tablet", QEMU_ARCH_VIRTIO_CCW }, { "virtio-tablet-pci", "virtio-tablet", QEMU_ARCH_VIRTIO_PCI }, { } From patchwork Fri Mar 19 13:25:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1455863 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4F24WQ683vz9s1l for ; Sat, 20 Mar 2021 00:29:54 +1100 (AEDT) Received: from localhost ([::1]:36170 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lNFCK-0004Mh-Qx for incoming@patchwork.ozlabs.org; Fri, 19 Mar 2021 09:29:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60816) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNF8W-0000Pm-OJ; Fri, 19 Mar 2021 09:25:56 -0400 Received: from mout.kundenserver.de ([212.227.126.133]:34229) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNF8U-0003iQ-VH; Fri, 19 Mar 2021 09:25:56 -0400 Received: from localhost.localdomain ([82.142.20.38]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MqsGv-1m0xjt33Vx-00mtAl; Fri, 19 Mar 2021 14:25:44 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PATCH v2 3/6] blockdev: with -drive if=virtio, use generic virtio-blk Date: Fri, 19 Mar 2021 14:25:34 +0100 Message-Id: <20210319132537.2046339-4-laurent@vivier.eu> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210319132537.2046339-1-laurent@vivier.eu> References: <20210319132537.2046339-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:xOx9VxqUkLOu2NSxK/kCzFFxEx/YtZarAkHl9WFSjsauxIwkAQd d8yVj/fjmCl8TTU0OgkJasUnPCBoLfCt8he0zDMDiI73CLywv8D43BfkntUH4Fon9Reyp3x OM7Tl7Ouv2Zx+MM9j9wNR2k7uuHsQLgZEV6bdFglxy1M0qG5YtWq1OLeCurOohtzGD798ug eWaBzjpGo+Q9IbVhAq/4Q== X-UI-Out-Filterresults: notjunk:1;V03:K0:1z2ypyFFSbM=:SaeS/ffYLz6TRwISG4jLbf CxVcpj9yUwUukWqXgmIvM/IMfgQMwOIbb+d0BjH5Q8mFW5ycYtnE8PyxhwllrmJXSsG7P+Bp3 TqSu7wFKRRMFoFlpeSSbUmThUCTBeBYjjf4gSZTOTRFVOafXjuA1j3mJY1avl7p/U58ZViDYO BI2ETBT1s+HY8xs7lEctkRbS2g9UCJBxxefQYWNmRdjUNtlczwetTbg9BoGHNYO8/hLMLnaYW bnnP+jUkK7bRdA8fgUTvjkxcWDCqStqtWe9W2rVJiRQW1X1SeGekil8QWKt5fCG0lPiGNK5WL AAldz3+m4PnIoWjDnuNDgz0ZEzKAkGqvaIWcYEDLEAGJyYI4fGoiHRRkl1FL4RK5YTHA5PRaL Og4glKVxHPJ+cWtGbsHC6420eRq2keQTMdfpS1crWAIAl4JJ47gWPOeFSTmty Received-SPF: none client-ip=212.227.126.133; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Peter Maydell , Thomas Huth , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , qemu-block@nongnu.org, Cornelia Huck , Markus Armbruster , Max Reitz , qemu-s390x@nongnu.org, Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Rather than checking if the machine is an s390x to use virtio-blk-ccw instead of virtio-blk-pci, use the alias virtio-blk that is set to the expected target. This also enables the use of virtio-blk-device for targets without PCI or CCW. Signed-off-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé --- blockdev.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/blockdev.c b/blockdev.c index 5cc7c7effe9f..64da5350e3ad 100644 --- a/blockdev.c +++ b/blockdev.c @@ -969,11 +969,7 @@ DriveInfo *drive_new(QemuOpts *all_opts, BlockInterfaceType block_default_type, QemuOpts *devopts; devopts = qemu_opts_create(qemu_find_opts("device"), NULL, 0, &error_abort); - if (arch_type == QEMU_ARCH_S390X) { - qemu_opt_set(devopts, "driver", "virtio-blk-ccw", &error_abort); - } else { - qemu_opt_set(devopts, "driver", "virtio-blk-pci", &error_abort); - } + qemu_opt_set(devopts, "driver", "virtio-blk", &error_abort); qemu_opt_set(devopts, "drive", qdict_get_str(bs_opts, "id"), &error_abort); } From patchwork Fri Mar 19 13:25:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1455855 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4F24SQ11Hzz9sRf for ; Sat, 20 Mar 2021 00:27:18 +1100 (AEDT) Received: from localhost ([::1]:55554 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lNF9o-0000bM-5W for incoming@patchwork.ozlabs.org; Fri, 19 Mar 2021 09:27:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60842) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNF8Y-0000SZ-3Z; Fri, 19 Mar 2021 09:25:58 -0400 Received: from mout.kundenserver.de ([212.227.126.133]:37187) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNF8V-0003jp-36; Fri, 19 Mar 2021 09:25:57 -0400 Received: from localhost.localdomain ([82.142.20.38]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MPXxi-1l1sUd3SjK-00MakG; Fri, 19 Mar 2021 14:25:46 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PATCH v2 4/6] iotests: Revert "iotests: use -ccw on s390x for 040, 139, and 182" Date: Fri, 19 Mar 2021 14:25:35 +0100 Message-Id: <20210319132537.2046339-5-laurent@vivier.eu> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210319132537.2046339-1-laurent@vivier.eu> References: <20210319132537.2046339-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:G2mcWU/lq56Ymq+Ud8GDo2ctN6KkOR6H4PYyyZWiQwJEQSljzry qNtvnd0R32bAq2MORguFNFTfhVrmbnifNhCUCm0FQmgGYHqh//A/y6muQicqZkc7tMpjOPa i2LdZfYJRLSsHPLFJ6dFaY4SQ0U4ZfEf62UgLO4H9QrL3Cayf/xiEOgUl+jE/nj4Vd63t58 DNpuRGcLCEvddYh7LVLWA== X-UI-Out-Filterresults: notjunk:1;V03:K0:OkXwSH25m8Q=:fuJb4W+WrXSJu2Q+zDyqce FYCn67HL3D2qdsHPVUfjDbXZ8BzcHf0kcExB0WC+33fIPeKezLJfMZUJ4HdWCtyWznpoBfxZM eRjvBgryq74inyfgJxbAn+pAu/7ETGNjK+Og7CnHA7z19P37fGghmuCEShSVlz8KoZtmk+bdS pry8E0+Dwb3yTzdIWjYULq5Ug10P6Y7PwoC8d71zEHA1ddIwn+kZzcUmSB4SXpTBMk3v6U2b6 2H5hxV1p5IKxWGXRfL5tZYwhc6AdwCsjS7tfNqnvpxCg25JZNHls+mJqpMVi9NQIu2LaXdfau /nwTcRe9z/nXmVyVWzhMKr/Vgb9xIBLOWwkVGELmfT14rJgMMuy5LZ0yBqip/lAVxfqZrQLub B3HR2FEO9qyo7fLawA/bih2ZmA/efsL6CJD/hEtbzobdZUbycBc2C+iBqpe+8 Received-SPF: none client-ip=212.227.126.133; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Peter Maydell , Thomas Huth , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , qemu-block@nongnu.org, Cornelia Huck , Markus Armbruster , Max Reitz , qemu-s390x@nongnu.org, Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Commit f1d5516ab583 introduces a test in some iotests to check if the machine is a s390-ccw-virtio and to select virtio-*-ccw rather than virtio-*-pci. We don't need that because QEMU already provides aliases to use the correct virtio interface according to the machine type. This patch removes all virtio-*-pci and virtio-*-ccw to use virtio-* instead. This also enables virtio-mmio devices (virtio-*-device) Signed-off-by: Laurent Vivier cc: Cornelia Huck Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Reviewed-by: Cornelia Huck --- tests/qemu-iotests/040 | 2 +- tests/qemu-iotests/051 | 12 +----------- tests/qemu-iotests/051.out | 2 +- tests/qemu-iotests/051.pc.out | 2 +- tests/qemu-iotests/068 | 4 +--- tests/qemu-iotests/093 | 3 +-- tests/qemu-iotests/139 | 9 ++------- tests/qemu-iotests/182 | 13 ++----------- tests/qemu-iotests/238 | 4 +--- tests/qemu-iotests/240 | 10 +++++----- tests/qemu-iotests/257 | 4 ++-- tests/qemu-iotests/307 | 4 +--- tests/qemu-iotests/iotests.py | 5 ----- 13 files changed, 19 insertions(+), 55 deletions(-) diff --git a/tests/qemu-iotests/040 b/tests/qemu-iotests/040 index 336ff7c4f2ab..ba7cb34ce8cf 100755 --- a/tests/qemu-iotests/040 +++ b/tests/qemu-iotests/040 @@ -89,7 +89,7 @@ class TestSingleDrive(ImageCommitTestCase): qemu_io('-f', 'raw', '-c', 'write -P 0xab 0 524288', backing_img) qemu_io('-f', iotests.imgfmt, '-c', 'write -P 0xef 524288 524288', mid_img) self.vm = iotests.VM().add_drive(test_img, "node-name=top,backing.node-name=mid,backing.backing.node-name=base", interface="none") - self.vm.add_device(iotests.get_virtio_scsi_device()) + self.vm.add_device('virtio-scsi') self.vm.add_device("scsi-hd,id=scsi0,drive=drive0") self.vm.launch() self.has_quit = False diff --git a/tests/qemu-iotests/051 b/tests/qemu-iotests/051 index 7cbd1415ce7b..00382cc55e25 100755 --- a/tests/qemu-iotests/051 +++ b/tests/qemu-iotests/051 @@ -119,17 +119,7 @@ echo echo === Device without drive === echo -case "$QEMU_DEFAULT_MACHINE" in - s390-ccw-virtio) - virtio_scsi=virtio-scsi-ccw - ;; - *) - virtio_scsi=virtio-scsi-pci - ;; -esac - -run_qemu -device $virtio_scsi -device scsi-hd | - sed -e "s/$virtio_scsi/VIRTIO_SCSI/" +run_qemu -device virtio-scsi -device scsi-hd echo echo === Overriding backing file === diff --git a/tests/qemu-iotests/051.out b/tests/qemu-iotests/051.out index de4771bcb36d..437053c8395c 100644 --- a/tests/qemu-iotests/051.out +++ b/tests/qemu-iotests/051.out @@ -72,7 +72,7 @@ QEMU_PROG: -drive file=TEST_DIR/t.qcow2,node-name=foo#12: Invalid node name === Device without drive === -Testing: -device VIRTIO_SCSI -device scsi-hd +Testing: -device virtio-scsi -device scsi-hd QEMU X.Y.Z monitor - type 'help' for more information (qemu) QEMU_PROG: -device scsi-hd: drive property not set diff --git a/tests/qemu-iotests/051.pc.out b/tests/qemu-iotests/051.pc.out index f570610f645f..c4e011369809 100644 --- a/tests/qemu-iotests/051.pc.out +++ b/tests/qemu-iotests/051.pc.out @@ -72,7 +72,7 @@ QEMU_PROG: -drive file=TEST_DIR/t.qcow2,node-name=foo#12: Invalid node-name: 'fo === Device without drive === -Testing: -device VIRTIO_SCSI -device scsi-hd +Testing: -device virtio-scsi -device scsi-hd QEMU X.Y.Z monitor - type 'help' for more information (qemu) QEMU_PROG: -device scsi-hd: drive property not set diff --git a/tests/qemu-iotests/068 b/tests/qemu-iotests/068 index 03e03508a6e2..54e49c8ffab1 100755 --- a/tests/qemu-iotests/068 +++ b/tests/qemu-iotests/068 @@ -49,11 +49,9 @@ IMG_SIZE=128K case "$QEMU_DEFAULT_MACHINE" in s390-ccw-virtio) platform_parm="-no-shutdown" - hba=virtio-scsi-ccw ;; *) platform_parm="" - hba=virtio-scsi-pci ;; esac @@ -61,7 +59,7 @@ _qemu() { $QEMU $platform_parm -nographic -monitor stdio -serial none \ -drive if=none,id=drive0,file="$TEST_IMG",format="$IMGFMT" \ - -device $hba,id=hba0 \ + -device virtio-scsi,id=hba0 \ -device scsi-hd,drive=drive0 \ "$@" |\ _filter_qemu | _filter_hmp diff --git a/tests/qemu-iotests/093 b/tests/qemu-iotests/093 index 7745cb04b611..93274dc8cbde 100755 --- a/tests/qemu-iotests/093 +++ b/tests/qemu-iotests/093 @@ -371,8 +371,7 @@ class ThrottleTestGroupNames(iotests.QMPTestCase): class ThrottleTestRemovableMedia(iotests.QMPTestCase): def setUp(self): self.vm = iotests.VM() - self.vm.add_device("{},id=virtio-scsi".format( - iotests.get_virtio_scsi_device())) + self.vm.add_device("{},id=virtio-scsi".format('virtio-scsi')) self.vm.launch() def tearDown(self): diff --git a/tests/qemu-iotests/139 b/tests/qemu-iotests/139 index e79b3c21fdce..178b1ee230ca 100755 --- a/tests/qemu-iotests/139 +++ b/tests/qemu-iotests/139 @@ -26,18 +26,13 @@ import time base_img = os.path.join(iotests.test_dir, 'base.img') new_img = os.path.join(iotests.test_dir, 'new.img') -if iotests.qemu_default_machine == 's390-ccw-virtio': - default_virtio_blk = 'virtio-blk-ccw' -else: - default_virtio_blk = 'virtio-blk-pci' class TestBlockdevDel(iotests.QMPTestCase): def setUp(self): iotests.qemu_img('create', '-f', iotests.imgfmt, base_img, '1M') self.vm = iotests.VM() - self.vm.add_device("{},id=virtio-scsi".format( - iotests.get_virtio_scsi_device())) + self.vm.add_device("{},id=virtio-scsi".format('virtio-scsi')) self.vm.launch() def tearDown(self): @@ -93,7 +88,7 @@ class TestBlockdevDel(iotests.QMPTestCase): self.checkBlockDriverState(node, expect_error) # Add a device model - def addDeviceModel(self, device, backend, driver = default_virtio_blk): + def addDeviceModel(self, device, backend, driver = 'virtio-blk'): result = self.vm.qmp('device_add', id = device, driver = driver, drive = backend) self.assert_qmp(result, 'return', {}) diff --git a/tests/qemu-iotests/182 b/tests/qemu-iotests/182 index 55a0384c0873..fcd1d796ebd0 100755 --- a/tests/qemu-iotests/182 +++ b/tests/qemu-iotests/182 @@ -46,26 +46,17 @@ _supported_proto file size=32M -case "$QEMU_DEFAULT_MACHINE" in - s390-ccw-virtio) - virtioblk=virtio-blk-ccw - ;; - *) - virtioblk=virtio-blk-pci - ;; -esac - _make_test_img $size echo "Starting QEMU" _launch_qemu -drive file=$TEST_IMG,if=none,id=drive0,file.locking=on \ - -device $virtioblk,drive=drive0 + -device virtio-blk,drive=drive0 echo echo "Starting a second QEMU using the same image should fail" echo 'quit' | $QEMU -nographic -monitor stdio \ -drive file=$TEST_IMG,if=none,id=drive0,file.locking=on \ - -device $virtioblk,drive=drive0 2>&1 | _filter_testdir 2>&1 | + -device virtio-blk,drive=drive0 2>&1 | _filter_testdir 2>&1 | _filter_qemu | sed -e '/falling back to POSIX file/d' \ -e '/locks can be lost unexpectedly/d' diff --git a/tests/qemu-iotests/238 b/tests/qemu-iotests/238 index 8a10af57f17c..38bd3744e68c 100755 --- a/tests/qemu-iotests/238 +++ b/tests/qemu-iotests/238 @@ -26,14 +26,12 @@ from iotests import log iotests.script_initialize() -virtio_scsi_device = iotests.get_virtio_scsi_device() - vm = iotests.VM() vm.launch() log(vm.qmp('blockdev-add', node_name='hd0', driver='null-co', read_zeroes=True)) log(vm.qmp('object-add', qom_type='iothread', id='iothread0')) -log(vm.qmp('device_add', id='scsi0', driver=virtio_scsi_device, iothread='iothread0')) +log(vm.qmp('device_add', id='scsi0', driver='virtio-scsi', iothread='iothread0')) log(vm.qmp('device_add', id='scsi-hd0', driver='scsi-hd', drive='hd0')) log(vm.qmp('block_set_io_throttle', id='scsi-hd0', bps=0, bps_rd=0, bps_wr=0, iops=1000, iops_rd=0, iops_wr=0, conv_keys=False)) diff --git a/tests/qemu-iotests/240 b/tests/qemu-iotests/240 index ab077f4ceb01..9b281e1dc036 100755 --- a/tests/qemu-iotests/240 +++ b/tests/qemu-iotests/240 @@ -42,7 +42,7 @@ class TestCase(iotests.QMPTestCase): iotests.log('==Unplug a SCSI disk and then plug it again==') self.vm.qmp_log('blockdev-add', driver='null-co', read_zeroes=True, node_name='hd0') self.vm.qmp_log('object-add', qom_type='iothread', id="iothread0") - self.vm.qmp_log('device_add', id='scsi0', driver=iotests.get_virtio_scsi_device(), iothread='iothread0', filters=[iotests.filter_qmp_virtio_scsi]) + self.vm.qmp_log('device_add', id='scsi0', driver='virtio-scsi', iothread='iothread0', filters=[iotests.filter_qmp_virtio_scsi]) self.vm.qmp_log('device_add', id='scsi-hd0', driver='scsi-hd', drive='hd0') self.vm.qmp_log('device_del', id='scsi-hd0') self.vm.event_wait('DEVICE_DELETED') @@ -55,7 +55,7 @@ class TestCase(iotests.QMPTestCase): iotests.log('==Attach two SCSI disks using the same block device and the same iothread==') self.vm.qmp_log('blockdev-add', driver='null-co', read_zeroes=True, node_name='hd0', read_only=True) self.vm.qmp_log('object-add', qom_type='iothread', id="iothread0") - self.vm.qmp_log('device_add', id='scsi0', driver=iotests.get_virtio_scsi_device(), iothread='iothread0', filters=[iotests.filter_qmp_virtio_scsi]) + self.vm.qmp_log('device_add', id='scsi0', driver='virtio-scsi', iothread='iothread0', filters=[iotests.filter_qmp_virtio_scsi]) self.vm.qmp_log('device_add', id='scsi-hd0', driver='scsi-hd', drive='hd0') self.vm.qmp_log('device_add', id='scsi-hd1', driver='scsi-hd', drive='hd0') @@ -73,8 +73,8 @@ class TestCase(iotests.QMPTestCase): self.vm.qmp_log('object-add', qom_type='iothread', id="iothread0") self.vm.qmp_log('object-add', qom_type='iothread', id="iothread1") - self.vm.qmp_log('device_add', id='scsi0', driver=iotests.get_virtio_scsi_device(), iothread='iothread0', filters=[iotests.filter_qmp_virtio_scsi]) - self.vm.qmp_log('device_add', id='scsi1', driver=iotests.get_virtio_scsi_device(), iothread='iothread1', filters=[iotests.filter_qmp_virtio_scsi]) + self.vm.qmp_log('device_add', id='scsi0', driver='virtio-scsi', iothread='iothread0', filters=[iotests.filter_qmp_virtio_scsi]) + self.vm.qmp_log('device_add', id='scsi1', driver='virtio-scsi', iothread='iothread1', filters=[iotests.filter_qmp_virtio_scsi]) self.vm.qmp_log('device_add', id='scsi-hd0', driver='scsi-hd', drive='hd0', bus="scsi0.0") self.vm.qmp_log('device_add', id='scsi-hd1', driver='scsi-hd', drive='hd0', bus="scsi1.0") @@ -99,7 +99,7 @@ class TestCase(iotests.QMPTestCase): self.vm.qmp_log('nbd-server-add', device='hd0') self.vm.qmp_log('object-add', qom_type='iothread', id="iothread0") - self.vm.qmp_log('device_add', id='scsi0', driver=iotests.get_virtio_scsi_device(), iothread='iothread0', filters=[iotests.filter_qmp_virtio_scsi]) + self.vm.qmp_log('device_add', id='scsi0', driver='virtio-scsi', iothread='iothread0', filters=[iotests.filter_qmp_virtio_scsi]) self.vm.qmp_log('device_add', id='scsi-hd0', driver='scsi-hd', drive='hd0') if __name__ == '__main__': diff --git a/tests/qemu-iotests/257 b/tests/qemu-iotests/257 index 7cd25208296e..c72c82a171b4 100755 --- a/tests/qemu-iotests/257 +++ b/tests/qemu-iotests/257 @@ -292,7 +292,7 @@ def test_bitmap_sync(bsync_mode, msync_mode='bitmap', failure=None): log('--- Preparing image & VM ---\n') drive0 = Drive(img_path, vm=vm) drive0.img_create(iotests.imgfmt, SIZE) - vm.add_device("{},id=scsi0".format(iotests.get_virtio_scsi_device())) + vm.add_device("{},id=scsi0".format('virtio-scsi')) vm.launch() file_config = { @@ -449,7 +449,7 @@ def test_backup_api(): log('--- Preparing image & VM ---\n') drive0 = Drive(img_path, vm=vm) drive0.img_create(iotests.imgfmt, SIZE) - vm.add_device("{},id=scsi0".format(iotests.get_virtio_scsi_device())) + vm.add_device("{},id=scsi0".format('virtio-scsi')) vm.launch() file_config = { diff --git a/tests/qemu-iotests/307 b/tests/qemu-iotests/307 index 9008974346b0..c7685347bc4c 100755 --- a/tests/qemu-iotests/307 +++ b/tests/qemu-iotests/307 @@ -40,13 +40,11 @@ with iotests.FilePath('image') as img, \ iotests.log('=== Launch VM ===') - virtio_scsi_device = iotests.get_virtio_scsi_device() - vm.add_object('iothread,id=iothread0') vm.add_blockdev(f'file,filename={img},node-name=file') vm.add_blockdev(f'{iotests.imgfmt},file=file,node-name=fmt') vm.add_blockdev('raw,file=file,node-name=ro,read-only=on') - vm.add_device(f'id=scsi0,driver={virtio_scsi_device},iothread=iothread0') + vm.add_device(f'id=scsi0,driver=virtio-scsi,iothread=iothread0') vm.launch() vm.qmp_log('nbd-server-start', diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 90d0b6252368..1e9e6a066e90 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -234,11 +234,6 @@ def qemu_io_silent_check(*args): stderr=subprocess.STDOUT) return exitcode == 0 -def get_virtio_scsi_device(): - if qemu_default_machine == 's390-ccw-virtio': - return 'virtio-scsi-ccw' - return 'virtio-scsi-pci' - class QemuIoInteractive: def __init__(self, *args): self.args = qemu_io_args_no_fmt + list(args) From patchwork Fri Mar 19 13:25:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1455867 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4F24b10QlDz9sWb for ; Sat, 20 Mar 2021 00:33:01 +1100 (AEDT) Received: from localhost ([::1]:45010 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lNFFL-00081z-1v for incoming@patchwork.ozlabs.org; Fri, 19 Mar 2021 09:32:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60864) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNF8Z-0000X2-OK; Fri, 19 Mar 2021 09:25:59 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:53889) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNF8X-0003lh-P9; Fri, 19 Mar 2021 09:25:59 -0400 Received: from localhost.localdomain ([82.142.20.38]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MtO4E-1lgQRZ18BC-00uqAC; Fri, 19 Mar 2021 14:25:47 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PATCH v2 5/6] iotests: test m68k with the virt machine Date: Fri, 19 Mar 2021 14:25:36 +0100 Message-Id: <20210319132537.2046339-6-laurent@vivier.eu> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210319132537.2046339-1-laurent@vivier.eu> References: <20210319132537.2046339-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:knVKPj2vfl5glMpKifxhMYz8gEGPS4zwMpXq/Z6NcjDhBa4LJn/ 9ee7uOs8dkjppVWIyaefkuvwpIw1kFySPv5kRjyuJ7CofBr+uc8SHu15WBtVQIfKpdarce1 NdheHA1oUND7zSnZb0vxw73p5E3iZLnKku/LEkWIWFngLrIke6yatdyDglsgcDgW9lWyiXa IH5dUezeoFg5VaYk21Axw== X-UI-Out-Filterresults: notjunk:1;V03:K0:t65QEJffBuU=:KJi+yCM6iOnVs6LfEsGnqq ketv6eTdnQzR+4KpWLgdd812u2dssxtcSf07ulaT/RObYUgANA0Xwb9oow81bmIEf9YBsow8t u8fwU5fI988tjjunFEFUamara507TsV71anwQg9CLc8DQA3TTjVNTq5dpPgYEB/jYyAg8Tuqi sSAdGbhwdDRjaX30hhlGqRL3be/kt16Eg+Xppk1HmIp+joxHOXXSZHQQ0FOOM7318hjsr/ROm nmi/QUb6iVhrzKsaqMTPSq5eDDaVbJXZo75S+PDOn4HlMhipg0IR884+g5O2Vjxg+SZwDFe1S 38hXGdk2Xsov9FsBdQSWftAZ7SuKZEfYkAd/A4oSrA70LNKiVTE7TeTBNgjoStY+0a3Hyv1/X JkUL1V0veU9VMVmjX59FZ3dNhIcrJE2a+yuvCUSvGmtUuJodFLHZmP5It2WwkCTcASFY/ogaa 0W2Te0eF7Q== Received-SPF: none client-ip=212.227.126.130; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Peter Maydell , Thomas Huth , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , qemu-block@nongnu.org, =?utf-8?q?Phi?= =?utf-8?q?lippe_Mathieu-Daud=C3=A9?= , Cornelia Huck , Markus Armbruster , Max Reitz , qemu-s390x@nongnu.org, Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This allows to cover the virtio tests with a 32bit big-endian virtio-mmio machine. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Laurent Vivier Reviewed-by: Cornelia Huck --- tests/qemu-iotests/testenv.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qemu-iotests/testenv.py b/tests/qemu-iotests/testenv.py index 1fbec854c1f7..6d27712617a3 100644 --- a/tests/qemu-iotests/testenv.py +++ b/tests/qemu-iotests/testenv.py @@ -208,6 +208,7 @@ def __init__(self, imgfmt: str, imgproto: str, aiomode: str, ('arm', 'virt'), ('aarch64', 'virt'), ('avr', 'mega2560'), + ('m68k', 'virt'), ('rx', 'gdbsim-r5f562n8'), ('tricore', 'tricore_testboard') ) From patchwork Fri Mar 19 13:25:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1455869 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4F24cJ1sFbz9s1l for ; Sat, 20 Mar 2021 00:34:08 +1100 (AEDT) Received: from localhost ([::1]:49774 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lNFGO-0001Y4-SU for incoming@patchwork.ozlabs.org; Fri, 19 Mar 2021 09:34:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60824) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNF8X-0000QE-3J; Fri, 19 Mar 2021 09:25:57 -0400 Received: from mout.kundenserver.de ([212.227.126.133]:47421) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNF8V-0003kF-1Z; Fri, 19 Mar 2021 09:25:56 -0400 Received: from localhost.localdomain ([82.142.20.38]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MHGTI-1lRcr61EfI-00DHN8; Fri, 19 Mar 2021 14:25:48 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PATCH v2 6/6] iotests: iothreads need ioeventfd Date: Fri, 19 Mar 2021 14:25:37 +0100 Message-Id: <20210319132537.2046339-7-laurent@vivier.eu> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210319132537.2046339-1-laurent@vivier.eu> References: <20210319132537.2046339-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:Fr2ixeMzMpVs/V7RWH/mcZ04B9xZOTcA6DuSqEWYztlRyuxgiBL X4pFZcAmdaIMwo8CJ/TwxM1Cc9MkbJRBA1Ged9vppe0Y0O5mzreZXKN6iTCCj3NhBA43nF9 mjOO4qbqTQXwewZdwX7h5KWt+JcA0zBbiZ785xOGT3FyVrvtraDYQpiJF0Ddwf6rAc5dIb0 0wi3qsc/bjRg1/qeqVV9A== X-UI-Out-Filterresults: notjunk:1;V03:K0:iHkttIqPHlU=:kncGkiF3WtYWbTQQ9aQeRQ t/NYEciG6t8uwmzKm62nqT5r6YB+eYd/NWWcrMR6FsnayvzXSTUtAGrCtfqy0pVr2Fi233Kof y6Cveau1RmZIH3vemZkJB6xWYG7uAvabhfcmW2QokRjqF1W+0R3g61Wmg1hKOfoGqXehclmeU JarjjMJQ1sw2ACSDokzqvBzjzQrb19jZuWoU0daStQGVW/b+Vn2YDANH+GQfdrS8xnFmVwYtg L1YdwbRPbDxKUi79SpzOt9sV2ygmuamnvydmN65djJlWN2ZokM2+jll+TB9qeK3yhJnGoMYIp sEY7YBMGRnNNDpddTjD3OsVKLZROGwE2Ercm2bA1cekbjtT4ciDQpn9CIXnqbawRy/Wi8k0Um tbhQFWHldkRMJYMjYbbRG/KufXOGGoGqBotx2+5obOpXhbz9ZTl1FC1j/XB4BlstVILL9ofDU cVPDnQah1w== Received-SPF: none client-ip=212.227.126.133; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Peter Maydell , Thomas Huth , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , qemu-block@nongnu.org, Cornelia Huck , Markus Armbruster , Max Reitz , qemu-s390x@nongnu.org, Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" And ioeventfd are only available with virtio-scsi-pci or virtio-scsi-ccw, use the alias but add a rule to require virtio-scsi-pci or virtio-scsi-ccw for the tests that use iothreads. Signed-off-by: Laurent Vivier --- tests/qemu-iotests/127 | 3 ++- tests/qemu-iotests/256 | 6 ++++-- tests/qemu-iotests/iotests.py | 5 +++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/qemu-iotests/127 b/tests/qemu-iotests/127 index 98e8e82a8210..abe24861100d 100755 --- a/tests/qemu-iotests/127 +++ b/tests/qemu-iotests/127 @@ -44,7 +44,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fmt qcow2 _supported_proto file fuse -_require_devices virtio-scsi scsi-hd +_require_devices scsi-hd +_require_devices virtio-scsi-pci || _require_devices virtio-scsi-ccw IMG_SIZE=64K diff --git a/tests/qemu-iotests/256 b/tests/qemu-iotests/256 index 8d82a1dd865f..13666813bd8f 100755 --- a/tests/qemu-iotests/256 +++ b/tests/qemu-iotests/256 @@ -24,6 +24,8 @@ import os import iotests from iotests import log +iotests._verify_virtio_scsi_pci_or_ccw() + iotests.script_initialize(supported_fmts=['qcow2']) size = 64 * 1024 * 1024 @@ -61,8 +63,8 @@ with iotests.FilePath('img0') as img0_path, \ log('--- Preparing images & VM ---\n') vm.add_object('iothread,id=iothread0') vm.add_object('iothread,id=iothread1') - vm.add_device('virtio-scsi-pci,id=scsi0,iothread=iothread0') - vm.add_device('virtio-scsi-pci,id=scsi1,iothread=iothread1') + vm.add_device('virtio-scsi,id=scsi0,iothread=iothread0') + vm.add_device('virtio-scsi,id=scsi1,iothread=iothread1') iotests.qemu_img_create('-f', iotests.imgfmt, img0_path, str(size)) iotests.qemu_img_create('-f', iotests.imgfmt, img1_path, str(size)) vm.add_drive(img0_path, interface='none') diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 1e9e6a066e90..d3faf96005dd 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -1146,6 +1146,11 @@ def _verify_virtio_blk() -> None: if 'virtio-blk' not in out: notrun('Missing virtio-blk in QEMU binary') +def _verify_virtio_scsi_pci_or_ccw() -> None: + out = qemu_pipe('-M', 'none', '-device', 'help') + if 'virtio-scsi-pci' not in out and 'virtio-scsi-ccw' not in out: + notrun('Missing virtio-scsi-pci and virtio-scsi-ccw in QEMU binary') + def supports_quorum(): return 'quorum' in qemu_img_pipe('--help')