From nobody Sat Sep 21 05:30:35 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1704992626; cv=none; d=zohomail.com; s=zohoarc; b=AGD/0lRAuHrzEHyhRd+js/oHuRc+FptjumVMSK/A+ZEFuJVkNAG5eykhw8TU+D1/wVKfIllGR9MOHuaw022Cwp0FjBpQMVFq6IZtnf9sPs6wRXrvsDHto8tqXB3dqKWIPmqH0Dmbbv6F69aGXkOrQLGHSPsw4FrcpK5N7+oJY0E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704992626; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=7Q02gRkJO6TAV33QJiNFZq3YjsRE1X+PYnOjPa8di5Q=; b=FxeN2W620C4ovjn/mAuXX4dRCPVq8H+Pzv5SNZlR+6+sSm6xEFCPdJN0MX09nqhID1T0sbmClsfsLWsfsaiJ0pOBs8vM1UzflpUyfkfttX3WutxDDbd1fdBct2A+jkCWJHHEjZ1onSccErymEQWXnOSCb0yEojzUc/YwEGJhYZc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704992626882216.88472500742637; Thu, 11 Jan 2024 09:03:46 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rNyQi-00047P-D3; Thu, 11 Jan 2024 12:01:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rNyQU-0003qm-Q6 for qemu-devel@nongnu.org; Thu, 11 Jan 2024 12:01:08 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rNyQS-0003ZO-7J for qemu-devel@nongnu.org; Thu, 11 Jan 2024 12:01:06 -0500 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-665-6AZKRmujNLGrjYnD_XECEA-1; Thu, 11 Jan 2024 12:00:52 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AE68B3816B60; Thu, 11 Jan 2024 17:00:51 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.197]) by smtp.corp.redhat.com (Postfix) with ESMTP id A475C51D5; Thu, 11 Jan 2024 17:00:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704992458; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7Q02gRkJO6TAV33QJiNFZq3YjsRE1X+PYnOjPa8di5Q=; b=dMXH+AQBPw8tLF+jsp/blq0v8aIjUhppWVCoBIxVS3YDr/lhMdBlPKSohINn3Q1BN50ICv GKlrAXcVg8o3rmIlRFi6QDvNRqeWjaFMcIgckvK8+cHUtRihDEu+b8C7cGOsVAiZoLUCdl PvhwFj7yTX1kiwXKtfDtZCC9PQH5/hA= X-MC-Unique: 6AZKRmujNLGrjYnD_XECEA-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell , Mark Cave-Ayland , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier Subject: [PULL 01/17] q800: move dp8393x_prom memory region to Q800MachineState Date: Thu, 11 Jan 2024 18:00:30 +0100 Message-ID: <20240111170047.909117-2-thuth@redhat.com> In-Reply-To: <20240111170047.909117-1-thuth@redhat.com> References: <20240111170047.909117-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -45 X-Spam_score: -4.6 X-Spam_bar: ---- X-Spam_report: (-4.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.467, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1704992628955100003 From: Mark Cave-Ayland There is no need to dynamically allocate the memory region from the heap. Signed-off-by: Mark Cave-Ayland Message-ID: <20231227210212.245106-1-mark.cave-ayland@ilande.co.uk> Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Laurent Vivier Signed-off-by: Thomas Huth --- include/hw/m68k/q800.h | 1 + hw/m68k/q800.c | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/hw/m68k/q800.h b/include/hw/m68k/q800.h index a9661f65f6..34365c9860 100644 --- a/include/hw/m68k/q800.h +++ b/include/hw/m68k/q800.h @@ -55,6 +55,7 @@ struct Q800MachineState { MOS6522Q800VIA1State via1; MOS6522Q800VIA2State via2; dp8393xState dp8393x; + MemoryRegion dp8393x_prom; ESCCState escc; OrIRQState escc_orgate; SysBusESPState esp; diff --git a/hw/m68k/q800.c b/hw/m68k/q800.c index 83d1571d02..b80a3b6d5f 100644 --- a/hw/m68k/q800.c +++ b/hw/m68k/q800.c @@ -253,7 +253,6 @@ static void q800_machine_init(MachineState *machine) int bios_size; ram_addr_t initrd_base; int32_t initrd_size; - MemoryRegion *dp8393x_prom =3D g_new(MemoryRegion, 1); uint8_t *prom; int i, checksum; MacFbMode *macfb_mode; @@ -406,13 +405,13 @@ static void q800_machine_init(MachineState *machine) sysbus_connect_irq(sysbus, 0, qdev_get_gpio_in(DEVICE(&m->glue), GLUE_IRQ_IN_SONI= C)); =20 - memory_region_init_rom(dp8393x_prom, NULL, "dp8393x-q800.prom", + memory_region_init_rom(&m->dp8393x_prom, NULL, "dp8393x-q800.prom", SONIC_PROM_SIZE, &error_fatal); memory_region_add_subregion(get_system_memory(), SONIC_PROM_BASE, - dp8393x_prom); + &m->dp8393x_prom); =20 /* Add MAC address with valid checksum to PROM */ - prom =3D memory_region_get_ram_ptr(dp8393x_prom); + prom =3D memory_region_get_ram_ptr(&m->dp8393x_prom); checksum =3D 0; for (i =3D 0; i < 6; i++) { prom[i] =3D revbit8(nd_table[0].macaddr.a[i]); --=20 2.43.0 From nobody Sat Sep 21 05:30:35 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1704992587; cv=none; d=zohomail.com; s=zohoarc; b=mhdS5oxlaIr1I4MPzTLHABdpZzGNZBlW8hMSt3/VkGLgUHYy32I2nfOJne4Ex/fbAvf9qNjlcflG/iEGGi8JBipOyZDfJVWzAPWVVoVEmfmqKf4lrbRfuu/3ZZ+DpniNCAbKyRDDyHCsYxPPIt2HDf8hYfBHxgtV8lO8xxMflFY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704992587; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=AA0bJvA5gnRtUl/OdOVdH08UPrx2pU6ILB4irBcvPSI=; b=U9TYpMBvJWgWp5fe7c27ziFnGT1vJcAyraYrZlHSaog6XObeu2C/7hAtP/C+DZKnZAgzr1VDzb1w9H7H8jPYxGCNdGWZqj33fjXfjVDgolx5Kpw5Bf3k9u9+3htYY5tt7GfnO7OoXLWCASgPOZhYY8MZJbaS8finkd+uQXKjym4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704992587786747.3908232542439; Thu, 11 Jan 2024 09:03:07 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rNyQe-0003zW-O1; Thu, 11 Jan 2024 12:01:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rNyQU-0003qo-U2 for qemu-devel@nongnu.org; Thu, 11 Jan 2024 12:01:08 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rNyQS-0003ZK-75 for qemu-devel@nongnu.org; Thu, 11 Jan 2024 12:01:06 -0500 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-563-LKcwpistOGOQkfdE4l7E9g-1; Thu, 11 Jan 2024 12:00:53 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8219B8371CB; Thu, 11 Jan 2024 17:00:53 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.197]) by smtp.corp.redhat.com (Postfix) with ESMTP id F03B751D5; Thu, 11 Jan 2024 17:00:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704992458; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AA0bJvA5gnRtUl/OdOVdH08UPrx2pU6ILB4irBcvPSI=; b=diWVRlxIV0uxe9su37bbKQSz9XrAcpFRTOhcsYenuDMABhG7vk4GRB2vkx3OOe/zhlg5gC eHF6+mnuKUEgn6VG+T648uE5ZoVHTiPC4vuOuAm3FvwFmeo3RJISxuE8CaBIHBHClwBiGL 4FJfIyJiXAfOdKeFiNMyj1EW2rZYg1w= X-MC-Unique: LKcwpistOGOQkfdE4l7E9g-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Zhao Liu Subject: [PULL 02/17] qtest: use correct boolean type for failover property Date: Thu, 11 Jan 2024 18:00:31 +0100 Message-ID: <20240111170047.909117-3-thuth@redhat.com> In-Reply-To: <20240111170047.909117-1-thuth@redhat.com> References: <20240111170047.909117-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -45 X-Spam_score: -4.6 X-Spam_bar: ---- X-Spam_report: (-4.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.467, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1704992588767100001 From: Daniel P. Berrang=C3=A9 QMP device_add does not historically validate the parameter types. At some point it will likely change to enforce correct types, to match behaviour of -device. The failover property is expected to be a boolean in JSON. Signed-off-by: "Daniel P. Berrang=C3=A9" Message-ID: <20240103123005.2400437-1-berrange@redhat.com> Reviewed-by: Zhao Liu Signed-off-by: Thomas Huth --- tests/qtest/virtio-net-failover.c | 36 +++++++++++++++---------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/tests/qtest/virtio-net-failover.c b/tests/qtest/virtio-net-fai= lover.c index 0d40bc1f2d..73dfabc272 100644 --- a/tests/qtest/virtio-net-failover.c +++ b/tests/qtest/virtio-net-failover.c @@ -486,7 +486,7 @@ static void test_hotplug_1_reverse(void) =20 qtest_qmp_device_add(qts, "virtio-net", "standby0", "{'bus': 'root0'," - "'failover': 'on'," + "'failover': true," "'netdev': 'hs0'," "'mac': '"MAC_STANDBY0"'}"); =20 @@ -517,7 +517,7 @@ static void test_hotplug_2(void) =20 qtest_qmp_device_add(qts, "virtio-net", "standby0", "{'bus': 'root0'," - "'failover': 'on'," + "'failover': true," "'netdev': 'hs0'," "'mac': '"MAC_STANDBY0"'}"); =20 @@ -566,7 +566,7 @@ static void test_hotplug_2_reverse(void) =20 qtest_qmp_device_add(qts, "virtio-net", "standby0", "{'bus': 'root0'," - "'failover': 'on'," + "'failover': true," "'netdev': 'hs0'," "'rombar': 0," "'romfile': ''," @@ -639,7 +639,7 @@ static void test_migrate_out(gconstpointer opaque) =20 qtest_qmp_device_add(qts, "virtio-net", "standby0", "{'bus': 'root0'," - "'failover': 'on'," + "'failover': true," "'netdev': 'hs0'," "'mac': '"MAC_STANDBY0"'}"); =20 @@ -754,7 +754,7 @@ static void test_migrate_in(gconstpointer opaque) =20 qtest_qmp_device_add(qts, "virtio-net", "standby0", "{'bus': 'root0'," - "'failover': 'on'," + "'failover': true," "'netdev': 'hs0'," "'mac': '"MAC_STANDBY0"'}"); =20 @@ -808,7 +808,7 @@ static void test_off_migrate_out(gconstpointer opaque) =20 qtest_qmp_device_add(qts, "virtio-net", "standby0", "{'bus': 'root0'," - "'failover': 'off'," + "'failover': false," "'netdev': 'hs0'," "'mac': '"MAC_STANDBY0"'}"); =20 @@ -876,7 +876,7 @@ static void test_off_migrate_in(gconstpointer opaque) =20 qtest_qmp_device_add(qts, "virtio-net", "standby0", "{'bus': 'root0'," - "'failover': 'off'," + "'failover': false," "'netdev': 'hs0'," "'mac': '"MAC_STANDBY0"'}"); =20 @@ -927,7 +927,7 @@ static void test_guest_off_migrate_out(gconstpointer op= aque) =20 qtest_qmp_device_add(qts, "virtio-net", "standby0", "{'bus': 'root0'," - "'failover': 'on'," + "'failover': true," "'netdev': 'hs0'," "'mac': '"MAC_STANDBY0"'}"); =20 @@ -1003,7 +1003,7 @@ static void test_guest_off_migrate_in(gconstpointer o= paque) =20 qtest_qmp_device_add(qts, "virtio-net", "standby0", "{'bus': 'root0'," - "'failover': 'on'," + "'failover': true," "'netdev': 'hs0'," "'mac': '"MAC_STANDBY0"'}"); =20 @@ -1054,7 +1054,7 @@ static void test_migrate_guest_off_abort(gconstpointe= r opaque) =20 qtest_qmp_device_add(qts, "virtio-net", "standby0", "{'bus': 'root0'," - "'failover': 'on'," + "'failover': true," "'netdev': 'hs0'," "'mac': '"MAC_STANDBY0"'}"); =20 @@ -1154,7 +1154,7 @@ static void test_migrate_abort_wait_unplug(gconstpoin= ter opaque) =20 qtest_qmp_device_add(qts, "virtio-net", "standby0", "{'bus': 'root0'," - "'failover': 'on'," + "'failover': true," "'netdev': 'hs0'," "'mac': '"MAC_STANDBY0"'}"); =20 @@ -1243,7 +1243,7 @@ static void test_migrate_abort_active(gconstpointer o= paque) =20 qtest_qmp_device_add(qts, "virtio-net", "standby0", "{'bus': 'root0'," - "'failover': 'on'," + "'failover': true," "'netdev': 'hs0'," "'mac': '"MAC_STANDBY0"'}"); =20 @@ -1342,7 +1342,7 @@ static void test_migrate_off_abort(gconstpointer opaq= ue) =20 qtest_qmp_device_add(qts, "virtio-net", "standby0", "{'bus': 'root0'," - "'failover': 'off'," + "'failover': false," "'netdev': 'hs0'," "'mac': '"MAC_STANDBY0"'}"); =20 @@ -1434,7 +1434,7 @@ static void test_migrate_abort_timeout(gconstpointer = opaque) =20 qtest_qmp_device_add(qts, "virtio-net", "standby0", "{'bus': 'root0'," - "'failover': 'on'," + "'failover': true," "'netdev': 'hs0'," "'mac': '"MAC_STANDBY0"'}"); =20 @@ -1530,7 +1530,7 @@ static void test_multi_out(gconstpointer opaque) =20 qtest_qmp_device_add(qts, "virtio-net", "standby0", "{'bus': 'root0'," - "'failover': 'on'," + "'failover': true," "'netdev': 'hs0'," "'mac': '"MAC_STANDBY0"'}"); =20 @@ -1561,7 +1561,7 @@ static void test_multi_out(gconstpointer opaque) =20 qtest_qmp_device_add(qts, "virtio-net", "standby1", "{'bus': 'root2'," - "'failover': 'on'," + "'failover': true," "'netdev': 'hs2'," "'mac': '"MAC_STANDBY1"'}"); =20 @@ -1700,7 +1700,7 @@ static void test_multi_in(gconstpointer opaque) =20 qtest_qmp_device_add(qts, "virtio-net", "standby0", "{'bus': 'root0'," - "'failover': 'on'," + "'failover': true," "'netdev': 'hs0'," "'mac': '"MAC_STANDBY0"'}"); =20 @@ -1724,7 +1724,7 @@ static void test_multi_in(gconstpointer opaque) =20 qtest_qmp_device_add(qts, "virtio-net", "standby1", "{'bus': 'root2'," - "'failover': 'on'," + "'failover': true," "'netdev': 'hs2'," "'mac': '"MAC_STANDBY1"'}"); =20 --=20 2.43.0 From nobody Sat Sep 21 05:30:35 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1704992641; cv=none; d=zohomail.com; s=zohoarc; b=h9NyUo8eo4RIz7/YSYsvnjQ3DbH/6TupZnATPDIUGKJwks2KBFl4PD/d7uPoGXsf+npx1o5AtIuimSHunQOc/AtAn4RFrdYLjVxyIpycYbF7jp9y4rKrPmard29/rDYRN+dHhA2FbJ9acw9RvoQLAnthbnfIVILXGH94N6zDJBE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704992641; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=r77E7M5I85w1T8zdFWc4wKXIoTfETTc9mtCRu+/w1eI=; b=H5xZ+Anf2fYJc8p3Zpb4xL9m85M7+5BtjSaT56MEb0DZ29BaDMJ8xM6MHuBZbulSVrKeNqtY1C8LZE5Y5u6L1tg4hN82T0HeR3xJo5jWxp036w38V3MQTC1ipIveMJP+DWUg5bBo23ALdya1AkETTcJqsONUJymDZS64ETxW9xE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704992641458538.60729991221; Thu, 11 Jan 2024 09:04:01 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rNyQh-00044P-EZ; Thu, 11 Jan 2024 12:01:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rNyQU-0003pb-0o for qemu-devel@nongnu.org; Thu, 11 Jan 2024 12:01:06 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rNyQS-0003ZY-6c for qemu-devel@nongnu.org; Thu, 11 Jan 2024 12:01:05 -0500 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-556-tCVnAmsjNOiJ4C6ILFrbDQ-1; Thu, 11 Jan 2024 12:00:55 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E9CDD8352A1; Thu, 11 Jan 2024 17:00:54 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.197]) by smtp.corp.redhat.com (Postfix) with ESMTP id 06A7F51D5; Thu, 11 Jan 2024 17:00:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704992458; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=r77E7M5I85w1T8zdFWc4wKXIoTfETTc9mtCRu+/w1eI=; b=KuoGztuamAzge9ABfZsvs9XwUF7R33qYh/jngY+/MW31lC/p8R/BfGIruXmw0RL9ijiplx vB88dAVFB2EgEPS7ohX1MJI8MZrShUizdceQe7bhkwkm3Jorrx8tROszRyQU5+mj1J6gBw NrC3VlXpITdDT9DdAolpsjJikFe3jWE= X-MC-Unique: tCVnAmsjNOiJ4C6ILFrbDQ-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Stefan Hajnoczi Subject: [PULL 03/17] Revert "netdev: set timeout depending on loadavg" Date: Thu, 11 Jan 2024 18:00:32 +0100 Message-ID: <20240111170047.909117-4-thuth@redhat.com> In-Reply-To: <20240111170047.909117-1-thuth@redhat.com> References: <20240111170047.909117-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -45 X-Spam_score: -4.6 X-Spam_bar: ---- X-Spam_report: (-4.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.467, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1704992643047100003 From: Daniel P. Berrang=C3=A9 This reverts commit cadfc7293977ecadc2d6c48d7cffc553ed2f85f1. The test was not timing out because of slow execution. It was timing out due to a race condition leading to the client QEMU attempting (and fatally failing) to connect before the server QEMU was listening. Signed-off-by: "Daniel P. Berrang=C3=A9" Message-ID: <20240104162942.211458-2-berrange@redhat.com> Reviewed-by: Stefan Hajnoczi Signed-off-by: Thomas Huth --- tests/qtest/netdev-socket.c | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/tests/qtest/netdev-socket.c b/tests/qtest/netdev-socket.c index bb99d08b5e..7ba1eff120 100644 --- a/tests/qtest/netdev-socket.c +++ b/tests/qtest/netdev-socket.c @@ -18,32 +18,6 @@ =20 #define CONNECTION_TIMEOUT 120 =20 -static double connection_timeout(void) -{ - double load; - int ret =3D getloadavg(&load, 1); - - /* - * If we can't get load data, or load is low because we just started - * running, assume load of 1 (we are alone in this system). - */ - if (ret < 1 || load < 1.0) { - load =3D 1.0; - } - /* - * No one wants to wait more than 10 minutes for this test. Higher loa= d? - * Too bad. - */ - if (load > 10.0) { - fprintf(stderr, "Warning: load %f higher than 10 - test might time= out\n", - load); - load =3D 10.0; - } - - /* if load is high increase timeout as we might not get a chance to ru= n */ - return load * CONNECTION_TIMEOUT; -} - #define EXPECT_STATE(q, e, t) \ do { \ char *resp =3D NULL; \ @@ -57,7 +31,7 @@ do { = \ if (g_str_equal(resp, e)) { \ break; \ } \ - } while (g_test_timer_elapsed() < connection_timeout()); \ + } while (g_test_timer_elapsed() < CONNECTION_TIMEOUT); \ g_assert_cmpstr(resp, =3D=3D, e); \ g_free(resp); \ } while (0) --=20 2.43.0 From nobody Sat Sep 21 05:30:35 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1704992682; cv=none; d=zohomail.com; s=zohoarc; b=a0zrzt5eYXqvIUMyyGJBGZQGPrvvKQyyhOi/lkCWnCia+xqZhFroNSg0YguMJqsp42VDiFsSdLXg7+6rSVdWk0ozq1KqkSDk+WI/0t1fEYD+omha4Mi4YeA4Iykq4IaHExVxXK/MYyK5NYZWI2umpJRuBpA0vz45Gx8iI77FXMY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704992682; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=19+E17nysIm2oZ7nbZMy0wXPa4humyUbF4HvpsSG8d8=; b=CZ4RjaPJtxjiaxLy5AI13WWOsosEcS2jtwRZJ4ggUPCAE3wqdlL3HwEA1ucXMrpxXFwSQykUulHQT97W8UF81VMIJEcBkc5Mau6/4CrSbPLhUZsAHD38Lf6ub13+39a+ImPGcKG3mlKydaaA8ePyqWIXVi1OFqOnZUfHCNPs4j8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704992682403987.5887401645097; Thu, 11 Jan 2024 09:04:42 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rNyQi-00047N-9a; Thu, 11 Jan 2024 12:01:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rNyQV-0003r6-W8 for qemu-devel@nongnu.org; Thu, 11 Jan 2024 12:01:08 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rNyQT-0003aN-Ej for qemu-devel@nongnu.org; Thu, 11 Jan 2024 12:01:07 -0500 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-460-Pnc5BW3RPdylNZYkV1PDMw-1; Thu, 11 Jan 2024 12:00:56 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7A6EA85A599; Thu, 11 Jan 2024 17:00:56 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.197]) by smtp.corp.redhat.com (Postfix) with ESMTP id 37C6151D5; Thu, 11 Jan 2024 17:00:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704992461; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=19+E17nysIm2oZ7nbZMy0wXPa4humyUbF4HvpsSG8d8=; b=NUZATFPjSb/HaI+ONFyzIax2whyIYxm8QKbh1aagXWRZlMZ0kw4jCDye7uSCnDFdjCRwni OQ18BMyACYNEZQ7enCZqg3rtqR4wcim7QWr41VPxgcaxYZW2s4CCuNrlscMKAd+xanIAeo znLFuJtKn89NBsKuQQBshqvCnyXR3xI= X-MC-Unique: Pnc5BW3RPdylNZYkV1PDMw-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Stefan Hajnoczi Subject: [PULL 04/17] Revert "osdep: add getloadavg" Date: Thu, 11 Jan 2024 18:00:33 +0100 Message-ID: <20240111170047.909117-5-thuth@redhat.com> In-Reply-To: <20240111170047.909117-1-thuth@redhat.com> References: <20240111170047.909117-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -45 X-Spam_score: -4.6 X-Spam_bar: ---- X-Spam_report: (-4.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.467, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1704992683292100001 From: Daniel P. Berrang=C3=A9 This reverts commit dc864d3a3777424187280e50c9bfb84dced54f12. This functionality is not required after the previous revert Signed-off-by: "Daniel P. Berrang=C3=A9" Message-ID: <20240104162942.211458-3-berrange@redhat.com> Reviewed-by: Stefan Hajnoczi Signed-off-by: Thomas Huth --- meson.build | 1 - include/qemu/osdep.h | 10 ---------- 2 files changed, 11 deletions(-) diff --git a/meson.build b/meson.build index 371edafae6..8dd6347d1b 100644 --- a/meson.build +++ b/meson.build @@ -2341,7 +2341,6 @@ config_host_data.set('HAVE_GLIB_WITH_SLICE_ALLOCATOR'= , glib_has_gslice) config_host_data.set('HAVE_OPENPTY', cc.has_function('openpty', dependenci= es: util)) config_host_data.set('HAVE_STRCHRNUL', cc.has_function('strchrnul')) config_host_data.set('HAVE_SYSTEM_FUNCTION', cc.has_function('system', pre= fix: '#include ')) -config_host_data.set('HAVE_GETLOADAVG_FUNCTION', cc.has_function('getloada= vg', prefix: '#include ')) if rbd.found() config_host_data.set('HAVE_RBD_NAMESPACE_EXISTS', cc.has_function('rbd_namespace_exists', diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index db366d6796..9a405bed89 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -781,16 +781,6 @@ static inline int platform_does_not_support_system(con= st char *command) } #endif /* !HAVE_SYSTEM_FUNCTION */ =20 -/** - * If the load average was unobtainable, -1 is returned - */ -#ifndef HAVE_GETLOADAVG_FUNCTION -static inline int getloadavg(double loadavg[], int nelem) -{ - return -1; -} -#endif /* !HAVE_GETLOADAVG_FUNCTION */ - #ifdef __cplusplus } #endif --=20 2.43.0 From nobody Sat Sep 21 05:30:35 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1704992655; cv=none; d=zohomail.com; s=zohoarc; b=P+xJWeNJWp5Jy3LWP1G+qm50OBolGTS/bwWgQQEPhkNmLMyV9bRFKR+4BADwpLXz53RNq3rYPx5vDo+DXrMw/f3/oQr2T7iymzuSmtoL3+Z69QDr732MGpLa/p0vNvQNcG+IPXF/G6pd8no9T3fygRdhoJGu9ZXOsEKoSxA2h7o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704992655; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=MkBPO3VAMUVhEz/ZNLZS1qXdrJ8HeBjVd9KQ5fOGbi0=; b=AGwJGrKvSswVAx9MYzemwfVvezPdVP7AbIhT5q2ssiaKgNghB6FZMTLHzayZcbDPmxLyR++3pdc+wiQlXkNcB1u/fG9P17wffpBdJU2GbJyvS+nvn4q7tdSadSuAPqFYb2+csS5TSmvRGJI2bfQXqkXFNlh4uPP085xAAPRVGWg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704992655693288.63674233790005; Thu, 11 Jan 2024 09:04:15 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rNyQh-00044Q-Cb; Thu, 11 Jan 2024 12:01:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rNyQU-0003ql-Py for qemu-devel@nongnu.org; Thu, 11 Jan 2024 12:01:08 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rNyQS-0003Zw-7s for qemu-devel@nongnu.org; Thu, 11 Jan 2024 12:01:06 -0500 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-673-IxN5Nws4M46lgwV77LbC-Q-1; Thu, 11 Jan 2024 12:00:58 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 81C69811E86; Thu, 11 Jan 2024 17:00:58 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.197]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2F5E851D5; Thu, 11 Jan 2024 17:00:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704992460; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MkBPO3VAMUVhEz/ZNLZS1qXdrJ8HeBjVd9KQ5fOGbi0=; b=ejt300uJiB7tvPDnwAD95W7V/cDxSL0aERIScKs/86+HIzfH6ZZyaEUV0lcPWIwp9pNoW7 ZKFfLD7G+R8mfykHAR1yu3OOcrglefEf+yMaEdu/rG+OpOvBDXWiNJLf9Jl84YyenbAUUQ fZb1Y1Z78ny1TyW7jOu+dXqWhirewlQ= X-MC-Unique: IxN5Nws4M46lgwV77LbC-Q-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Stefan Hajnoczi Subject: [PULL 05/17] Revert "tests/qtest/netdev-socket: Raise connection timeout to 120 seconds" Date: Thu, 11 Jan 2024 18:00:34 +0100 Message-ID: <20240111170047.909117-6-thuth@redhat.com> In-Reply-To: <20240111170047.909117-1-thuth@redhat.com> References: <20240111170047.909117-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -45 X-Spam_score: -4.6 X-Spam_bar: ---- X-Spam_report: (-4.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.467, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1704992657615100007 From: Daniel P. Berrang=C3=A9 This reverts commit 0daaf2761f6d268ffaa2d01d450e202e127452b1. The test was not timing out because of slow execution. It was timing out due to a race condition leading to the client QEMU attempting (and fatally failing) to connect before the server QEMU was listening. Signed-off-by: "Daniel P. Berrang=C3=A9" Message-ID: <20240104162942.211458-4-berrange@redhat.com> Reviewed-by: Stefan Hajnoczi Signed-off-by: Thomas Huth --- tests/qtest/netdev-socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qtest/netdev-socket.c b/tests/qtest/netdev-socket.c index 7ba1eff120..3fc2ac26d0 100644 --- a/tests/qtest/netdev-socket.c +++ b/tests/qtest/netdev-socket.c @@ -16,7 +16,7 @@ #include "qapi/qobject-input-visitor.h" #include "qapi/qapi-visit-sockets.h" =20 -#define CONNECTION_TIMEOUT 120 +#define CONNECTION_TIMEOUT 60 =20 #define EXPECT_STATE(q, e, t) \ do { \ --=20 2.43.0 From nobody Sat Sep 21 05:30:35 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1704992553; cv=none; d=zohomail.com; s=zohoarc; b=CdwXbpjpgQ/t5vcSf703iuj7Cl2HXZaIIodXdLPxEs0RFnbTW4LmJE1lMGKfD6bQhnuKNwhAIAejB5Wvlsf/6j8MYCRaHdAxspa7omExH7HkzK8srHMK6k1KQa07dMfnPiIBh6ZbkjGIV20dYdro2gfk7esFB3w7lFbqBUOCi9k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704992553; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Re+4UZ27+DR49DjUJzkY2gJ0HPmVohtgLMvTOnIMJyM=; b=b4Hit0dhUK9C41yFKvsSwOSm3p40WyXmYICWhi4NXMBLS6iT73OCFNdHW09/VAjBGLa4Ep4RlLzrW8ViT9EmWyDmwEL6Mgz790FI56oyCxfZ2vuUzGaL0s2zYncsXsbC2OdJXfJC4xqIfdnxS+x5AYbzNiM4mfb25xIvKW2AHfI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17049925531411007.6320305553897; Thu, 11 Jan 2024 09:02:33 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rNyQi-00047O-Bq; Thu, 11 Jan 2024 12:01:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rNyQV-0003qu-0R for qemu-devel@nongnu.org; Thu, 11 Jan 2024 12:01:08 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rNyQS-0003aU-HS for qemu-devel@nongnu.org; Thu, 11 Jan 2024 12:01:06 -0500 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-652-G40tPMM_NuSx_81bjKSDIQ-1; Thu, 11 Jan 2024 12:01:00 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2F180108BF3F; Thu, 11 Jan 2024 17:01:00 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.197]) by smtp.corp.redhat.com (Postfix) with ESMTP id C424351D5; Thu, 11 Jan 2024 17:00:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704992462; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Re+4UZ27+DR49DjUJzkY2gJ0HPmVohtgLMvTOnIMJyM=; b=SfyVfAJrPI3RE71cZqXcIEbfI4E9RUbKqWcNNjeIkbrC+ttODe1HW+9obMPlYiGxVS+R5J +xw1eglihI+zh6qZYZKwRYozZciJv1xBFf/+/hl3mOtQhczytucIlNHr267J9Q/YoH9Wl1 wM6Fr/qUbPBfBPwSxwMPuyW2UM/sWGs= X-MC-Unique: G40tPMM_NuSx_81bjKSDIQ-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Stefan Hajnoczi Subject: [PULL 06/17] net: add explicit info about connecting/listening state Date: Thu, 11 Jan 2024 18:00:35 +0100 Message-ID: <20240111170047.909117-7-thuth@redhat.com> In-Reply-To: <20240111170047.909117-1-thuth@redhat.com> References: <20240111170047.909117-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -45 X-Spam_score: -4.6 X-Spam_bar: ---- X-Spam_report: (-4.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.467, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1704992554692100007 From: Daniel P. Berrang=C3=A9 When running 'info network', if the stream backend is still in the process of connecting, or waiting for an incoming connection, no information is displayed. There is also no way to distinguish whether the server is still in the process of setting up the listener socket, or whether it is ready to accept incoming client connections. This leads to a race condition in the netdev-socket qtest which launches a server process followed by a client process. Under high load conditions it is possible for the client to attempt to connect before the server is accepting clients. For the scenarios which do not set the 'reconnect' option, this opens up a race which can lead to the test scenario failing to reach the expected state. Now that 'info network' can distinguish between initialization phase and the listening phase, the netdev-socket qtest will correctly synchronize, such that the client QEMU is not spawned until the server is ready. This should solve the non-deterministic failures seen with the netdev-socket qtest. Signed-off-by: "Daniel P. Berrang=C3=A9" Message-ID: <20240104162942.211458-5-berrange@redhat.com> Reviewed-by: Stefan Hajnoczi Signed-off-by: Thomas Huth --- net/stream.c | 5 ++++- tests/qtest/netdev-socket.c | 10 +++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/net/stream.c b/net/stream.c index 9204b4c96e..0defb21d45 100644 --- a/net/stream.c +++ b/net/stream.c @@ -173,7 +173,7 @@ static gboolean net_stream_send(QIOChannel *ioc, =20 net_socket_rs_init(&s->rs, net_stream_rs_finalize, false); s->nc.link_down =3D true; - qemu_set_info_str(&s->nc, "%s", ""); + qemu_set_info_str(&s->nc, "listening"); =20 qapi_event_send_netdev_stream_disconnected(s->nc.name); net_stream_arm_reconnect(s); @@ -292,6 +292,7 @@ static void net_stream_server_listening(QIOTask *task, = gpointer opaque) s->nc.link_down =3D true; s->listener =3D qio_net_listener_new(); =20 + qemu_set_info_str(&s->nc, "listening"); net_socket_rs_init(&s->rs, net_stream_rs_finalize, false); qio_net_listener_set_client_func(s->listener, net_stream_listen, s, NU= LL); qio_net_listener_add(s->listener, listen_sioc); @@ -309,6 +310,7 @@ static int net_stream_server_init(NetClientState *peer, =20 nc =3D qemu_new_net_client(&net_stream_info, peer, model, name); s =3D DO_UPCAST(NetStreamState, nc, nc); + qemu_set_info_str(&s->nc, "initializing"); =20 s->listen_ioc =3D QIO_CHANNEL(listen_sioc); qio_channel_socket_listen_async(listen_sioc, addr, 0, @@ -400,6 +402,7 @@ static int net_stream_client_init(NetClientState *peer, =20 nc =3D qemu_new_net_client(&net_stream_info, peer, model, name); s =3D DO_UPCAST(NetStreamState, nc, nc); + qemu_set_info_str(&s->nc, "connecting"); =20 s->ioc =3D QIO_CHANNEL(sioc); s->nc.link_down =3D true; diff --git a/tests/qtest/netdev-socket.c b/tests/qtest/netdev-socket.c index 3fc2ac26d0..91441f7922 100644 --- a/tests/qtest/netdev-socket.c +++ b/tests/qtest/netdev-socket.c @@ -127,7 +127,7 @@ static void test_stream_inet_ipv4(void) "addr.ipv4=3Don,addr.ipv6=3Doff," "addr.host=3D127.0.0.1,addr.port=3D%d", port); =20 - EXPECT_STATE(qts0, "st0: index=3D0,type=3Dstream,\r\n", 0); + EXPECT_STATE(qts0, "st0: index=3D0,type=3Dstream,listening\r\n", 0); =20 qts1 =3D qtest_initf("-nodefaults -M none " "-netdev stream,server=3Dfalse,id=3Dst0,addr.type= =3Dinet," @@ -200,7 +200,7 @@ static void test_stream_unix_reconnect(void) "-netdev stream,id=3Dst0,server=3Dtrue,addr.type=3D= unix," "addr.path=3D%s", path); =20 - EXPECT_STATE(qts0, "st0: index=3D0,type=3Dstream,\r\n", 0); + EXPECT_STATE(qts0, "st0: index=3D0,type=3Dstream,listening\r\n", 0); =20 qts1 =3D qtest_initf("-nodefaults -M none " "-netdev stream,server=3Dfalse,id=3Dst0,addr.type= =3Dunix," @@ -250,7 +250,7 @@ static void test_stream_inet_ipv6(void) "addr.ipv4=3Doff,addr.ipv6=3Don," "addr.host=3D::1,addr.port=3D%d", port); =20 - EXPECT_STATE(qts0, "st0: index=3D0,type=3Dstream,\r\n", 0); + EXPECT_STATE(qts0, "st0: index=3D0,type=3Dstream,listening\r\n", 0); =20 qts1 =3D qtest_initf("-nodefaults -M none " "-netdev stream,server=3Dfalse,id=3Dst0,addr.type= =3Dinet," @@ -282,7 +282,7 @@ static void test_stream_unix(void) "addr.type=3Dunix,addr.path=3D%s,", path); =20 - EXPECT_STATE(qts0, "st0: index=3D0,type=3Dstream,\r\n", 0); + EXPECT_STATE(qts0, "st0: index=3D0,type=3Dstream,listening\r\n", 0); =20 qts1 =3D qtest_initf("-nodefaults -M none " "-netdev stream,id=3Dst0,server=3Dfalse," @@ -314,7 +314,7 @@ static void test_stream_unix_abstract(void) "addr.abstract=3Don", path); =20 - EXPECT_STATE(qts0, "st0: index=3D0,type=3Dstream,\r\n", 0); + EXPECT_STATE(qts0, "st0: index=3D0,type=3Dstream,listening\r\n", 0); =20 qts1 =3D qtest_initf("-nodefaults -M none " "-netdev stream,id=3Dst0,server=3Dfalse," --=20 2.43.0 From nobody Sat Sep 21 05:30:35 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1704992599; cv=none; d=zohomail.com; s=zohoarc; b=HdsQhn7AkZlOB/nKSxoB4PZni3324swSn8Wfn60mmr8Kpk1mbYK6t4rNe1kt0pK8oPZqE4ZOfCSCBJ++ex1THOYKrNIxbO8/OsBymDyajQFNMMjLFcfij4+IOsGkerGzJ/NqZ5q3UTwCE6GBtNZy6xytpIk4AGvkg1wBNfTQtuM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704992599; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=RcyeY/MkZHjETcJIu32Fu3aVXWa7llBiMIYJjXJjN0E=; b=IwxX421Fw0wFaLgumJDJbKrwbBSZLiM2wFnwyJQgYwGn5M/eHh6bvuJRgV25elkPbYs7pgCEi0LeV7BsRZne9DVAnWtQKC0BP9YLwlVxFlORjv6UFGXG3xVz1StatR3J/ME2wD/9RwpTQyS7XoutC5WuV2wsFkEujpI27ffjC0c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704992599014893.9848413602567; Thu, 11 Jan 2024 09:03:19 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rNyQf-00041s-W9; Thu, 11 Jan 2024 12:01:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rNyQW-0003rb-Hb for qemu-devel@nongnu.org; Thu, 11 Jan 2024 12:01:08 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rNyQU-0003e5-R5 for qemu-devel@nongnu.org; Thu, 11 Jan 2024 12:01:08 -0500 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-528-lVVlRx7PMzasb0meflr2fQ-1; Thu, 11 Jan 2024 12:01:02 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5C0DB185A784; Thu, 11 Jan 2024 17:01:02 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.197]) by smtp.corp.redhat.com (Postfix) with ESMTP id AB5CC51D5; Thu, 11 Jan 2024 17:01:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704992466; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RcyeY/MkZHjETcJIu32Fu3aVXWa7llBiMIYJjXJjN0E=; b=KfK0rYPK9caT9ww7GBCvbtqTs4CvAH1YSfVYmPq59yrd3HH/y5kvZAbg5Es/82OSTeXIGX /Ppkd9/mK+X1eoqPOqtHsoe6cMw76nPGSej1nSOzu263HP/aiQ6zxnxYtTsz7UeXuXZYRT wH5pSBrRU2YTYXCrv3VNjZsdeVNu848= X-MC-Unique: lVVlRx7PMzasb0meflr2fQ-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Stefan Hajnoczi Subject: [PULL 07/17] net: handle QIOTask completion to report useful error message Date: Thu, 11 Jan 2024 18:00:36 +0100 Message-ID: <20240111170047.909117-8-thuth@redhat.com> In-Reply-To: <20240111170047.909117-1-thuth@redhat.com> References: <20240111170047.909117-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -45 X-Spam_score: -4.6 X-Spam_bar: ---- X-Spam_report: (-4.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.467, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1704992600806100003 From: Daniel P. Berrang=C3=A9 The network stream backend uses the async QIO socket APIs for listening and connecting sockets. It does not check the task object completion status, however, instead just looking at whether the socket FD is -1 or not. By checking the task completion, we can set a useful error message for users instead of the non-actionable "connection error" string. eg so users will see: (qemu) info network net: index=3D0,type=3Dstream,error: Failed to connect to '/foo.unix': No su= ch file or directory Signed-off-by: "Daniel P. Berrang=C3=A9" Message-ID: <20240104162942.211458-6-berrange@redhat.com> Reviewed-by: Stefan Hajnoczi Signed-off-by: Thomas Huth --- net/stream.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/net/stream.c b/net/stream.c index 0defb21d45..97e6ec6679 100644 --- a/net/stream.c +++ b/net/stream.c @@ -165,6 +165,7 @@ static gboolean net_stream_send(QIOChannel *ioc, s->ioc_write_tag =3D 0; } if (s->listener) { + qemu_set_info_str(&s->nc, "listening"); qio_net_listener_set_client_func(s->listener, net_stream_liste= n, s, NULL); } @@ -173,7 +174,6 @@ static gboolean net_stream_send(QIOChannel *ioc, =20 net_socket_rs_init(&s->rs, net_stream_rs_finalize, false); s->nc.link_down =3D true; - qemu_set_info_str(&s->nc, "listening"); =20 qapi_event_send_netdev_stream_disconnected(s->nc.name); net_stream_arm_reconnect(s); @@ -272,9 +272,11 @@ static void net_stream_server_listening(QIOTask *task,= gpointer opaque) QIOChannelSocket *listen_sioc =3D QIO_CHANNEL_SOCKET(s->listen_ioc); SocketAddress *addr; int ret; + Error *err =3D NULL; =20 - if (listen_sioc->fd < 0) { - qemu_set_info_str(&s->nc, "connection error"); + if (qio_task_propagate_error(task, &err)) { + qemu_set_info_str(&s->nc, "error: %s", error_get_pretty(err)); + error_free(err); return; } =20 @@ -327,9 +329,11 @@ static void net_stream_client_connected(QIOTask *task,= gpointer opaque) SocketAddress *addr; gchar *uri; int ret; + Error *err =3D NULL; =20 - if (sioc->fd < 0) { - qemu_set_info_str(&s->nc, "connection error"); + if (qio_task_propagate_error(task, &err)) { + qemu_set_info_str(&s->nc, "error: %s", error_get_pretty(err)); + error_free(err); goto error; } =20 @@ -384,6 +388,7 @@ static gboolean net_stream_reconnect(gpointer data) static void net_stream_arm_reconnect(NetStreamState *s) { if (s->reconnect && s->timer_tag =3D=3D 0) { + qemu_set_info_str(&s->nc, "connecting"); s->timer_tag =3D g_timeout_add_seconds(s->reconnect, net_stream_reconnect, s); } --=20 2.43.0 From nobody Sat Sep 21 05:30:35 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1704992584; cv=none; d=zohomail.com; s=zohoarc; b=Hvq7ZJ35MJdqVoGowKTaAbJoPL8i7hy2erkIExQXy5bl0vpDDVoD8VtqZCuCwtghgMiiriMps1Fm7puZYoasq1Ntf1BTXOBGO43W7R1PTiIiBL2zR8D9f4MuK49C1tQ9gOcv8ePBfwPetnTF22Ngj1Us/33tc9xcPUrcBE9Lvps= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704992584; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=agZ3EMiuMBJA7OhXiWkc12ty80jl6oKZfEI1YqWirJQ=; b=g8cr8Qxns5CD/Gg14EdKCSKwJ9brqdUs5iQ4mbn8NEsT079peEAXt/FyVTI+asJiE+61uwoySR87VZE4dOaaq8cdStHO1BJFPTfcmSuocIdJkxD774uU6fdw1UcG7m/BoIcq8Vj9BG1B3AwRraZzyGoFA7oYBJ6as1jDjC1Arfc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704992584233372.3519291977618; Thu, 11 Jan 2024 09:03:04 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rNyQj-00048a-GR; Thu, 11 Jan 2024 12:01:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rNyQW-0003rc-Ju for qemu-devel@nongnu.org; Thu, 11 Jan 2024 12:01:09 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rNyQV-0003eQ-1k for qemu-devel@nongnu.org; Thu, 11 Jan 2024 12:01:08 -0500 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-122-giO5HjEMMHWz97DOUh9-VQ-1; Thu, 11 Jan 2024 12:01:04 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 468F31C068FA; Thu, 11 Jan 2024 17:01:04 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.197]) by smtp.corp.redhat.com (Postfix) with ESMTP id B2AC051D5; Thu, 11 Jan 2024 17:01:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704992466; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=agZ3EMiuMBJA7OhXiWkc12ty80jl6oKZfEI1YqWirJQ=; b=HSPmlzWcg0D4P+SLJAbn4Piva9kkbJYq6vTKNnMg9o54b5OlZw8ZefxRjzF+dVsynW6W+/ yf+97AAKgX7LxXNNML3zL6sn4R5frHHCO2UD2wJUkgHXPh7E1eCR1zUueQYyDIZZn91JcV 5QqP8sZR7bdk2/BX+nxMEkLNp63vIPs= X-MC-Unique: giO5HjEMMHWz97DOUh9-VQ-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefan Hajnoczi Subject: [PULL 08/17] qtest: ensure netdev-socket tests have non-overlapping names Date: Thu, 11 Jan 2024 18:00:37 +0100 Message-ID: <20240111170047.909117-9-thuth@redhat.com> In-Reply-To: <20240111170047.909117-1-thuth@redhat.com> References: <20240111170047.909117-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -45 X-Spam_score: -4.6 X-Spam_bar: ---- X-Spam_report: (-4.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.467, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1704992584927100001 From: Daniel P. Berrang=C3=A9 When naming glib tests if the name of one test is a substring of the name of another test, it is not possible to use the '-p /the/name' option to run a single test. Signed-off-by: "Daniel P. Berrang=C3=A9" Message-ID: <20240104162942.211458-7-berrange@redhat.com> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Stefan Hajnoczi Signed-off-by: Thomas Huth --- tests/qtest/netdev-socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qtest/netdev-socket.c b/tests/qtest/netdev-socket.c index 91441f7922..fc7d11961e 100644 --- a/tests/qtest/netdev-socket.c +++ b/tests/qtest/netdev-socket.c @@ -526,7 +526,7 @@ int main(int argc, char **argv) #ifndef _WIN32 qtest_add_func("/netdev/dgram/unix", test_dgram_unix); #endif - qtest_add_func("/netdev/stream/unix", test_stream_unix); + qtest_add_func("/netdev/stream/unix/oneshot", test_stream_unix); qtest_add_func("/netdev/stream/unix/reconnect", test_stream_unix_reconnect); #ifdef CONFIG_LINUX --=20 2.43.0 From nobody Sat Sep 21 05:30:35 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1704992759; cv=none; d=zohomail.com; s=zohoarc; b=MSKt5VQpFd46BZX4Z1O2na46RHnf08CjBvd2pcnH8YPNmk7F5+FiTx9bnDFtIABfUZ3kkL6pNhgOFZ04ICznlWpDCXes2k/BKB9cFtBMYxM/B/8Joub8hJ9y6xnSU/4FjvwMfrL6AEisFTjWhLCVYlX0JbXwvytvotGpsw+YmbY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704992759; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=d8cb0BzMvSNrKKGB2firgofzOdxv5P92jVnpiy2Q61M=; b=fg7oUHZElQrezZXXToXWj8y50sqAV7lsEaLkjqzgmqDOdxM5TYy64xiioC07C5sksO+mEQx15Wdr9EiDf588NuNurGYRo8VSxy6EexYFpYGREv4ROrUGnKH2sh2m+33XwDQf6mBmxOQPiyFxVAo+YRohNnJRYpDKp21SaP6L+Nw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704992759471917.8289922057679; Thu, 11 Jan 2024 09:05:59 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rNyQm-0004BB-5l; Thu, 11 Jan 2024 12:01:24 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rNyQe-0003zr-P2 for qemu-devel@nongnu.org; Thu, 11 Jan 2024 12:01:16 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rNyQd-0003iq-1V for qemu-devel@nongnu.org; Thu, 11 Jan 2024 12:01:16 -0500 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-261-ynJs8SvJMOKli_TBxHRDYw-1; Thu, 11 Jan 2024 12:01:08 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AFA2C108BF33; Thu, 11 Jan 2024 17:01:05 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.197]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8AC9D51D5; Thu, 11 Jan 2024 17:01:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704992473; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=d8cb0BzMvSNrKKGB2firgofzOdxv5P92jVnpiy2Q61M=; b=EwN6MYmD7U1qkd/rFxZOEHZX/IxKQ5n+vquZrB/RFAeMw6S9jXQ1gKyeiHGHunQ48nEuTT 8o/nS8QNFpTZ6RScylAv6NSewixXPKt7xPFepJsdpVyomHLFbWkux4L/vcDO5Fkg8t32H3 2kay9zCO7v5GIGDPPPu0mkflPH1UFP4= X-MC-Unique: ynJs8SvJMOKli_TBxHRDYw-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell , Samuel Tardieu , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 09/17] tests/qtest/virtio-ccw: Fix device presence checking Date: Thu, 11 Jan 2024 18:00:38 +0100 Message-ID: <20240111170047.909117-10-thuth@redhat.com> In-Reply-To: <20240111170047.909117-1-thuth@redhat.com> References: <20240111170047.909117-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -45 X-Spam_score: -4.6 X-Spam_bar: ---- X-Spam_report: (-4.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.467, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1704992761735100003 From: Samuel Tardieu An apparent copy-paste error tests for the presence of the virtio-rng-ccw device in order to perform tests on the virtio-scsi-ccw device. Signed-off-by: Samuel Tardieu Message-ID: <20240106130121.1244993-1-sam@rfc1149.net> Fixes: 65331bf5d1 ("tests/qtest: Check for virtio-ccw devices before using= them") Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Thomas Huth --- tests/qtest/virtio-ccw-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qtest/virtio-ccw-test.c b/tests/qtest/virtio-ccw-test.c index f4f5858b84..7a5357c212 100644 --- a/tests/qtest/virtio-ccw-test.c +++ b/tests/qtest/virtio-ccw-test.c @@ -85,7 +85,7 @@ int main(int argc, char **argv) if (qtest_has_device("virtio-rng-ccw")) { qtest_add_func("/virtio/rng/nop", virtio_rng_nop); } - if (qtest_has_device("virtio-rng-ccw")) { + if (qtest_has_device("virtio-scsi-ccw")) { qtest_add_func("/virtio/scsi/nop", virtio_scsi_nop); qtest_add_func("/virtio/scsi/hotplug", virtio_scsi_hotplug); } --=20 2.43.0 From nobody Sat Sep 21 05:30:35 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1704992711; cv=none; d=zohomail.com; s=zohoarc; b=gLxK4YsGxQ5YYkh03w8srJCQjNOfn7uqqnw9zmh7XIZouyzamfe6FpAKIAE/DVBgPF6F15G7vSb7B+fg0NERj4qy5k2lLnaSE++fatrP+kXPMMfQw5S/b5l3G+gxPTmwHFYBh6sdBkAiMFMYq6JdD61I64ODZB6reAOLQxpfXtc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704992711; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=xCLVifFBlpcunJVbDoZ8VS78jJwDWTASw8loqXXE2KU=; b=mynAZLdyP/1EIRwrFMj+3YPgTKvMFVkFwkWPxdgXx0rvQ+qVQjHw9wvsmD5mEp+rrJJ6buYwjU0Hfw5QMaV2nD+YiU3NT7aF66ZF8hXbXkdwzZICYv1TgMYGaM9JFxCHJ9+yX1SsFKgwgkLVePWFj41WIBiRcruTaubLv6L7goY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17049927115481015.5159176032979; Thu, 11 Jan 2024 09:05:11 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rNyQl-0004A6-6y; Thu, 11 Jan 2024 12:01:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rNyQd-0003vm-Bv for qemu-devel@nongnu.org; Thu, 11 Jan 2024 12:01:15 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rNyQa-0003hU-6s for qemu-devel@nongnu.org; Thu, 11 Jan 2024 12:01:14 -0500 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-195-Aid_luucO1q4bnd0_64Q7A-1; Thu, 11 Jan 2024 12:01:08 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C71AC28AC1EB; Thu, 11 Jan 2024 17:01:07 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.197]) by smtp.corp.redhat.com (Postfix) with ESMTP id 372EA51D5; Thu, 11 Jan 2024 17:01:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704992471; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xCLVifFBlpcunJVbDoZ8VS78jJwDWTASw8loqXXE2KU=; b=VCbqz1NL8MuqQg3hsFz914oVjoEXW/apfbgQ3nffkbwd9ic1ru1XX1bRN0qr80+AwyZkL8 N67ZrBlPdP5kEnlvcTRgleb9AZ5ruesDMUTDw/NU1299Xs30bQuifE1Dh3RpFfPZ2bLEoC ZWwALkBG+K+zPCMmKYSKJL2D8Fr2HHw= X-MC-Unique: Aid_luucO1q4bnd0_64Q7A-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell , Nicholas Piggin , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 10/17] gitlab: fix s390x tag for avocado-system-centos Date: Thu, 11 Jan 2024 18:00:39 +0100 Message-ID: <20240111170047.909117-11-thuth@redhat.com> In-Reply-To: <20240111170047.909117-1-thuth@redhat.com> References: <20240111170047.909117-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -45 X-Spam_score: -4.6 X-Spam_bar: ---- X-Spam_report: (-4.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.467, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1704992713416100003 From: Nicholas Piggin The 390x tag should be s390x. Signed-off-by: Nicholas Piggin Message-ID: <20240107170119.82222-2-npiggin@gmail.com> Reviewed-by: C=C3=A9dric Le Goater Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Thomas Huth --- .gitlab-ci.d/buildtest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml index 91663946de..cfe737aca2 100644 --- a/.gitlab-ci.d/buildtest.yml +++ b/.gitlab-ci.d/buildtest.yml @@ -184,7 +184,7 @@ avocado-system-centos: variables: IMAGE: centos8 MAKE_CHECK_ARGS: check-avocado - AVOCADO_TAGS: arch:ppc64 arch:or1k arch:390x arch:x86_64 arch:rx + AVOCADO_TAGS: arch:ppc64 arch:or1k arch:s390x arch:x86_64 arch:rx arch:sh4 arch:nios2 =20 build-system-opensuse: --=20 2.43.0 From nobody Sat Sep 21 05:30:35 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1704992652; cv=none; d=zohomail.com; s=zohoarc; b=YH97uIx+SriX/bRkHNM6vj5ZjoyTtgBAFveHMQvRvL68zcIIeWRxTkhn2xuD1Ap/+ovXmhZRqBEA8/NL8SYjP8ctGkQwDvAJmlQ7UPsWrQtd8ufXI9jFvIfapd3UvP7X99S6NUgr5WCrG13Vp40YdD7hSbentcY44mmBK5Xfl9g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704992652; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=hSC/yr/SjKGR1NeTXe9UeVAimfzLy0knDKvzeqkGyHU=; b=D8hp7EcF5S3G6fgJ1I96zJijRKrJSjq5wWlX2wEm2f6nS6+rHhIVbOwpk33YdKK+blLnGxLKo+PsfEiTDtxkB3+6rJfkeYe58a6g2byn7emIIb/S8KF8jolxuI2Z635InAaxwr5JtarTunN1h01BMQ+WCI1fhxAKUq1EdPTaE9E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704992652208144.40705747542154; Thu, 11 Jan 2024 09:04:12 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rNyQl-0004A8-6l; Thu, 11 Jan 2024 12:01:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rNyQf-00040f-9q for qemu-devel@nongnu.org; Thu, 11 Jan 2024 12:01:17 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rNyQc-0003ic-Nr for qemu-devel@nongnu.org; Thu, 11 Jan 2024 12:01:16 -0500 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-339-GUr4ZocPPQa18rLmdg0LUA-1; Thu, 11 Jan 2024 12:01:10 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9EF013816B54; Thu, 11 Jan 2024 17:01:09 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.197]) by smtp.corp.redhat.com (Postfix) with ESMTP id 15A3451D5; Thu, 11 Jan 2024 17:01:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704992473; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hSC/yr/SjKGR1NeTXe9UeVAimfzLy0knDKvzeqkGyHU=; b=NIvjCPDBe0JljPZyrMLLPX6UY3ZvHmDOc5Fi1gsbxCUPBW0gwJv+t1HWyKZ8gahWK4ts/U G99G4QjWN1m5MpsZ1slaf0Zm86ndAvKd6CuxApvxjQ8bNciIERuwSmpxScaTbIKuXeLbgH nKJJhQwcLDfq8XSoUdQ3F8nuIeBEhLc= X-MC-Unique: GUr4ZocPPQa18rLmdg0LUA-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Claudio Imbrenda Subject: [PULL 11/17] target/s390x/kvm/pv: Provide some more useful information if decryption fails Date: Thu, 11 Jan 2024 18:00:40 +0100 Message-ID: <20240111170047.909117-12-thuth@redhat.com> In-Reply-To: <20240111170047.909117-1-thuth@redhat.com> References: <20240111170047.909117-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -45 X-Spam_score: -4.6 X-Spam_bar: ---- X-Spam_report: (-4.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.467, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1704992653109100001 It's a common scenario to copy guest images from one host to another to run the guest on the other machine. This (of course) does not work with "secure execution" guests since they are encrypted with one certain host key. However, if you still (accidentally) do it, you only get a very user-unfriendly error message that looks like this: qemu-system-s390x: KVM PV command 2 (KVM_PV_SET_SEC_PARMS) failed: header rc 108 rrc 5 IOCTL rc: -22 Let's provide at least a somewhat nicer hint to the users so that they are able to figure out what might have gone wrong. Buglink: https://issues.redhat.com/browse/RHEL-18212 Message-ID: <20240110142916.850605-1-thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: C=C3=A9dric Le Goater Reviewed-by: Claudio Imbrenda Signed-off-by: Thomas Huth --- hw/s390x/ipl.h | 2 +- target/s390x/kvm/pv.h | 5 +++-- hw/s390x/ipl.c | 5 ++--- hw/s390x/s390-virtio-ccw.c | 5 ++++- target/s390x/kvm/pv.c | 25 ++++++++++++++++++++----- 5 files changed, 30 insertions(+), 12 deletions(-) diff --git a/hw/s390x/ipl.h b/hw/s390x/ipl.h index 7fc86e7905..57cd125769 100644 --- a/hw/s390x/ipl.h +++ b/hw/s390x/ipl.h @@ -107,7 +107,7 @@ typedef union IplParameterBlock IplParameterBlock; =20 int s390_ipl_set_loadparm(uint8_t *loadparm); void s390_ipl_update_diag308(IplParameterBlock *iplb); -int s390_ipl_prepare_pv_header(void); +int s390_ipl_prepare_pv_header(Error **errp); int s390_ipl_pv_unpack(void); void s390_ipl_prepare_cpu(S390CPU *cpu); IplParameterBlock *s390_ipl_get_iplb(void); diff --git a/target/s390x/kvm/pv.h b/target/s390x/kvm/pv.h index 7b935e2246..5877d28ff1 100644 --- a/target/s390x/kvm/pv.h +++ b/target/s390x/kvm/pv.h @@ -42,7 +42,7 @@ int s390_pv_query_info(void); int s390_pv_vm_enable(void); void s390_pv_vm_disable(void); bool s390_pv_vm_try_disable_async(S390CcwMachineState *ms); -int s390_pv_set_sec_parms(uint64_t origin, uint64_t length); +int s390_pv_set_sec_parms(uint64_t origin, uint64_t length, Error **errp); int s390_pv_unpack(uint64_t addr, uint64_t size, uint64_t tweak); void s390_pv_prep_reset(void); int s390_pv_verify(void); @@ -62,7 +62,8 @@ static inline int s390_pv_query_info(void) { return 0; } static inline int s390_pv_vm_enable(void) { return 0; } static inline void s390_pv_vm_disable(void) {} static inline bool s390_pv_vm_try_disable_async(S390CcwMachineState *ms) {= return false; } -static inline int s390_pv_set_sec_parms(uint64_t origin, uint64_t length) = { return 0; } +static inline int s390_pv_set_sec_parms(uint64_t origin, uint64_t length, + Error **errp) { return 0; } static inline int s390_pv_unpack(uint64_t addr, uint64_t size, uint64_t tw= eak) { return 0; } static inline void s390_pv_prep_reset(void) {} static inline int s390_pv_verify(void) { return 0; } diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c index 76110e8f58..e934bf89d1 100644 --- a/hw/s390x/ipl.c +++ b/hw/s390x/ipl.c @@ -702,7 +702,7 @@ static void s390_ipl_prepare_qipl(S390CPU *cpu) cpu_physical_memory_unmap(addr, len, 1, len); } =20 -int s390_ipl_prepare_pv_header(void) +int s390_ipl_prepare_pv_header(Error **errp) { IplParameterBlock *ipib =3D s390_ipl_get_iplb_pv(); IPLBlockPV *ipib_pv =3D &ipib->pv; @@ -711,8 +711,7 @@ int s390_ipl_prepare_pv_header(void) =20 cpu_physical_memory_read(ipib_pv->pv_header_addr, hdr, ipib_pv->pv_header_len); - rc =3D s390_pv_set_sec_parms((uintptr_t)hdr, - ipib_pv->pv_header_len); + rc =3D s390_pv_set_sec_parms((uintptr_t)hdr, ipib_pv->pv_header_len, e= rrp); g_free(hdr); return rc; } diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 1169e20b94..eaf61d3640 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -391,7 +391,7 @@ static int s390_machine_protect(S390CcwMachineState *ms) } =20 /* Set SE header and unpack */ - rc =3D s390_ipl_prepare_pv_header(); + rc =3D s390_ipl_prepare_pv_header(&local_err); if (rc) { goto out_err; } @@ -410,6 +410,9 @@ static int s390_machine_protect(S390CcwMachineState *ms) return rc; =20 out_err: + if (local_err) { + error_report_err(local_err); + } s390_machine_unprotect(ms); return rc; } diff --git a/target/s390x/kvm/pv.c b/target/s390x/kvm/pv.c index 6a69be7e5c..7ca7faec73 100644 --- a/target/s390x/kvm/pv.c +++ b/target/s390x/kvm/pv.c @@ -29,7 +29,8 @@ static bool info_valid; static struct kvm_s390_pv_info_vm info_vm; static struct kvm_s390_pv_info_dump info_dump; =20 -static int __s390_pv_cmd(uint32_t cmd, const char *cmdname, void *data) +static int __s390_pv_cmd(uint32_t cmd, const char *cmdname, void *data, + int *pvrc) { struct kvm_pv_cmd pv_cmd =3D { .cmd =3D cmd, @@ -46,6 +47,9 @@ static int __s390_pv_cmd(uint32_t cmd, const char *cmdnam= e, void *data) "IOCTL rc: %d", cmd, cmdname, pv_cmd.rc, pv_cmd.rrc, rc); } + if (pvrc) { + *pvrc =3D pv_cmd.rc; + } return rc; } =20 @@ -53,12 +57,13 @@ static int __s390_pv_cmd(uint32_t cmd, const char *cmdn= ame, void *data) * This macro lets us pass the command as a string to the function so * we can print it on an error. */ -#define s390_pv_cmd(cmd, data) __s390_pv_cmd(cmd, #cmd, data) +#define s390_pv_cmd(cmd, data) __s390_pv_cmd(cmd, #cmd, data, NULL) +#define s390_pv_cmd_pvrc(cmd, data, pvrc) __s390_pv_cmd(cmd, #cmd, data, p= vrc) #define s390_pv_cmd_exit(cmd, data) \ { \ int rc; \ \ - rc =3D __s390_pv_cmd(cmd, #cmd, data);\ + rc =3D __s390_pv_cmd(cmd, #cmd, data, NULL); \ if (rc) { \ exit(1); \ } \ @@ -142,14 +147,24 @@ bool s390_pv_vm_try_disable_async(S390CcwMachineState= *ms) return true; } =20 -int s390_pv_set_sec_parms(uint64_t origin, uint64_t length) +int s390_pv_set_sec_parms(uint64_t origin, uint64_t length, Error **errp) { + int ret, pvrc; struct kvm_s390_pv_sec_parm args =3D { .origin =3D origin, .length =3D length, }; =20 - return s390_pv_cmd(KVM_PV_SET_SEC_PARMS, &args); + ret =3D s390_pv_cmd_pvrc(KVM_PV_SET_SEC_PARMS, &args, &pvrc); + if (ret) { + error_setg(errp, "Failed to set secure execution parameters"); + if (pvrc =3D=3D 0x108) { + error_append_hint(errp, "Please check whether the image is " + "correctly encrypted for this host\n"); + } + } + + return ret; } =20 /* --=20 2.43.0 From nobody Sat Sep 21 05:30:35 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1704992729; cv=none; d=zohomail.com; s=zohoarc; b=R+Jr4tinCWc9W1qDDKVfriJDEpt4Ee/Ewsce59MYnSKsTvTojw6KXMzdHaI5GCe5vq7Q/i28HMCawywYormDJzqTT8CjTQ/botG2ZX2FcinTwIyXND8Zw1goNf7cYHi4ffE7QRRO2Va5DsFX7GBAxNIT5hP6KOCuqbAwPWcyN5Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704992729; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=scC8M03aLUuXDJYmxRJ7WmForDOFFqyaByNnKGJOoDI=; b=CstRcSwOEpnJGLqxuWKH+35sGPurvKyBKxZOhNhKkz2ODnyQkQCSspgeVFaNeUiH4J8RfxVe26+1ZiuvGZKPsHefrtgglUhTbVtRPKuV48LxfRNNxzJb6mSnXpx3UywYQeqY/PKThfzeZu1p5yL1j+SMlkaELrbr+4GQrtDBD4Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704992729771859.5346867805769; Thu, 11 Jan 2024 09:05:29 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rNyQq-0004DD-EI; Thu, 11 Jan 2024 12:01:28 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rNyQk-000495-3i for qemu-devel@nongnu.org; Thu, 11 Jan 2024 12:01:22 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rNyQi-0003ni-8x for qemu-devel@nongnu.org; Thu, 11 Jan 2024 12:01:21 -0500 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-659-xiUITAFXOzy-MPALsDL4DA-1; Thu, 11 Jan 2024 12:01:16 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3348F101A52A; Thu, 11 Jan 2024 17:01:11 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.197]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2779651D5; Thu, 11 Jan 2024 17:01:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704992479; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=scC8M03aLUuXDJYmxRJ7WmForDOFFqyaByNnKGJOoDI=; b=e1kAY7mrM0zTiMHu1R8BQezcWkBNALFMKxdShKci8BzVqV8HXBslshUkBzh++PY3FPX7rJ J66kOkxgn3v+v1MiyOUfUBUcpoQl+LJ8yZqipEkfJUzvIWGQccCphUeAfEqoL7WN4NJrOP PdIBJCsOHTKRLKGCuA9yrPPxWXeyqPk= X-MC-Unique: xiUITAFXOzy-MPALsDL4DA-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell , Zhao Liu , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Eric Farman Subject: [PULL 12/17] hw/s390x/ccw: Replace basename() with g_path_get_basename() Date: Thu, 11 Jan 2024 18:00:41 +0100 Message-ID: <20240111170047.909117-13-thuth@redhat.com> In-Reply-To: <20240111170047.909117-1-thuth@redhat.com> References: <20240111170047.909117-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -45 X-Spam_score: -4.6 X-Spam_bar: ---- X-Spam_report: (-4.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.467, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1704992731633100003 From: Zhao Liu g_path_get_basename() is a portable utility function that has the advantage of not modifying the string argument, so it should be preferred over basename(). And also to avoid potential compile breakage with the Musl C library similar to [1], replace basename() with g_path_get_basename(). [1]: https://lore.kernel.org/all/20231212010228.2701544-1-raj.khem@gmail.co= m/ Suggested-by: C=C3=A9dric Le Goater Signed-off-by: Zhao Liu Message-ID: <20231221171921.57784-2-zhao1.liu@linux.intel.com> Reviewed-by: C=C3=A9dric Le Goater Reviewed-by: Eric Farman Signed-off-by: Thomas Huth --- hw/s390x/s390-ccw.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/s390x/s390-ccw.c b/hw/s390x/s390-ccw.c index e2d86d96e7..ab7022a3ab 100644 --- a/hw/s390x/s390-ccw.c +++ b/hw/s390x/s390-ccw.c @@ -76,7 +76,8 @@ static void s390_ccw_get_dev_info(S390CCWDevice *cdev, Error **errp) { unsigned int cssid, ssid, devid; - char dev_path[PATH_MAX] =3D {0}, *tmp; + char dev_path[PATH_MAX] =3D {0}; + g_autofree char *tmp =3D NULL; =20 if (!sysfsdev) { error_setg(errp, "No host device provided"); @@ -92,7 +93,7 @@ static void s390_ccw_get_dev_info(S390CCWDevice *cdev, =20 cdev->mdevid =3D g_path_get_basename(dev_path); =20 - tmp =3D basename(dirname(dev_path)); + tmp =3D g_path_get_basename(dirname(dev_path)); if (sscanf(tmp, "%2x.%1x.%4x", &cssid, &ssid, &devid) !=3D 3) { error_setg_errno(errp, errno, "Failed to read %s", tmp); return; --=20 2.43.0 From nobody Sat Sep 21 05:30:35 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1704992688; cv=none; d=zohomail.com; s=zohoarc; b=gVWpgFb7j+8fw8+mJ3YUkXkQpBKeHYm0xncJ0o6Rbi5UnqnUY/KxM2p9jMlVsXsBBlqJzIz4quSSXgNLpmM7x6AZoSp/D7H39q9gkSlRI6hhNpmZpeDLGM9VxsOJo2fuZ79Yf6bNFPAlQEjUN05cXw8bi+z5fY/8giLACzQ1Lio= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704992688; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=FqK0TjfhvmsiSNe/HynuF3gunefj2YJ/P+y3XktSFdM=; b=nELsNfTPlC7sI4SXxDo6LdIj/rBEgC2wRVuWrK7Gf5xMtrQa3csLeaIJyHQAYVWvqTgfjFhpL8XAJD2BF25mYbT3ulXFl+w03S5WE5QWSUwbR6+rYBrjNfIPQavRTn+rCBCx2tx+wnDB5iQaJGJCuu0QJctlkdo3AzSfjg864q0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704992688779319.0591408447151; Thu, 11 Jan 2024 09:04:48 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rNyQm-0004BE-B4; Thu, 11 Jan 2024 12:01:24 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rNyQj-00048U-7k for qemu-devel@nongnu.org; Thu, 11 Jan 2024 12:01:21 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rNyQh-0003m1-61 for qemu-devel@nongnu.org; Thu, 11 Jan 2024 12:01:20 -0500 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-374-dMPIIMgBPwe-04FalHOu6g-1; Thu, 11 Jan 2024 12:01:13 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3924A108BF37; Thu, 11 Jan 2024 17:01:13 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.197]) by smtp.corp.redhat.com (Postfix) with ESMTP id A957D51D5; Thu, 11 Jan 2024 17:01:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704992478; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FqK0TjfhvmsiSNe/HynuF3gunefj2YJ/P+y3XktSFdM=; b=OHAUGxhabg1tiCccwb27XHbGAHk1dzBhSrrzRBpf1qYiGG/L+nqYz0C1LxJUSKsuym/sU1 Untp2uo+QICh/WDvBq+g8wHYw9mtUBvUxTxtENHOErZBzQVI7CO4PVdGX84kDtAzb96VBN la1Zr9mS588Ql3KCoofmixwVuJBxfQs= X-MC-Unique: dMPIIMgBPwe-04FalHOu6g-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell , Zhao Liu , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Eric Farman Subject: [PULL 13/17] hw/s390x/ccw: Replace dirname() with g_path_get_dirname() Date: Thu, 11 Jan 2024 18:00:42 +0100 Message-ID: <20240111170047.909117-14-thuth@redhat.com> In-Reply-To: <20240111170047.909117-1-thuth@redhat.com> References: <20240111170047.909117-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -45 X-Spam_score: -4.6 X-Spam_bar: ---- X-Spam_report: (-4.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.467, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1704992689305100001 From: Zhao Liu As commit 3e015d815b3f ("use g_path_get_basename instead of basename") said, g_path_get_dirname() should be preferred over dirname() since the former is a portable utility function that has the advantage of not modifying the string argument. Replace dirname() with g_path_get_dirname(). Suggested-by: C=C3=A9dric Le Goater Signed-off-by: Zhao Liu Message-ID: <20231221171921.57784-3-zhao1.liu@linux.intel.com> Reviewed-by: C=C3=A9dric Le Goater Reviewed-by: Eric Farman Signed-off-by: Thomas Huth --- hw/s390x/s390-ccw.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/s390x/s390-ccw.c b/hw/s390x/s390-ccw.c index ab7022a3ab..5261e66724 100644 --- a/hw/s390x/s390-ccw.c +++ b/hw/s390x/s390-ccw.c @@ -77,6 +77,7 @@ static void s390_ccw_get_dev_info(S390CCWDevice *cdev, { unsigned int cssid, ssid, devid; char dev_path[PATH_MAX] =3D {0}; + g_autofree char *tmp_dir =3D NULL; g_autofree char *tmp =3D NULL; =20 if (!sysfsdev) { @@ -93,7 +94,8 @@ static void s390_ccw_get_dev_info(S390CCWDevice *cdev, =20 cdev->mdevid =3D g_path_get_basename(dev_path); =20 - tmp =3D g_path_get_basename(dirname(dev_path)); + tmp_dir =3D g_path_get_dirname(dev_path); + tmp =3D g_path_get_basename(tmp_dir); if (sscanf(tmp, "%2x.%1x.%4x", &cssid, &ssid, &devid) !=3D 3) { error_setg_errno(errp, errno, "Failed to read %s", tmp); return; --=20 2.43.0 From nobody Sat Sep 21 05:30:35 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1704992689; cv=none; d=zohomail.com; s=zohoarc; b=mh2pp1/LlaKNm9xTFHiliZVpk8p8Dhhigw3qie1zybs+zwqgcrG+bIvB14NzOEE0v+qJhELO2YWjh8S5klrVje1FMYMDo3ySe63BEFNoPrKPg5QFTEUGVu20k2vFZ5Fp+f8fIbswz1RgVNqRXYf8R9hFxWtaYX+RIc3bGdEHBYk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704992689; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=qO5heAw+CZ2fcY4dM3EnLtLQdF5yK4B4YLnj2or0YRw=; b=IQGuIkd9CRAN7jm3thGchm5d18zd0gUYHS84jtuKI8lN3CEZMYXF+nX4Ege9u/y9TfiOhLbUaOrK/4j/qTaoroAnYNPfCqo2gTAGKjBjZv6YZP+KpcDKrvbP2mwMsDl7nO2jAeegzAKIGa7e8XSYoQkl1LtN8TsqWxATM/r1ca0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17049926892881006.6247425994385; Thu, 11 Jan 2024 09:04:49 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rNyQn-0004Br-NN; Thu, 11 Jan 2024 12:01:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rNyQk-000494-3o for qemu-devel@nongnu.org; Thu, 11 Jan 2024 12:01:22 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rNyQh-0003nE-RQ for qemu-devel@nongnu.org; Thu, 11 Jan 2024 12:01:21 -0500 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-39-hCE7uHh4NJi8PsHRNuLqSQ-1; Thu, 11 Jan 2024 12:01:16 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AFDC9108BF31; Thu, 11 Jan 2024 17:01:15 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.197]) by smtp.corp.redhat.com (Postfix) with ESMTP id F29E751D5; Thu, 11 Jan 2024 17:01:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704992479; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qO5heAw+CZ2fcY4dM3EnLtLQdF5yK4B4YLnj2or0YRw=; b=J126Uug50F7HC/rpckq9hTkFVJJUpzYXiZWelCyOZYJnWBM0jwTTmNSzBbgtrsAawwx1B3 cCTsINphKG+yCc6yrKe5SZQKOksjLcJo2+MA5D2gWA3HuaVI0QHBtzWeiaPCxH/NgvmiaR zHmyd6/dV/FOFx8SmMTWKZPzYHqTF9M= X-MC-Unique: hCE7uHh4NJi8PsHRNuLqSQ-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell , Zhao Liu , Yongwei Ma , Samuel Tardieu Subject: [PULL 14/17] scripts/checkpatch: Support codespell checking Date: Thu, 11 Jan 2024 18:00:43 +0100 Message-ID: <20240111170047.909117-15-thuth@redhat.com> In-Reply-To: <20240111170047.909117-1-thuth@redhat.com> References: <20240111170047.909117-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -45 X-Spam_score: -4.6 X-Spam_bar: ---- X-Spam_report: (-4.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.467, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1704992691292100007 Content-Type: text/plain; charset="utf-8" From: Zhao Liu Add two spelling check options (--codespell and --codespellfile) to enhance spelling check through dictionary, which copied the Linux kernel's implementation in checkpatch.pl. This check uses the dictionary at "/usr/share/codespell/dictionary.txt" by default, if there is no dictionary specified under this path, it will look for the dictionary of python3's codespell (This requires user to add python3's path in environment variable $PATH, and to install codespell by "pip install codespell"). Tested-by: Yongwei Ma Tested-by: Samuel Tardieu Signed-off-by: Zhao Liu Message-ID: <20240105083848.267192-1-zhao1.liu@linux.intel.com> Signed-off-by: Thomas Huth --- scripts/checkpatch.pl | 125 +++++++++++++++++++++++++++++++++++------- 1 file changed, 105 insertions(+), 20 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 6e4100d2a4..7026895074 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -35,6 +35,9 @@ my $summary_file =3D 0; my $root; my %debug; my $help =3D 0; +my $codespell =3D 0; +my $codespellfile =3D "/usr/share/codespell/dictionary.txt"; +my $user_codespellfile =3D ""; =20 sub help { my ($exitcode) =3D @_; @@ -66,6 +69,9 @@ Options: is all off) --test-only=3DWORD report only warnings/errors containing WORD literally + --codespell Use the codespell dictionary for spelling/typ= os + (default: $codespellfile) + --codespellfile Use this codespell dictionary --color[=3DWHEN] Use colors 'always', 'never', or only when = output is a terminal ('auto'). Default is 'auto'. -h, --help, --version display this help and exit @@ -85,28 +91,50 @@ foreach (@ARGV) { } =20 GetOptions( - 'q|quiet+' =3D> \$quiet, - 'tree!' =3D> \$tree, - 'signoff!' =3D> \$chk_signoff, - 'patch!' =3D> \$chk_patch, - 'branch!' =3D> \$chk_branch, - 'emacs!' =3D> \$emacs, - 'terse!' =3D> \$terse, - 'f|file!' =3D> \$file, - 'strict!' =3D> \$no_warnings, - 'root=3Ds' =3D> \$root, - 'summary!' =3D> \$summary, - 'mailback!' =3D> \$mailback, - 'summary-file!' =3D> \$summary_file, - - 'debug=3Ds' =3D> \%debug, - 'test-only=3Ds' =3D> \$tst_only, - 'color=3Ds' =3D> \$color, - 'no-color' =3D> sub { $color =3D 'never'; }, - 'h|help' =3D> \$help, - 'version' =3D> \$help + 'q|quiet+' =3D> \$quiet, + 'tree!' =3D> \$tree, + 'signoff!' =3D> \$chk_signoff, + 'patch!' =3D> \$chk_patch, + 'branch!' =3D> \$chk_branch, + 'emacs!' =3D> \$emacs, + 'terse!' =3D> \$terse, + 'f|file!' =3D> \$file, + 'strict!' =3D> \$no_warnings, + 'root=3Ds' =3D> \$root, + 'summary!' =3D> \$summary, + 'mailback!' =3D> \$mailback, + 'summary-file!' =3D> \$summary_file, + 'debug=3Ds' =3D> \%debug, + 'test-only=3Ds' =3D> \$tst_only, + 'codespell!' =3D> \$codespell, + 'codespellfile=3Ds' =3D> \$user_codespellfile, + 'color=3Ds' =3D> \$color, + 'no-color' =3D> sub { $color =3D 'never'; }, + 'h|help' =3D> \$help, + 'version' =3D> \$help ) or help(1); =20 +if ($user_codespellfile) { + # Use the user provided codespell file unconditionally + $codespellfile =3D $user_codespellfile; +} elsif (!(-f $codespellfile)) { + # If /usr/share/codespell/dictionary.txt is not present, try to find it + # under codespell's install directory: /data/dictionary.t= xt + if (($codespell || $help) && which("python3") ne "") { + my $python_codespell_dict =3D << "EOF"; + +import os.path as op +import codespell_lib +codespell_dir =3D op.dirname(codespell_lib.__file__) +codespell_file =3D op.join(codespell_dir, 'data', 'dictionary.txt') +print(codespell_file, end=3D'') +EOF + + my $codespell_dict =3D `python3 -c "$python_codespell_dict" 2> /dev/null= `; + $codespellfile =3D $codespell_dict if (-f $codespell_dict); + } +} + help(0) if ($help); =20 my $exit =3D 0; @@ -337,6 +365,36 @@ our @typeList =3D ( qr{guintptr}, ); =20 +# Load common spelling mistakes and build regular expression list. +my $misspellings; +my %spelling_fix; + +if ($codespell) { + if (open(my $spelling, '<', $codespellfile)) { + while (<$spelling>) { + my $line =3D $_; + + $line =3D~ s/\s*\n?$//g; + $line =3D~ s/^\s*//g; + + next if ($line =3D~ m/^\s*#/); + next if ($line =3D~ m/^\s*$/); + next if ($line =3D~ m/, disabled/i); + + $line =3D~ s/,.*$//; + + my ($suspect, $fix) =3D split(/->/, $line); + + $spelling_fix{$suspect} =3D $fix; + } + close($spelling); + } else { + warn "No codespell typos will be found - file '$codespellfile': $!\n"; + } +} + +$misspellings =3D join("|", sort keys %spelling_fix) if keys %spelling_fix; + # This can be modified by sub possible. Since it can be empty, be careful # about regexes that always match, because they can cause infinite loops. our @modifierList =3D ( @@ -477,6 +535,18 @@ sub top_of_kernel_tree { return 1; } =20 +sub which { + my ($bin) =3D @_; + + foreach my $path (split(/:/, $ENV{PATH})) { + if (-e "$path/$bin") { + return "$path/$bin"; + } + } + + return ""; +} + sub expand_tabs { my ($str) =3D @_; =20 @@ -1585,6 +1655,21 @@ sub process { WARN("8-bit UTF-8 used in possible commit log\n" . $herecurr); } =20 +# Check for various typo / spelling mistakes + if (defined($misspellings) && + ($in_commit_log || $line =3D~ /^(?:\+|Subject:)/i)) { + while ($rawline =3D~ /(?:^|[^\w\-'`])($misspellings)(?:[^\w\-'`]|$)/gi)= { + my $typo =3D $1; + my $blank =3D copy_spacing($rawline); + my $ptr =3D substr($blank, 0, $-[1]) . "^" x length($typo); + my $hereptr =3D "$hereline$ptr\n"; + my $typo_fix =3D $spelling_fix{lc($typo)}; + $typo_fix =3D ucfirst($typo_fix) if ($typo =3D~ /^[A-Z]/); + $typo_fix =3D uc($typo_fix) if ($typo =3D~ /^[A-Z]+$/); + WARN("'$typo' may be misspelled - perhaps '$typo_fix'?\n" . $hereptr); + } + } + # ignore non-hunk lines and lines being removed next if (!$hunk_line || $line =3D~ /^-/); =20 --=20 2.43.0 From nobody Sat Sep 21 05:30:35 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1704992578; cv=none; d=zohomail.com; s=zohoarc; b=L4v3dy+KlBTAg4PlxWkQQhwaFqX0mAzt0QH4j7EJ5XlTy5LEy22KgQjHfZKm5oZzTw8+HM7Yt1G/ByoFD1B9Sg4aiIcmm6sM2i4o1j5HDeEI+7t91S0UyLKe+FkwAWZibYdO82y97eMQ9RG6risyDwGRGvXuDfQgs/pjICrcYVo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704992578; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=KAecuWwwe+7NT0YPT7Lurh8itBA8a8GTdMIrXfRNoUs=; b=C8SA1xdlIfup6/KWBkWUH0U9JS1d4gOF0e76qSmPXbsbF1KUhtprgs3wVOtZzmh498PF8etNhEOffG8ZuiOUky68qmqVjNKE6LYl7zohgVT7MBBpJ18WHfxVktBYxHCyCInIG8dEXQVA74Mq+a5mb0k0Clyrtn/0M/AdAe1+w5Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704992578653511.409842749581; Thu, 11 Jan 2024 09:02:58 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rNyQn-0004Bn-34; Thu, 11 Jan 2024 12:01:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rNyQl-0004A2-1U for qemu-devel@nongnu.org; Thu, 11 Jan 2024 12:01:23 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rNyQj-0003qF-4J for qemu-devel@nongnu.org; Thu, 11 Jan 2024 12:01:22 -0500 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-348-lYl5-zwTPAqSBAvpeuRh7Q-1; Thu, 11 Jan 2024 12:01:19 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 99BB228AC1C3; Thu, 11 Jan 2024 17:01:18 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.197]) by smtp.corp.redhat.com (Postfix) with ESMTP id 437A651D5; Thu, 11 Jan 2024 17:01:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704992480; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KAecuWwwe+7NT0YPT7Lurh8itBA8a8GTdMIrXfRNoUs=; b=ZiVbxPqUIic1qmSYBNZN4wgQu7ouWwwN2yo+6guKfejkx5TUCgsJ8O88oU33+euRr7Jvhh 05nDwEcOD1M0HjVV9G1FBes1H0+QN+9BFOZS+2tcRLpxbU6JECfbJ/m9k06rYqEkUSAY52 wJYEEW/i4ostSAqUhiQyMYXvSSsxNjY= X-MC-Unique: lYl5-zwTPAqSBAvpeuRh7Q-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell , Ilya Leoshkevich , Ido Plat , qemu-stable@nongnu.org, David Hildenbrand Subject: [PULL 15/17] target/s390x: Fix LAE setting a wrong access register Date: Thu, 11 Jan 2024 18:00:44 +0100 Message-ID: <20240111170047.909117-16-thuth@redhat.com> In-Reply-To: <20240111170047.909117-1-thuth@redhat.com> References: <20240111170047.909117-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -45 X-Spam_score: -4.6 X-Spam_bar: ---- X-Spam_report: (-4.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.467, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1704992580695100003 Content-Type: text/plain; charset="utf-8" From: Ilya Leoshkevich LAE should set the access register corresponding to the first operand, instead, it always modifies access register 1. Co-developed-by: Ido Plat Cc: qemu-stable@nongnu.org Fixes: a1c7610a6879 ("target-s390x: implement LAY and LAEY instructions") Reviewed-by: David Hildenbrand Signed-off-by: Ilya Leoshkevich Message-ID: <20240111092328.929421-2-iii@linux.ibm.com> Signed-off-by: Thomas Huth --- target/s390x/tcg/translate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index 62ab2be8b1..8df00b7df9 100644 --- a/target/s390x/tcg/translate.c +++ b/target/s390x/tcg/translate.c @@ -3221,6 +3221,7 @@ static DisasJumpType op_mov2e(DisasContext *s, DisasO= ps *o) { int b2 =3D get_field(s, b2); TCGv ar1 =3D tcg_temp_new_i64(); + int r1 =3D get_field(s, r1); =20 o->out =3D o->in2; o->in2 =3D NULL; @@ -3244,7 +3245,7 @@ static DisasJumpType op_mov2e(DisasContext *s, DisasO= ps *o) break; } =20 - tcg_gen_st32_i64(ar1, tcg_env, offsetof(CPUS390XState, aregs[1])); + tcg_gen_st32_i64(ar1, tcg_env, offsetof(CPUS390XState, aregs[r1])); return DISAS_NEXT; } =20 --=20 2.43.0 From nobody Sat Sep 21 05:30:35 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1704992553; cv=none; d=zohomail.com; s=zohoarc; b=jlTUvgqqdQ72S5X5vyBEagUe0PRiM3SnWGkFxYzR9lCUGNUFMBek424DOwe+wo0GEGTtdRxhiRdEOi7kWiRix6OMU0Zux88oup9MAs8ckPfw8FpJQ5ScO/pB9LWIIEdoPC+NqDjgOznbBx1l6LYb4L2p6mxbFAKlc+Blm//1/8w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704992553; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=fQad4yDRCpcNWWrgW2CP+Bi/GxO2s1Bcd/pkAeD9COM=; b=ewtB9sWxb+3ECM0LsaoXCbh3IcAAxcWG8m4Ma8qti28SE52nENhwO0Nr3Ta9y5BFs0cCxzYXE3i2l7cu/765w5cORzg1KcKXtcxF+hzlBdxUivs7IVr8jFgMOpL1HO0ZuQ5IB0C5FwQ3gTGYYAVdnu3k4G7KuM0pxlJjY/TS86Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704992553205415.06073639695467; Thu, 11 Jan 2024 09:02:33 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rNyQr-0004Ey-Gi; Thu, 11 Jan 2024 12:01:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rNyQo-0004Cc-NE for qemu-devel@nongnu.org; Thu, 11 Jan 2024 12:01:26 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rNyQn-0003tO-5u for qemu-devel@nongnu.org; Thu, 11 Jan 2024 12:01:26 -0500 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-604-37hoxWSQN8aL8lJewkfdPA-1; Thu, 11 Jan 2024 12:01:21 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A17AF3C0F37C; Thu, 11 Jan 2024 17:01:20 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.197]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4B47251D5; Thu, 11 Jan 2024 17:01:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704992484; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fQad4yDRCpcNWWrgW2CP+Bi/GxO2s1Bcd/pkAeD9COM=; b=GbI+7sl2ykErZ+Spwb4FA3QXCV63MrjlZIbFeMNC++cyjDBXOZTyDvkH0BLqD+Sz9UmVlC EznQyGJOmBTp7umYAOPQwtSqvX8zql1m8Jwqv04p+uKTSNIEGwWTkcWNHbBowKwSOG0YNs rGwtvFlhfpZJgLYWvBHcF+szegYHt4g= X-MC-Unique: 37hoxWSQN8aL8lJewkfdPA-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell , Ilya Leoshkevich Subject: [PULL 16/17] tests/tcg/s390x: Test LOAD ADDRESS EXTENDED Date: Thu, 11 Jan 2024 18:00:45 +0100 Message-ID: <20240111170047.909117-17-thuth@redhat.com> In-Reply-To: <20240111170047.909117-1-thuth@redhat.com> References: <20240111170047.909117-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -45 X-Spam_score: -4.6 X-Spam_bar: ---- X-Spam_report: (-4.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.467, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1704992554654100005 Content-Type: text/plain; charset="utf-8" From: Ilya Leoshkevich Add a small test to prevent regressions. Userspace runs in primary mode, so LAE should always set the access register to 0. Signed-off-by: Ilya Leoshkevich Message-ID: <20240111092328.929421-3-iii@linux.ibm.com> Reviewed-by: Thomas Huth Signed-off-by: Thomas Huth --- tests/tcg/s390x/lae.c | 31 +++++++++++++++++++++++++++++++ tests/tcg/s390x/Makefile.target | 1 + 2 files changed, 32 insertions(+) create mode 100644 tests/tcg/s390x/lae.c diff --git a/tests/tcg/s390x/lae.c b/tests/tcg/s390x/lae.c new file mode 100644 index 0000000000..59712b5e37 --- /dev/null +++ b/tests/tcg/s390x/lae.c @@ -0,0 +1,31 @@ +/* + * Test the LOAD ADDRESS EXTENDED instruction. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ +#include +#include + +int main(void) +{ + unsigned long long ar =3D -1, b2 =3D 100000, r, x2 =3D 500; + /* + * Hardcode the register number, since clang does not allow using %rN = in + * place of %aN. + */ + register unsigned long long r2 __asm__("2"); + int tmp; + + asm("ear %[tmp],%%a2\n" + "lae %%r2,42(%[x2],%[b2])\n" + "ear %[ar],%%a2\n" + "sar %%a2,%[tmp]" + : [tmp] "=3D&r" (tmp), "=3D&r" (r2), [ar] "+r" (ar) + : [b2] "r" (b2), [x2] "r" (x2) + : "memory"); + r =3D r2; + assert(ar =3D=3D 0xffffffff00000000ULL); + assert(r =3D=3D 100542); + + return EXIT_SUCCESS; +} diff --git a/tests/tcg/s390x/Makefile.target b/tests/tcg/s390x/Makefile.tar= get index 0e670f3f8b..30994dcf9c 100644 --- a/tests/tcg/s390x/Makefile.target +++ b/tests/tcg/s390x/Makefile.target @@ -44,6 +44,7 @@ TESTS+=3Dclgebr TESTS+=3Dclc TESTS+=3Dlaalg TESTS+=3Dadd-logical-with-carry +TESTS+=3Dlae =20 cdsg: CFLAGS+=3D-pthread cdsg: LDFLAGS+=3D-pthread --=20 2.43.0 From nobody Sat Sep 21 05:30:35 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1704992749; cv=none; d=zohomail.com; s=zohoarc; b=B58SVmFq1IDauhZqa2k2tz91RAD/aiUc49XjZ5WD9LsCXze3XXZn3IbsE2cvJJJ7jiEeHmlFUSs3g6takZ1m5KBKSWlEysYn67Va/gobJhBOM5OEY0uQbEY4a9gaft7537l+lmVhTjIveDy2jv6nTRUdBbY1RqtlEgD1GJxhzv0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704992749; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=x7bJLYPkgCLStrFZA04nKxsfUZ5MnQeev1D/E3CGlcc=; b=GD7k3Bb+aboMKY/405WN68yeBHUl0tNciaSGQN+MKm6Mmc/kXiTYjak9T2cWYymbGeuFm34fk3TNnyV3kTZFITYAx+RGYv2IL9e9XwKc8COjL9exLtvRb5NoPAt+lqmTOrkpS8O8mI8P08OvluIqk10xXEsxWlidPPInSjl7G9U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704992749820244.37433239556196; Thu, 11 Jan 2024 09:05:49 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rNyQv-0004ID-3w; Thu, 11 Jan 2024 12:01:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rNyQt-0004Fw-KS for qemu-devel@nongnu.org; Thu, 11 Jan 2024 12:01:31 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rNyQr-0003wu-T3 for qemu-devel@nongnu.org; Thu, 11 Jan 2024 12:01:31 -0500 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-606-ODzi9SDUPyeZyISryD1o7Q-1; Thu, 11 Jan 2024 12:01:22 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EA0E43816B60; Thu, 11 Jan 2024 17:01:21 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.197]) by smtp.corp.redhat.com (Postfix) with ESMTP id E409B51D5; Thu, 11 Jan 2024 17:01:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704992489; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=x7bJLYPkgCLStrFZA04nKxsfUZ5MnQeev1D/E3CGlcc=; b=D/Fm8oaDWaSQKxKNQro9jHLdPIa1obSMlxl3BJx+qmzNewMtibXuTM9Ms8AfQ3BdEsblaj UKtL+pYIXpdmWGqxc7fXTBo1Fb5WCg2PDjIXVt+3+WjSdLAGh4Mlq81xddcBnynT0UX5dx ZzkwpN7Sw0Tc8qe/tUgcYlU8kVu6JIU= X-MC-Unique: ODzi9SDUPyeZyISryD1o7Q-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-stable@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 17/17] .gitlab-ci.d/buildtest.yml: Work around htags bug when environment is large Date: Thu, 11 Jan 2024 18:00:46 +0100 Message-ID: <20240111170047.909117-18-thuth@redhat.com> In-Reply-To: <20240111170047.909117-1-thuth@redhat.com> References: <20240111170047.909117-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -45 X-Spam_score: -4.6 X-Spam_bar: ---- X-Spam_report: (-4.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.467, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1704992751661100003 From: Peter Maydell Sometimes the CI "pages" job fails with a message like this from htags: $ htags -anT --tree-view=3Dfiletree -m qemu_init -t "Welcome to the QEMU so= urcecode" htags: Negative exec line limit =3D -371 This is due to a bug in hflags where if the environment is too large it falls over: https://lists.gnu.org/archive/html/bug-global/2024-01/msg00000.html This happens to us because GitLab CI puts the commit message of the commit under test into the CI_COMMIT_MESSAGE and/or CI_COMMIT_TAG_MESSAGE environment variables, so the job will fail if the commit happens to have a verbose commit message. Work around the htags bug by unsetting these variables while running htags. Cc: qemu-stable@nongnu.org Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2080 Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20240111125543.1573473-1-peter.maydell@linaro.org> Signed-off-by: Thomas Huth --- .gitlab-ci.d/buildtest.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml index cfe737aca2..9b4df24e9a 100644 --- a/.gitlab-ci.d/buildtest.yml +++ b/.gitlab-ci.d/buildtest.yml @@ -647,7 +647,10 @@ pages: - mkdir -p public # HTML-ised source tree - make gtags - - htags -anT --tree-view=3Dfiletree -m qemu_init + # We unset variables to work around a bug in some htags versions + # which causes it to fail when the environment is large + - CI_COMMIT_MESSAGE=3D CI_COMMIT_TAG_MESSAGE=3D htags + -anT --tree-view=3Dfiletree -m qemu_init -t "Welcome to the QEMU sourcecode" - mv HTML public/src # Project documentation --=20 2.43.0