From nobody Mon Sep 16 19:12:21 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1719220328; cv=none; d=zohomail.com; s=zohoarc; b=RvI7PiAhlD1dXlV5vMtFGDGIoJkeaPXpsL3gYnIqgStJlACdT2S8Q5VfO0OXqj+iaI7geHqBzj4HtcvrmoR4dQ6HYdv5MXbe9GXW1FWPPrhNmug7HWgoRWntK5vbgk5ECluIr9F64UYFWRxfleObxoBdmL8jk0VUFTrf9b9+WCM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719220328; 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=0MEH/mKV63v/JJwnQ03ODMnT7oVBF8nDVD2HElTki68=; b=ElPziJYGL7mPfiL6b/oCGFE3lnskGazpJv7dYrae9O+geO6OOEBIPlsPCFhrlfBWz8yhw9dZM1+4yHkHB3IS27O5qHDK7W1hy/Z3mmBitmlWxww6f/nph/va9YqKPxTW+hBq30u2xvJ83TeP3HCAJ1C7ObLQnjZKmnlo4hQYAk0= 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+importer2=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 1719220328576514.6917673744415; Mon, 24 Jun 2024 02:12:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sLfj2-0007uQ-8t; Mon, 24 Jun 2024 05:11:00 -0400 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 1sLfj0-0007uH-UU for qemu-devel@nongnu.org; Mon, 24 Jun 2024 05:10:59 -0400 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 1sLfix-0003rn-78 for qemu-devel@nongnu.org; Mon, 24 Jun 2024 05:10:58 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-300-ZyPEeIplM-2XMuSsTDoVgg-1; Mon, 24 Jun 2024 05:10:51 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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 mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8B6E61956056; Mon, 24 Jun 2024 09:10:50 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.193.33]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 2C38A3000603; Mon, 24 Jun 2024 09:10:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719220254; 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=0MEH/mKV63v/JJwnQ03ODMnT7oVBF8nDVD2HElTki68=; b=AvWuCeqXGnVBr9aaVe1l3Hx8oiri2cORBVDuZv6583AhOA1Eo6shkp9lFtyp0HAi2+3+dv SceS8J8VH5gzGNTgkBYOPtgSeFHjMhNHBoGfoKN1UoiD5Z4jePX6SMAX3NEPZwbO1t+APv zkrKPe6TGaTI9Z9zJ+oUM9eUbRI/m+Q= X-MC-Unique: ZyPEeIplM-2XMuSsTDoVgg-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Zhenzhong Duan , Anthony Krowiak , Eric Farman Subject: [PULL 01/11] hw/s390x/ccw: Make s390_ccw_get_dev_info() return a bool Date: Mon, 24 Jun 2024 11:10:33 +0200 Message-ID: <20240624091043.177484-2-thuth@redhat.com> In-Reply-To: <20240624091043.177484-1-thuth@redhat.com> References: <20240624091043.177484-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.30.177.4 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+importer2=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: 11 X-Spam_score: 1.1 X-Spam_bar: + X-Spam_report: (1.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.149, 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.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1719220329408100003 From: C=C3=A9dric Le Goater Since s390_ccw_get_dev_info() takes an 'Error **' argument, best practices suggest to return a bool. See the qapi/error.h Rules section. While at it, modify the call in s390_ccw_realize(). Signed-off-by: C=C3=A9dric Le Goater Reviewed-by: Zhenzhong Duan Reviewed-by: Anthony Krowiak Reviewed-by: Eric Farman Reviewed-by: Thomas Huth Message-ID: <20240522170107.289532-2-clg@redhat.com> Signed-off-by: Thomas Huth --- hw/s390x/s390-ccw.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/s390x/s390-ccw.c b/hw/s390x/s390-ccw.c index 5261e66724..a06e91dfb3 100644 --- a/hw/s390x/s390-ccw.c +++ b/hw/s390x/s390-ccw.c @@ -71,7 +71,7 @@ IOInstEnding s390_ccw_store(SubchDev *sch) return ret; } =20 -static void s390_ccw_get_dev_info(S390CCWDevice *cdev, +static bool s390_ccw_get_dev_info(S390CCWDevice *cdev, char *sysfsdev, Error **errp) { @@ -84,12 +84,12 @@ static void s390_ccw_get_dev_info(S390CCWDevice *cdev, error_setg(errp, "No host device provided"); error_append_hint(errp, "Use -device vfio-ccw,sysfsdev=3DPATH_TO_DEVICE\= n"); - return; + return false; } =20 if (!realpath(sysfsdev, dev_path)) { error_setg_errno(errp, errno, "Host device '%s' not found", sysfsd= ev); - return; + return false; } =20 cdev->mdevid =3D g_path_get_basename(dev_path); @@ -98,13 +98,14 @@ static void s390_ccw_get_dev_info(S390CCWDevice *cdev, 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; + return false; } =20 cdev->hostid.cssid =3D cssid; cdev->hostid.ssid =3D ssid; cdev->hostid.devid =3D devid; cdev->hostid.valid =3D true; + return true; } =20 static void s390_ccw_realize(S390CCWDevice *cdev, char *sysfsdev, Error **= errp) @@ -116,8 +117,7 @@ static void s390_ccw_realize(S390CCWDevice *cdev, char = *sysfsdev, Error **errp) int ret; Error *err =3D NULL; =20 - s390_ccw_get_dev_info(cdev, sysfsdev, &err); - if (err) { + if (!s390_ccw_get_dev_info(cdev, sysfsdev, &err)) { goto out_err_propagate; } =20 --=20 2.45.2 From nobody Mon Sep 16 19:12:21 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1719220337; cv=none; d=zohomail.com; s=zohoarc; b=BupAsaKcK0xIOvUuusfmhQxSNbswNjyP9w4KcG3LaamN6tuT7panW4MbijCggw8TCGv9FyS+k8xBPsh01qlWOJ8ZIQqUR4Dt0qyBwTwRnbBciOP+SJwVMaffOBiqOTBe7fiH27A5owZ1CM8z1WJpJidm/LfwRo9sGhl9GtJCOCE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719220337; 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=+4megXEFudFNidDu6usxu59kkO19OEawrxjQOAqZvUk=; b=cBq+ltmdWasAyaC53YDeqe8qHFU/oPR4HJlO1ZY/XOfDV+uJLjjxJ48dii9Dt2jKhFXFS2H4X6N4UW0vxbAY+jIsh9B3NkNwvozJRp+qUJ7G+zetNnHR60mdIEio+kC+Fh4HMHOPedtoKpKrUUWekwA058IshUA3wq9zHoWtLzA= 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+importer2=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 1719220337215641.5899581217518; Mon, 24 Jun 2024 02:12:17 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sLfj8-0007w4-Ef; Mon, 24 Jun 2024 05:11:06 -0400 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 1sLfj5-0007v3-A1 for qemu-devel@nongnu.org; Mon, 24 Jun 2024 05:11:03 -0400 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 1sLfj3-0003s5-Kd for qemu-devel@nongnu.org; Mon, 24 Jun 2024 05:11:03 -0400 Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-496-1rP4PcvANlm60yjG_2QYJg-1; Mon, 24 Jun 2024 05:10:55 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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 mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0592E19560A2; Mon, 24 Jun 2024 09:10:54 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.193.33]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D47A83000219; Mon, 24 Jun 2024 09:10:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719220259; 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=+4megXEFudFNidDu6usxu59kkO19OEawrxjQOAqZvUk=; b=YKXP9eV9cZalEUMOOZXWPf4QvloANLhEEbQXkW3GTKh01hRUgOqwGWryHMPtEjtkBuR1nm yiW0hr+Uzsb576y92LuEV54hmCB+Jf6LRsq3oamln6YCTkLvd7dhk8xh/lCHqkXLoeiOmU 7IPzvWt+rZH8PPoHvStjlQcvOrHyJ0A= X-MC-Unique: 1rP4PcvANlm60yjG_2QYJg-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Zhenzhong Duan , Anthony Krowiak , Eric Farman Subject: [PULL 02/11] s390x/css: Make CCWDeviceClass::realize return bool Date: Mon, 24 Jun 2024 11:10:34 +0200 Message-ID: <20240624091043.177484-3-thuth@redhat.com> In-Reply-To: <20240624091043.177484-1-thuth@redhat.com> References: <20240624091043.177484-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.30.177.4 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+importer2=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: 11 X-Spam_score: 1.1 X-Spam_bar: + X-Spam_report: (1.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.149, 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.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1719220337483100005 From: C=C3=A9dric Le Goater Since the realize() handler of CCWDeviceClass takes an 'Error **' argument, best practices suggest to return a bool. See the api/error.h Rules section. While at it, modify the call in s390_ccw_realize(). Signed-off-by: C=C3=A9dric Le Goater Reviewed-by: Zhenzhong Duan Reviewed-by: Anthony Krowiak Reviewed-by: Eric Farman Reviewed-by: Thomas Huth Message-ID: <20240522170107.289532-3-clg@redhat.com> Signed-off-by: Thomas Huth --- hw/s390x/ccw-device.h | 2 +- hw/s390x/ccw-device.c | 3 ++- hw/s390x/s390-ccw.c | 3 +-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/s390x/ccw-device.h b/hw/s390x/ccw-device.h index 6dff95225d..5feeb0ee7a 100644 --- a/hw/s390x/ccw-device.h +++ b/hw/s390x/ccw-device.h @@ -36,7 +36,7 @@ extern const VMStateDescription vmstate_ccw_dev; struct CCWDeviceClass { DeviceClass parent_class; void (*unplug)(HotplugHandler *, DeviceState *, Error **); - void (*realize)(CcwDevice *, Error **); + bool (*realize)(CcwDevice *, Error **); void (*refill_ids)(CcwDevice *); }; =20 diff --git a/hw/s390x/ccw-device.c b/hw/s390x/ccw-device.c index fb8c1acc64..a7d682e5af 100644 --- a/hw/s390x/ccw-device.c +++ b/hw/s390x/ccw-device.c @@ -31,9 +31,10 @@ static void ccw_device_refill_ids(CcwDevice *dev) dev->subch_id.valid =3D true; } =20 -static void ccw_device_realize(CcwDevice *dev, Error **errp) +static bool ccw_device_realize(CcwDevice *dev, Error **errp) { ccw_device_refill_ids(dev); + return true; } =20 static Property ccw_device_properties[] =3D { diff --git a/hw/s390x/s390-ccw.c b/hw/s390x/s390-ccw.c index a06e91dfb3..4b8ede701d 100644 --- a/hw/s390x/s390-ccw.c +++ b/hw/s390x/s390-ccw.c @@ -137,8 +137,7 @@ static void s390_ccw_realize(S390CCWDevice *cdev, char = *sysfsdev, Error **errp) goto out_err; } =20 - ck->realize(ccw_dev, &err); - if (err) { + if (!ck->realize(ccw_dev, &err)) { goto out_err; } =20 --=20 2.45.2 From nobody Mon Sep 16 19:12:21 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1719220361; cv=none; d=zohomail.com; s=zohoarc; b=C6A1+0+Z9bS5vQwL4rJ+RGOwQMpl1OoaF4c4RQRYdcCOPSFKNeh7FPpsArjTxGJ68D/sa8gh2c5iF+R2ucCRhDvVl3axydXsp2LvvLRtaKw2knyDZRuPk0aY3WoCIyZfWZO+YO6DpCkYDVZfZpl94hKjQQjJgPnxeKaz2MfjjgU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719220361; 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=+1v+7D4EiyD7M+nQxR3WsvAByd+Ga93rHD+GWWIFd1k=; b=BTjut/5IaKqT5ka8fCe88fTNgjSOcg8dlvy5m/YkZUOTqkya3F+swH5T559XiVj1nByuXnKMH4N8VtTMHsYyjf0wTumInWbcqIunHboEFm0dDeQZI7nUQY75vWnsC8mnTv5Z+nV54eQOrUmK/HZSYkqz0/OWZ97ZWdMAI3MDv1E= 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+importer2=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 171922036177314.68689811879301; Mon, 24 Jun 2024 02:12:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sLfjT-0007yE-Q3; Mon, 24 Jun 2024 05:11:27 -0400 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 1sLfjS-0007xp-50 for qemu-devel@nongnu.org; Mon, 24 Jun 2024 05:11:26 -0400 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 1sLfjE-0003sV-1K for qemu-devel@nongnu.org; Mon, 24 Jun 2024 05:11:25 -0400 Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-158-lFWznw1EMYyqunFt60F5eQ-1; Mon, 24 Jun 2024 05:10:59 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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 mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7606B19560BE; Mon, 24 Jun 2024 09:10:57 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.193.33]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E5AC53000227; Mon, 24 Jun 2024 09:10:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719220268; 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=+1v+7D4EiyD7M+nQxR3WsvAByd+Ga93rHD+GWWIFd1k=; b=XS3Rbv22cGPZDRuK+QD4QTc3BJfCmSfz3J7gG/ezMppoOQ86qZuv17m5MNSOszU5iP6Usa grx8fHBezq/8dWv2PLjXLQJZlqvhNrsBxavhHnLwnmLtTe8FWz1FQlFiHYFm+pBqpEGpUq y8xxFxYpUb5EDAL3R7Dfe8jikQrwok4= X-MC-Unique: lFWznw1EMYyqunFt60F5eQ-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Zhenzhong Duan , Anthony Krowiak , Eric Farman Subject: [PULL 03/11] hw/s390x/ccw: Remove local Error variable from s390_ccw_realize() Date: Mon, 24 Jun 2024 11:10:35 +0200 Message-ID: <20240624091043.177484-4-thuth@redhat.com> In-Reply-To: <20240624091043.177484-1-thuth@redhat.com> References: <20240624091043.177484-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.30.177.4 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+importer2=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: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.149, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1719220363599100006 From: C=C3=A9dric Le Goater Use the 'Error **errp' argument of s390_ccw_realize() instead and remove the error_propagate() call. Signed-off-by: C=C3=A9dric Le Goater Reviewed-by: Zhenzhong Duan Reviewed-by: Anthony Krowiak Reviewed-by: Eric Farman Reviewed-by: Thomas Huth Message-ID: <20240522170107.289532-4-clg@redhat.com> Signed-off-by: Thomas Huth --- hw/s390x/s390-ccw.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/hw/s390x/s390-ccw.c b/hw/s390x/s390-ccw.c index 4b8ede701d..b3d14c61d7 100644 --- a/hw/s390x/s390-ccw.c +++ b/hw/s390x/s390-ccw.c @@ -115,13 +115,12 @@ static void s390_ccw_realize(S390CCWDevice *cdev, cha= r *sysfsdev, Error **errp) DeviceState *parent =3D DEVICE(ccw_dev); SubchDev *sch; int ret; - Error *err =3D NULL; =20 - if (!s390_ccw_get_dev_info(cdev, sysfsdev, &err)) { - goto out_err_propagate; + if (!s390_ccw_get_dev_info(cdev, sysfsdev, errp)) { + return; } =20 - sch =3D css_create_sch(ccw_dev->devno, &err); + sch =3D css_create_sch(ccw_dev->devno, errp); if (!sch) { goto out_mdevid_free; } @@ -132,12 +131,12 @@ static void s390_ccw_realize(S390CCWDevice *cdev, cha= r *sysfsdev, Error **errp) ccw_dev->sch =3D sch; ret =3D css_sch_build_schib(sch, &cdev->hostid); if (ret) { - error_setg_errno(&err, -ret, "%s: Failed to build initial schib", + error_setg_errno(errp, -ret, "%s: Failed to build initial schib", __func__); goto out_err; } =20 - if (!ck->realize(ccw_dev, &err)) { + if (!ck->realize(ccw_dev, errp)) { goto out_err; } =20 @@ -151,8 +150,6 @@ out_err: g_free(sch); out_mdevid_free: g_free(cdev->mdevid); -out_err_propagate: - error_propagate(errp, err); } =20 static void s390_ccw_unrealize(S390CCWDevice *cdev) --=20 2.45.2 From nobody Mon Sep 16 19:12:21 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1719220373; cv=none; d=zohomail.com; s=zohoarc; b=XuMobXjJS0q8ijaPJBqnagyvyd8fib/2YsmPNmdNcMbKWVKYFGHcT7jIu3yVWs916+LRB2a5s0joMZ95C2/cmJ6pySM1cWXVhJ6U+tnz4aeNLPY8ov4J4alK6F6lBX5GYJSPKLThnSuY4cLrztfnBDHMZyXnomxE9mMES/FrncA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719220373; 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=s1/JShl0HA5iIO/ldYs3XyH7C9qq8BP88fI07ymd6mI=; b=PkqeCrrgueodWE/3UQravEfXmwhX4kj5oH9tLZqvm5ANXcdwFMUvJLOCDqHGy/tupFA29oDQVPNM7vbIloo6GTkHe9lhh8NBkG+9gNEzKU2A5cNI1ZYRNHNJdx0xiQU08HHs7k/MpGyEs9xfUucjh24sqc05lCcWD2WPhokhOBc= 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+importer2=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 1719220373466560.4722714284642; Mon, 24 Jun 2024 02:12:53 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sLfjJ-0007wd-4o; Mon, 24 Jun 2024 05:11:17 -0400 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 1sLfjH-0007wQ-Li for qemu-devel@nongnu.org; Mon, 24 Jun 2024 05:11:15 -0400 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 1sLfjA-0003sN-S3 for qemu-devel@nongnu.org; Mon, 24 Jun 2024 05:11:14 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-679-PGgbdl4zM4e_3SH_gKRCbw-1; Mon, 24 Jun 2024 05:11:02 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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 mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id AAE2C195605F; Mon, 24 Jun 2024 09:11:01 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.193.33]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 050773000618; Mon, 24 Jun 2024 09:10:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719220267; 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=s1/JShl0HA5iIO/ldYs3XyH7C9qq8BP88fI07ymd6mI=; b=HNwPI+GjTV1fCiOayb0j8BgGkPJDkWcGTnN7Ke4o7bTkQsIyRx1fawZ5DG2+DZVl3+e7CK pzkt60l0vPOcweXHEwepAraRHsnrP8xu+qYdt3cOk2MeWgYZ0VB7tEii3yBrh21a1seuAo OHbwZT82W9zT/r92rIC+wEHladJpmds= X-MC-Unique: PGgbdl4zM4e_3SH_gKRCbw-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Zhenzhong Duan , Anthony Krowiak , Eric Farman Subject: [PULL 04/11] s390x/css: Make S390CCWDeviceClass::realize return bool Date: Mon, 24 Jun 2024 11:10:36 +0200 Message-ID: <20240624091043.177484-5-thuth@redhat.com> In-Reply-To: <20240624091043.177484-1-thuth@redhat.com> References: <20240624091043.177484-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.30.177.4 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+importer2=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: 16 X-Spam_score: 1.6 X-Spam_bar: + X-Spam_report: (1.6 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1719220375642100003 From: C=C3=A9dric Le Goater Since the realize() handler of S390CCWDeviceClass takes an 'Error **' argument, best practices suggest to return a bool. See the api/error.h Rules section. While at it, modify the call in vfio_ccw_realize(). Signed-off-by: C=C3=A9dric Le Goater Reviewed-by: Zhenzhong Duan Reviewed-by: Anthony Krowiak Reviewed-by: Eric Farman Reviewed-by: Thomas Huth Message-ID: <20240522170107.289532-5-clg@redhat.com> Signed-off-by: Thomas Huth --- include/hw/s390x/s390-ccw.h | 2 +- hw/s390x/s390-ccw.c | 7 ++++--- hw/vfio/ccw.c | 3 +-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/hw/s390x/s390-ccw.h b/include/hw/s390x/s390-ccw.h index 2c807ee3a1..2e0a709981 100644 --- a/include/hw/s390x/s390-ccw.h +++ b/include/hw/s390x/s390-ccw.h @@ -31,7 +31,7 @@ struct S390CCWDevice { =20 struct S390CCWDeviceClass { CCWDeviceClass parent_class; - void (*realize)(S390CCWDevice *dev, char *sysfsdev, Error **errp); + bool (*realize)(S390CCWDevice *dev, char *sysfsdev, Error **errp); void (*unrealize)(S390CCWDevice *dev); IOInstEnding (*handle_request) (SubchDev *sch); int (*handle_halt) (SubchDev *sch); diff --git a/hw/s390x/s390-ccw.c b/hw/s390x/s390-ccw.c index b3d14c61d7..3c09750550 100644 --- a/hw/s390x/s390-ccw.c +++ b/hw/s390x/s390-ccw.c @@ -108,7 +108,7 @@ static bool s390_ccw_get_dev_info(S390CCWDevice *cdev, return true; } =20 -static void s390_ccw_realize(S390CCWDevice *cdev, char *sysfsdev, Error **= errp) +static bool s390_ccw_realize(S390CCWDevice *cdev, char *sysfsdev, Error **= errp) { CcwDevice *ccw_dev =3D CCW_DEVICE(cdev); CCWDeviceClass *ck =3D CCW_DEVICE_GET_CLASS(ccw_dev); @@ -117,7 +117,7 @@ static void s390_ccw_realize(S390CCWDevice *cdev, char = *sysfsdev, Error **errp) int ret; =20 if (!s390_ccw_get_dev_info(cdev, sysfsdev, errp)) { - return; + return false; } =20 sch =3D css_create_sch(ccw_dev->devno, errp); @@ -142,7 +142,7 @@ static void s390_ccw_realize(S390CCWDevice *cdev, char = *sysfsdev, Error **errp) =20 css_generate_sch_crws(sch->cssid, sch->ssid, sch->schid, parent->hotplugged, 1); - return; + return true; =20 out_err: css_subch_assign(sch->cssid, sch->ssid, sch->schid, sch->devno, NULL); @@ -150,6 +150,7 @@ out_err: g_free(sch); out_mdevid_free: g_free(cdev->mdevid); + return false; } =20 static void s390_ccw_unrealize(S390CCWDevice *cdev) diff --git a/hw/vfio/ccw.c b/hw/vfio/ccw.c index 2600e62e37..9a8e052711 100644 --- a/hw/vfio/ccw.c +++ b/hw/vfio/ccw.c @@ -582,8 +582,7 @@ static void vfio_ccw_realize(DeviceState *dev, Error **= errp) =20 /* Call the class init function for subchannel. */ if (cdc->realize) { - cdc->realize(cdev, vcdev->vdev.sysfsdev, &err); - if (err) { + if (!cdc->realize(cdev, vcdev->vdev.sysfsdev, &err)) { goto out_err_propagate; } } --=20 2.45.2 From nobody Mon Sep 16 19:12:21 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1719220328; cv=none; d=zohomail.com; s=zohoarc; b=SCG6qmfm++EFYMvanD/hNOAz68h5rm1Gjqu5txQr5U46HwcZlW6psYgag5+Z/Q3WnrJUmvRB61BrypIqP4hETiMkrQAjZrkPS0EYA/lI/Ohz2sicHhUmGfGwcyW0HNsC3m5fiQ5yN595O0NjGga8ZJbPyJEPtTXUzgPIAC5FpIc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719220328; 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=+ZCWoghW6mfWaxFSn5bGpDr/y6Xavj3Z3HJ9b2fqrd0=; b=ZZJV5VgJ3Y0J9KwH6WTQBhkLQAxtdYtSanT7W4QdX3oni8YQNFK87X45BxDCwHEc9ohdkXwwYXBRduECB3RUw6FowQwyGLaot+5QIh5Na4onnNOHU6bLzUBISxuL8XOA8Nk4pLHv/qLtd/+cqfoeK4i41hz/p4T4UZOf7UJvUUE= 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+importer2=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 1719220328601556.0365230154038; Mon, 24 Jun 2024 02:12:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sLfjS-0007y2-J3; Mon, 24 Jun 2024 05:11:27 -0400 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 1sLfjQ-0007x6-Kw for qemu-devel@nongnu.org; Mon, 24 Jun 2024 05:11:24 -0400 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 1sLfjE-0003se-OF for qemu-devel@nongnu.org; Mon, 24 Jun 2024 05:11:23 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-160-2uKoE2kGP_yokzTOi95mTQ-1; Mon, 24 Jun 2024 05:11:06 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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 mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B7D1D19560A3; Mon, 24 Jun 2024 09:11:05 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.193.33]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 98EA53000219; Mon, 24 Jun 2024 09:11:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719220270; 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=+ZCWoghW6mfWaxFSn5bGpDr/y6Xavj3Z3HJ9b2fqrd0=; b=F3Nlduz2akdcC1P2A9T52a2ljoFku65ZuPrPiOaUXoLL0QAmVcFdNbNBxxI11h0/x8Rn3E xv382IuAco9/I8WExHtREO65TtzDB4dSvbhWYb4sLmPx+jXp9FixDQ75sA/7PfRsTqVF0N LDUvHDuCIZa8qSGFnIJAGQDVvr4/Vpc= X-MC-Unique: 2uKoE2kGP_yokzTOi95mTQ-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Zhenzhong Duan , Anthony Krowiak , Eric Farman Subject: [PULL 05/11] vfio/ccw: Use the 'Error **errp' argument of vfio_ccw_realize() Date: Mon, 24 Jun 2024 11:10:37 +0200 Message-ID: <20240624091043.177484-6-thuth@redhat.com> In-Reply-To: <20240624091043.177484-1-thuth@redhat.com> References: <20240624091043.177484-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.30.177.4 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+importer2=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: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.149, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1719220329416100005 From: C=C3=A9dric Le Goater The local error variable is kept for vfio_ccw_register_irq_notifier() because it is not considered as a failing condition. We will change how error reporting is done in following changes. Remove the error_propagate() call. Cc: Zhenzhong Duan Signed-off-by: C=C3=A9dric Le Goater Reviewed-by: Zhenzhong Duan Reviewed-by: Anthony Krowiak Reviewed-by: Eric Farman Reviewed-by: Thomas Huth Message-ID: <20240522170107.289532-6-clg@redhat.com> Signed-off-by: Thomas Huth --- hw/vfio/ccw.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/hw/vfio/ccw.c b/hw/vfio/ccw.c index 9a8e052711..a468fa2342 100644 --- a/hw/vfio/ccw.c +++ b/hw/vfio/ccw.c @@ -582,8 +582,8 @@ static void vfio_ccw_realize(DeviceState *dev, Error **= errp) =20 /* Call the class init function for subchannel. */ if (cdc->realize) { - if (!cdc->realize(cdev, vcdev->vdev.sysfsdev, &err)) { - goto out_err_propagate; + if (!cdc->realize(cdev, vcdev->vdev.sysfsdev, errp)) { + return; } } =20 @@ -596,17 +596,17 @@ static void vfio_ccw_realize(DeviceState *dev, Error = **errp) goto out_attach_dev_err; } =20 - if (!vfio_ccw_get_region(vcdev, &err)) { + if (!vfio_ccw_get_region(vcdev, errp)) { goto out_region_err; } =20 - if (!vfio_ccw_register_irq_notifier(vcdev, VFIO_CCW_IO_IRQ_INDEX, &err= )) { + if (!vfio_ccw_register_irq_notifier(vcdev, VFIO_CCW_IO_IRQ_INDEX, errp= )) { goto out_io_notifier_err; } =20 if (vcdev->crw_region) { if (!vfio_ccw_register_irq_notifier(vcdev, VFIO_CCW_CRW_IRQ_INDEX, - &err)) { + errp)) { goto out_irq_notifier_err; } } @@ -634,8 +634,6 @@ out_attach_dev_err: if (cdc->unrealize) { cdc->unrealize(cdev); } -out_err_propagate: - error_propagate(errp, err); } =20 static void vfio_ccw_unrealize(DeviceState *dev) --=20 2.45.2 From nobody Mon Sep 16 19:12:21 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1719220343; cv=none; d=zohomail.com; s=zohoarc; b=NG8+K/G6HbCqGQgOAQ4WQYno1w8yB8wF1qK7HEG710piG3U74oAYIFjvmX26fVXJHcTnIVhixdgJ+fq0nef0fbiJwAuGQ8I6l1P8N1q7ayk9+5Qzs8+z0ZsjgjZ2p+NoriQHQnbSRUGGFlZ6rkY6d8Gx6dl4IXW5yIseIAvMiKs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719220343; 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=FCVAaabRcZXPoAk+LeXk+6xICyyYrMzvSRVahSssDlQ=; b=VwLjfxFvThFbMN5djNRbY/mEQeaShsc0IDdLB6tiEhb+NjgoukZrnAfCDVwkl1Uh0AnazrBrlAWhssq3Gi1bMpTN21vzbSi55ofiZTnaooZyruoTIUjypy5ymS0PGfKmaPhvpKfElH/gwO/DWeX7Bqu8XUaFl5W2GxDuDZbmrxI= 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+importer2=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 171922034318349.736051268882534; Mon, 24 Jun 2024 02:12:23 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sLfjS-0007xV-KE; Mon, 24 Jun 2024 05:11:26 -0400 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 1sLfjP-0007x7-V9 for qemu-devel@nongnu.org; Mon, 24 Jun 2024 05:11:24 -0400 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 1sLfjG-0003sw-JP for qemu-devel@nongnu.org; Mon, 24 Jun 2024 05:11:23 -0400 Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-637-1I7s2971MPydQ5g1EL_bpQ-1; Mon, 24 Jun 2024 05:11:09 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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 mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 727DC1955E72; Mon, 24 Jun 2024 09:11:08 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.193.33]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 2C2493000219; Mon, 24 Jun 2024 09:11:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719220273; 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=FCVAaabRcZXPoAk+LeXk+6xICyyYrMzvSRVahSssDlQ=; b=X6EQpX2Sy+9l6HaJ21fh8U/VE+u2VVYMe7+WATBExCuqaxnxmgmJ9chAEQN+7g5uB3KAkV fV4xW4E3P+bvWUh6WxwpywaE34bhZD9R0jCg5QjKiOXcufXEswksajkmBu0uYYW+HIr1PD fgrNGbwaCfNW207+nUqJfps/bvn9rY0= X-MC-Unique: 1I7s2971MPydQ5g1EL_bpQ-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: Zhenzhong Duan , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Eric Farman Subject: [PULL 06/11] vfio/ccw: Fix the missed unrealize() call in error path Date: Mon, 24 Jun 2024 11:10:38 +0200 Message-ID: <20240624091043.177484-7-thuth@redhat.com> In-Reply-To: <20240624091043.177484-1-thuth@redhat.com> References: <20240624091043.177484-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.30.177.4 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+importer2=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: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.149, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1719220343489100003 From: Zhenzhong Duan When get name failed, we should call unrealize() so that vfio_ccw_realize() is self contained. Fixes: 909a6254eda ("vfio/ccw: Make vfio cdev pre-openable by passing a fil= e handle") Signed-off-by: Zhenzhong Duan Reviewed-by: C=C3=A9dric Le Goater Reviewed-by: Eric Farman Reviewed-by: Thomas Huth Message-ID: <20240522170107.289532-7-clg@redhat.com> Signed-off-by: Thomas Huth --- hw/vfio/ccw.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/vfio/ccw.c b/hw/vfio/ccw.c index a468fa2342..36f2677a44 100644 --- a/hw/vfio/ccw.c +++ b/hw/vfio/ccw.c @@ -588,7 +588,7 @@ static void vfio_ccw_realize(DeviceState *dev, Error **= errp) } =20 if (!vfio_device_get_name(vbasedev, errp)) { - return; + goto out_unrealize; } =20 if (!vfio_attach_device(cdev->mdevid, vbasedev, @@ -631,6 +631,7 @@ out_region_err: vfio_detach_device(vbasedev); out_attach_dev_err: g_free(vbasedev->name); +out_unrealize: if (cdc->unrealize) { cdc->unrealize(cdev); } --=20 2.45.2 From nobody Mon Sep 16 19:12:21 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1719220363; cv=none; d=zohomail.com; s=zohoarc; b=UIgZwMFtoufC0InfUHCcR5pYEXn+T6afWsY9h9rWZXvcNsLFMPqdmZG9Yxpo1r+FwVmTlIEsBbZOFEjx4oP7CZYDD/ZbmnpOtnirV2uJ/xhLjV7VlJnJRfL0FUiguxzL4sAXRTdPsmBY6O72V+rE8/LLbCf9mI+Vzad2fCEzKNQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719220363; 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=sBJxnGxxWlao4SQioulONYxmRwRuQuSonIEpsqeTDuU=; b=lfCUGFacP8QgW6C+tQ1yxiZTbTW1Ox4kG+y4Le4eBrJ8soxduaUL9spz0R6Q7sZOKWG95ATvD5IQJwBWN9huH5RpRePTWYYdljyMAMo9Rrced78CvjfYSnBPe2etAxYSKclDHeLzkV6y+OYIu3iUvLARHrKKhBCMYbNGmLM6tyE= 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+importer2=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 1719220363715486.0639363354305; Mon, 24 Jun 2024 02:12:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sLfji-00082b-B1; Mon, 24 Jun 2024 05:11:42 -0400 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 1sLfjg-00080q-95 for qemu-devel@nongnu.org; Mon, 24 Jun 2024 05:11:40 -0400 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 1sLfjM-0003tc-Gs for qemu-devel@nongnu.org; Mon, 24 Jun 2024 05:11:40 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-15-OH6eC_6iNQOHxLomabesXg-1; Mon, 24 Jun 2024 05:11:13 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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 mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5BC7F19560B2; Mon, 24 Jun 2024 09:11:11 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.193.33]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id CFE2A3000219; Mon, 24 Jun 2024 09:11:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719220277; 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=sBJxnGxxWlao4SQioulONYxmRwRuQuSonIEpsqeTDuU=; b=ENeziyc6QYxs4X+bNl+fpwW0BM1a6jtdsDUt5pu6HWXkOz7liN8RAkEHmoHyy3ABJn5iX4 2W+Ly0mdfigbFFzg52qdz3cArlCbrzuYwtAH4i0q4f12YBHbxtetUoTSu0VnHMtHPN1FYY Xidoco5cBm5FYpz6jUPKI6HcuMQvFao= X-MC-Unique: OH6eC_6iNQOHxLomabesXg-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Zhenzhong Duan , Anthony Krowiak , Eric Farman Subject: [PULL 07/11] vfio/{ap, ccw}: Use warn_report_err() for IRQ notifier registration errors Date: Mon, 24 Jun 2024 11:10:39 +0200 Message-ID: <20240624091043.177484-8-thuth@redhat.com> In-Reply-To: <20240624091043.177484-1-thuth@redhat.com> References: <20240624091043.177484-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.30.177.4 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+importer2=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: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.149, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1719220365601100011 From: C=C3=A9dric Le Goater vfio_ccw_register_irq_notifier() and vfio_ap_register_irq_notifier() errors are currently reported using error_report_err(). Since they are not considered as failing conditions, using warn_report_err() is more appropriate. Signed-off-by: C=C3=A9dric Le Goater Reviewed-by: Zhenzhong Duan Reviewed-by: Anthony Krowiak Reviewed-by: Eric Farman Reviewed-by: Thomas Huth Message-ID: <20240522170107.289532-8-clg@redhat.com> Signed-off-by: Thomas Huth --- hw/vfio/ap.c | 2 +- hw/vfio/ccw.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/vfio/ap.c b/hw/vfio/ap.c index c12531a788..0c4354e3e7 100644 --- a/hw/vfio/ap.c +++ b/hw/vfio/ap.c @@ -172,7 +172,7 @@ static void vfio_ap_realize(DeviceState *dev, Error **e= rrp) * Report this error, but do not make it a failing condition. * Lack of this IRQ in the host does not prevent normal operation. */ - error_report_err(err); + warn_report_err(err); } =20 return; diff --git a/hw/vfio/ccw.c b/hw/vfio/ccw.c index 36f2677a44..1f8e1272c7 100644 --- a/hw/vfio/ccw.c +++ b/hw/vfio/ccw.c @@ -616,7 +616,7 @@ static void vfio_ccw_realize(DeviceState *dev, Error **= errp) * Report this error, but do not make it a failing condition. * Lack of this IRQ in the host does not prevent normal operation. */ - error_report_err(err); + warn_report_err(err); } =20 return; --=20 2.45.2 From nobody Mon Sep 16 19:12:21 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1719220334; cv=none; d=zohomail.com; s=zohoarc; b=FedZr1liQp9FKFXT5WAfqDXiBzeS+tFMaU1w354k91ti7g2qiizKLSzlsJ4sY/n83PBy5xy20xo5n3DGLJXNng7q83E5rdqB6BT2DW1FpKblu+0af8o9DKPyjr66opPdSg44g8BoVnu4PL/iuQaPeHCDC+2GsLbcKdGuOIXGVJk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719220334; 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=+9IY13yh8RRCqanS8sKsz76bmifajzLlE5oieW9FlZw=; b=cBpTGUfX1Lm522lkTnE5gFemO9Pp7XZw7pFgMd+IDeCUY4igV18wGSO494mD7K7SinY2BbpkAfESQt6wwXFuXW0n5lgtsNBwDH+wXoQNqu16Vrvwa0s3vkKFwpTRbKVfC6KMGkx08ZJMJtWwMqH3+OhF4ocaDuSkaVHyyUWFijI= 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+importer2=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 1719220334305362.3792756597637; Mon, 24 Jun 2024 02:12:14 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sLfjX-0007zG-Sr; Mon, 24 Jun 2024 05:11:31 -0400 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 1sLfjV-0007yV-KP for qemu-devel@nongnu.org; Mon, 24 Jun 2024 05:11:29 -0400 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 1sLfjJ-0003tV-DN for qemu-devel@nongnu.org; Mon, 24 Jun 2024 05:11:29 -0400 Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-690-5Ojq6atiN0S2wfz5gobYkg-1; Mon, 24 Jun 2024 05:11:15 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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 mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id F11C91955E72; Mon, 24 Jun 2024 09:11:13 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.193.33]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id CDE69300070F; Mon, 24 Jun 2024 09:11:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719220276; 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=+9IY13yh8RRCqanS8sKsz76bmifajzLlE5oieW9FlZw=; b=JU2MLtA9Jbmkg6QbcPO7P5L2rvoRe63+r7ojw38Tqr0snCFlZJReBgMjKWJTLabdGtD3ND utkLjXQAv4m0SKbi9jWqxIjIMsoeerMfbw5P1DlABnN7P7Y59XmjlHHbPLkZhpqYZGgnf8 HyZZ9JklNyT8lEZrJ8heFG3+TdfvLac= X-MC-Unique: 5Ojq6atiN0S2wfz5gobYkg-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: Dmitry Frolov , Alexander Bulekov Subject: [PULL 08/11] tests/qtest/fuzz: fix memleak in qos_fuzz.c Date: Mon, 24 Jun 2024 11:10:40 +0200 Message-ID: <20240624091043.177484-9-thuth@redhat.com> In-Reply-To: <20240624091043.177484-1-thuth@redhat.com> References: <20240624091043.177484-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 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+importer2=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: 11 X-Spam_score: 1.1 X-Spam_bar: + X-Spam_report: (1.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.149, 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.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1719220335468100003 Content-Type: text/plain; charset="utf-8" From: Dmitry Frolov Found with fuzzing for qemu-8.2, but also relevant for master Signed-off-by: Dmitry Frolov Reviewed-by: Thomas Huth Reviewed-by: Alexander Bulekov Message-ID: <20240521103106.119021-3-frolov@swemel.ru> Signed-off-by: Thomas Huth --- tests/qtest/fuzz/qos_fuzz.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qtest/fuzz/qos_fuzz.c b/tests/qtest/fuzz/qos_fuzz.c index b71e945c5f..d3839bf999 100644 --- a/tests/qtest/fuzz/qos_fuzz.c +++ b/tests/qtest/fuzz/qos_fuzz.c @@ -180,6 +180,7 @@ static void walk_path(QOSGraphNode *orig_path, int len) =20 fuzz_path_vec =3D path_vec; } else { + g_string_free(cmd_line, true); g_free(path_vec); } =20 --=20 2.45.2 From nobody Mon Sep 16 19:12:21 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1719220376; cv=none; d=zohomail.com; s=zohoarc; b=Ah6NeLlwHxVv7Z7rCtaMrQzW9P37v0VBC3poqQxP7aIVbeyFVEMGXtTA+v8BUTfn7vnGXEaqi3MwBJUT3BVNk3OuAn7t/2Fj8BlGDPR73S0RTV3dDXj/1DJ1PzbI9Cj43BV1CuTgwy0WX6gG7qDhbmyEgwWU+g8rx7u9QlkUb+Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719220376; 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=W7ohm5evrWfnX6RaracvxTgW8W6EpOv2Muym3qslNwI=; b=H2rltrW5drRXd8TvDVXw6gEyWK4ynWmeNePZxdTlvDe1JGmOxnJZhSJNPKbwtUJObpcp2/xs45CGeyptpUmdi5bRqTrGo3svGBfxSbUnRYA9fI7xGFDK8/zJ1cEkd3G1H5FHa98YyAm6ft5SFeVxN2vCAnhUobuJ73lpzRLjuzw= 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+importer2=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 1719220376765863.6224332986924; Mon, 24 Jun 2024 02:12:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sLfja-00080G-Hp; Mon, 24 Jun 2024 05:11:34 -0400 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 1sLfjY-0007zf-RK for qemu-devel@nongnu.org; Mon, 24 Jun 2024 05:11:32 -0400 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 1sLfjX-0003uF-Ee for qemu-devel@nongnu.org; Mon, 24 Jun 2024 05:11:32 -0400 Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-461-EMjXoU1cMaC80Kw4zFqqEg-1; Mon, 24 Jun 2024 05:11:18 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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 mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0CE2019560AE; Mon, 24 Jun 2024 09:11:17 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.193.33]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id DE75E300021C; Mon, 24 Jun 2024 09:11:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719220288; 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=W7ohm5evrWfnX6RaracvxTgW8W6EpOv2Muym3qslNwI=; b=OmcqLa9HuGmPKClv4FbT28pJbBkDHfzutqkJPO6mLMYO1f+iFq5dGueXbTBGPSHmsuJfyU DL58hlmYVkmo4Xwg0DuQw997J/5Kt7IdHKkLJh7a6tGITAQ7oucK+Z1VGS9xa5ntReT1ld 8BzoQsDAdMfWCgYikhJ3AIdsmQcg8j4= X-MC-Unique: EMjXoU1cMaC80Kw4zFqqEg-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: Omar Sandoval Subject: [PULL 09/11] target/s390x/arch_dump: use correct byte order for pid Date: Mon, 24 Jun 2024 11:10:41 +0200 Message-ID: <20240624091043.177484-10-thuth@redhat.com> In-Reply-To: <20240624091043.177484-1-thuth@redhat.com> References: <20240624091043.177484-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 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+importer2=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: 11 X-Spam_score: 1.1 X-Spam_bar: + X-Spam_report: (1.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.149, 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.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1719220377629100005 Content-Type: text/plain; charset="utf-8" From: Omar Sandoval The pid field of prstatus needs to be big endian like all of the other fields. Fixes: f738f296eaae ("s390x/arch_dump: pass cpuid into notes sections") Signed-off-by: Omar Sandoval Reviewed-by: Thomas Huth Message-ID: <5929f76d536d355afd04af51bf293695a1065118.1718771802.git.osando= v@osandov.com> Signed-off-by: Thomas Huth --- target/s390x/arch_dump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/s390x/arch_dump.c b/target/s390x/arch_dump.c index 7e8a1b4fc0..029d91d93a 100644 --- a/target/s390x/arch_dump.c +++ b/target/s390x/arch_dump.c @@ -102,7 +102,7 @@ static void s390x_write_elf64_prstatus(Note *note, S390= CPU *cpu, int id) regs->acrs[i] =3D cpu_to_be32(cpu->env.aregs[i]); regs->gprs[i] =3D cpu_to_be64(cpu->env.regs[i]); } - note->contents.prstatus.pid =3D id; + note->contents.prstatus.pid =3D cpu_to_be32(id); } =20 static void s390x_write_elf64_fpregset(Note *note, S390CPU *cpu, int id) --=20 2.45.2 From nobody Mon Sep 16 19:12:21 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1719220353; cv=none; d=zohomail.com; s=zohoarc; b=PjvYwcEnn01dqlp7E994ggPCnUQ7arlXqus4HdbMkM0iZZirf3PyPLntjyMFQz6UhhZ5f5gpV+o59a1dbZtm4CJsCXmQGcIph+bxB4cuYakt4xfZXMkxA6CsPE7miGc+kB1p9Q4KH2RRFMZFyXrXzNX+WiU3nyRA0RkvRXh0dqY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719220353; 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=yBQuxy0eCfthitZzKvZ7UkOInczSqOP8WkL+1kSVxB8=; b=l/9tXcdJUeD38bQQJPQOCgJhtqUfxn2oW1qR3Ve+ff2c6HnivXq6IAAxWrx5hQAw2va0RdEkU+FtCorvrNpUR2YU0TTdIpwJRK1PNUBFBYpbXnWjT6pJhJcm1hBB983RpIVGViTjqIKX/MR192eF/x0s5eFflxMRzWxt4nkUKr0= 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+importer2=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 1719220353853907.5155825642099; Mon, 24 Jun 2024 02:12:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sLfjY-0007zd-M4; Mon, 24 Jun 2024 05:11:32 -0400 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 1sLfjX-0007yu-3k for qemu-devel@nongnu.org; Mon, 24 Jun 2024 05:11:31 -0400 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 1sLfjT-0003tp-An for qemu-devel@nongnu.org; Mon, 24 Jun 2024 05:11:30 -0400 Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-76-kygFTiS-Ni2CkMC9htTXkA-1; Mon, 24 Jun 2024 05:11:21 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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 mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A16BE195608F; Mon, 24 Jun 2024 09:11:20 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.193.33]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 76A113000219; Mon, 24 Jun 2024 09:11:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719220283; 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=yBQuxy0eCfthitZzKvZ7UkOInczSqOP8WkL+1kSVxB8=; b=Tg3vrzu1rVITlK6SPJyJX4xdimJlDLqfvfBwEvbXqnR7jtREoP01vK63xfE93yWvrsmApc wk5t+sJHWhLAOPy7zqmIA+487c+h7aWXfPt2WIAZUBl5rJa+2ubr2vP0bawEZDvhH8iwuX V4HjQoLLDWP04oyEfrK7qXMdyU7Cchw= X-MC-Unique: kygFTiS-Ni2CkMC9htTXkA-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Fabiano Rosas , Peter Xu Subject: [PULL 10/11] MAINTAINERS: Cover all tests/qtest/migration-* files Date: Mon, 24 Jun 2024 11:10:42 +0200 Message-ID: <20240624091043.177484-11-thuth@redhat.com> In-Reply-To: <20240624091043.177484-1-thuth@redhat.com> References: <20240624091043.177484-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.30.177.4 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+importer2=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: 11 X-Spam_score: 1.1 X-Spam_bar: + X-Spam_report: (1.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.149, 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.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1719220355536100003 Beside migration-test.c, there is nowadays migration-helpers.[ch], too, so update the entry in the migration section to also cover these files now. While we're at it, exclude these files in the common qtest section, since the migration test is well covered by the migration maintainers already. Since the test is under very active development, it was causing a lot of distraction to the generic qtest maintainers with regards to the patches that need to be reviewed by the migration maintainers anyway. Message-ID: <20240619055447.129943-1-thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Fabiano Rosas Reviewed-by: Peter Xu Signed-off-by: Thomas Huth --- MAINTAINERS | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index cef54de759..f144b5af44 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3312,6 +3312,7 @@ F: tests/qtest/ F: docs/devel/qgraph.rst F: docs/devel/qtest.rst X: tests/qtest/bios-tables-test* +X: tests/qtest/migration-* =20 Device Fuzzing M: Alexander Bulekov @@ -3408,7 +3409,7 @@ F: include/qemu/userfaultfd.h F: migration/ F: scripts/vmstate-static-checker.py F: tests/vmstate-static-checker-data/ -F: tests/qtest/migration-test.c +F: tests/qtest/migration-* F: docs/devel/migration/ F: qapi/migration.json F: tests/migration/ --=20 2.45.2 From nobody Mon Sep 16 19:12:21 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1719220361; cv=none; d=zohomail.com; s=zohoarc; b=ehjmKdVX/G3EedoXbac9B5e+oUg1cM+ad7knPY0IsMlJsUbJVuN6QyCnFJxO8ZtLYxZc2RqH5IjT8cDGowkY37Y1S7+1KGnp8qJvK56tR7am0ZZhKvnHSTB9oUZ6STiOUdXSceDABGI8tQZ2tdGpQWWd7b+bkhvLB7J4WdVKTbU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719220361; h=Content-Transfer-Encoding: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:Cc; bh=3z5NAOaj1jkkPYGiKOcuGY5xJ/VoMG76a1jxQ0hvELY=; b=QInal5aUhsIV31b+Sl99A+qZBUShv3D253KZKRPdbzbjq/sAnm/3ry/4H2zR+Pc44dyALH6UXIPTZdziNzX9zHzcfOLaP7VvLGHBz0eHlfzefC8TLNg/aHDyfluH3rCx168hcHyUG+xE0GaO1rVblfZrt7B7S3o0vvCmuv1uo70= 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+importer2=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 171922036175021.85627819559238; Mon, 24 Jun 2024 02:12:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sLfjb-00080K-5J; Mon, 24 Jun 2024 05:11:35 -0400 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 1sLfjZ-0007zp-Ky for qemu-devel@nongnu.org; Mon, 24 Jun 2024 05:11:33 -0400 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 1sLfjV-0003uA-Nt for qemu-devel@nongnu.org; Mon, 24 Jun 2024 05:11:33 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-425-hjLTpm5kNYmieW4d-YDe3A-1; Mon, 24 Jun 2024 05:11:23 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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 mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C35971956046; Mon, 24 Jun 2024 09:11:22 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.193.33]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7959C3000615; Mon, 24 Jun 2024 09:11:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719220288; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3z5NAOaj1jkkPYGiKOcuGY5xJ/VoMG76a1jxQ0hvELY=; b=bK7ucC94NvP9QfIjMJvchgfWs2vhyRqCz4bVcO1vF66+LHZuE4hcrPAY1HmqtUPFJhVucs IXDlPkgGw9eiZrRDZc6kDiOSkg1uG4w19/LuAOZaeblBlSdqomdQz6rX+d7Eozrpvd6qoW Tfn1XInkx9flMjOoyReFeHAZk6FR+HM= X-MC-Unique: hjLTpm5kNYmieW4d-YDe3A-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Subject: [PULL 11/11] target/s390x: Add a CONFIG switch to disable legacy CPUs Date: Mon, 24 Jun 2024 11:10:43 +0200 Message-ID: <20240624091043.177484-12-thuth@redhat.com> In-Reply-To: <20240624091043.177484-1-thuth@redhat.com> References: <20240624091043.177484-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 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+importer2=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: 11 X-Spam_score: 1.1 X-Spam_bar: + X-Spam_report: (1.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.149, 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.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1719220363593100005 Content-Type: text/plain; charset="utf-8" The oldest model that IBM still supports is the z13. Considering that each generation can "emulate" the previous two generations in hardware (via the "IBC" feature of the CPUs), this means that everything that is older than z114/196 is not an officially supported CPU model anymore. The Linux kernel still support the z10, so if we also take this into account, everything older than that can definitely be considered as a legacy CPU model. For downstream builds of QEMU, we would like to be able to disable these legacy CPUs in the build. Thus add a CONFIG switch that can be used to disable them (and old machine types that use them by default). Message-Id: <20240614125019.588928-1-thuth@redhat.com> Signed-off-by: Thomas Huth --- hw/s390x/s390-virtio-ccw.c | 5 +++++ target/s390x/cpu_models.c | 9 +++++++++ target/s390x/Kconfig | 5 +++++ 3 files changed, 19 insertions(+) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 3d0bc3e7f2..cd063f8b64 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -47,6 +47,7 @@ #include "migration/blocker.h" #include "qapi/visitor.h" #include "hw/s390x/cpu-topology.h" +#include CONFIG_DEVICES =20 static Error *pv_mig_blocker; =20 @@ -1126,6 +1127,8 @@ static void ccw_machine_2_12_class_options(MachineCla= ss *mc) } DEFINE_CCW_MACHINE(2_12, "2.12", false); =20 +#ifdef CONFIG_S390X_LEGACY_CPUS + static void ccw_machine_2_11_instance_options(MachineState *machine) { static const S390FeatInit qemu_cpu_feat =3D { S390_FEAT_LIST_QEMU_V2_1= 1 }; @@ -1272,6 +1275,8 @@ static void ccw_machine_2_4_class_options(MachineClas= s *mc) } DEFINE_CCW_MACHINE(2_4, "2.4", false); =20 +#endif + static void ccw_machine_register_types(void) { type_register_static(&ccw_machine_info); diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c index efb508cd2e..a27f4b6f79 100644 --- a/target/s390x/cpu_models.c +++ b/target/s390x/cpu_models.c @@ -25,6 +25,7 @@ #ifndef CONFIG_USER_ONLY #include "sysemu/sysemu.h" #include "target/s390x/kvm/pv.h" +#include CONFIG_DEVICES #endif =20 #define CPUDEF_INIT(_type, _gen, _ec_ga, _mha_pow, _hmfai, _name, _desc) \ @@ -47,6 +48,13 @@ * generation 15 one base feature and one optional feature have been depre= cated. */ static S390CPUDef s390_cpu_defs[] =3D { + /* + * Linux requires at least z10 nowadays, and IBM only supports recent = CPUs + * (see https://www.ibm.com/support/pages/ibm-mainframe-life-cycle-his= tory), + * so we consider older CPUs as legacy that can optionally be disabled= via + * the CONFIG_S390X_LEGACY_CPUS config switch. + */ +#if defined(CONFIG_S390X_LEGACY_CPUS) || defined(CONFIG_USER_ONLY) CPUDEF_INIT(0x2064, 7, 1, 38, 0x00000000U, "z900", "IBM zSeries 900 GA= 1"), CPUDEF_INIT(0x2064, 7, 2, 38, 0x00000000U, "z900.2", "IBM zSeries 900 = GA2"), CPUDEF_INIT(0x2064, 7, 3, 38, 0x00000000U, "z900.3", "IBM zSeries 900 = GA3"), @@ -64,6 +72,7 @@ static S390CPUDef s390_cpu_defs[] =3D { CPUDEF_INIT(0x2096, 9, 2, 40, 0x00000000U, "z9BC", "IBM System z9 BC G= A1"), CPUDEF_INIT(0x2094, 9, 3, 40, 0x00000000U, "z9EC.3", "IBM System z9 EC= GA3"), CPUDEF_INIT(0x2096, 9, 3, 40, 0x00000000U, "z9BC.2", "IBM System z9 BC= GA2"), +#endif CPUDEF_INIT(0x2097, 10, 1, 43, 0x00000000U, "z10EC", "IBM System z10 E= C GA1"), CPUDEF_INIT(0x2097, 10, 2, 43, 0x00000000U, "z10EC.2", "IBM System z10= EC GA2"), CPUDEF_INIT(0x2098, 10, 2, 43, 0x00000000U, "z10BC", "IBM System z10 B= C GA1"), diff --git a/target/s390x/Kconfig b/target/s390x/Kconfig index d886be48b4..8a95f2bc3f 100644 --- a/target/s390x/Kconfig +++ b/target/s390x/Kconfig @@ -2,3 +2,8 @@ config S390X bool select PCI select S390_FLIC + +config S390X_LEGACY_CPUS + bool + default y + depends on S390X --=20 2.45.2