From nobody Mon Nov 25 07:23:38 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=1716397366; cv=none; d=zohomail.com; s=zohoarc; b=DPSvjAxQYILh6jwW0u4DtRzPmw+S0Xs59GulD15b+htByJ3H4Us/irRCxk0ENj4mTTZXtC+zTeShEPsFY594HY32MB2bSoLk9f2uBtHYoGnHpDtX1Jv41qY/C9VtRc9qX6hy6GMSFNa7Tr3ouT90gnyxous3EaGC+eIBATuKhKA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716397366; 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=NH2Qma3K6JHa3biLRiK7TBjGAz4Sbry3T+EMcJa1ZaU=; b=bE2OsDJADLHkCULpzs79f/sI0cDal+2dUltMNGkGzuGnDEEXRlpvFmXibZQueSnkRidGPvPtMXR3ArQMT6g2/6rR56+Yyd42ll/6G/YKV8Wb9slY8ikSUqMBXdtVSEUvkawQbavOZ480dcez8pY/TDDy5eagWjSkgxL2pJSvaVU= 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 17163973660911018.9210119383634; Wed, 22 May 2024 10:02:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s9pLE-0000Nl-Az; Wed, 22 May 2024 13:01:28 -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 1s9pL7-0000LW-BC for qemu-devel@nongnu.org; Wed, 22 May 2024 13:01:23 -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 1s9pL3-0006Fr-CG for qemu-devel@nongnu.org; Wed, 22 May 2024 13:01:19 -0400 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-473--ixrUXf3ONKspQ8Eik4wnQ-1; Wed, 22 May 2024 13:01:13 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (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 ABBA73C025C1; Wed, 22 May 2024 17:01:12 +0000 (UTC) Received: from corto.redhat.com (unknown [10.39.192.133]) by smtp.corp.redhat.com (Postfix) with ESMTP id 50C11561B; Wed, 22 May 2024 17:01:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716397276; 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=NH2Qma3K6JHa3biLRiK7TBjGAz4Sbry3T+EMcJa1ZaU=; b=EHKxgD6nidHZf3Ge0VulUgrHc+RZKYa11QsU5w7xJclg9pscMnNPVg5H7qLZoGnnKTOq+D +t+gOSW2dcXw8Zl9HaK83BAKN9DjFr7JCuD+Tcduh3zgKKQeemR+w0VC76RPfuQlTgOVOj ecp/Ns3ik/B1pMod88YIXQhQQ8BFIO0= X-MC-Unique: -ixrUXf3ONKspQ8Eik4wnQ-1 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, Thomas Huth , Zhenzhong Duan , Matthew Rosato , Eric Farman , Tony Krowiak , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PATCH 1/7] hw/s390x/ccw: Make s390_ccw_get_dev_info() return a bool Date: Wed, 22 May 2024 19:01:01 +0200 Message-ID: <20240522170107.289532-2-clg@redhat.com> In-Reply-To: <20240522170107.289532-1-clg@redhat.com> References: <20240522170107.289532-1-clg@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.1 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=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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 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: 1716397369462100003 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: Anthony Krowiak Reviewed-by: Eric Farman Reviewed-by: Thomas Huth Reviewed-by: Zhenzhong Duan --- 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 5261e66724f1cc3157b9413b0d5fdf5289c92503..a06e91dfb318e3500324851488c= 56806fa46c08d 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.1 From nobody Mon Nov 25 07:23:38 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=1716397339; cv=none; d=zohomail.com; s=zohoarc; b=ba3yNfzJNP0z36W7bX28v4wDN65aafP+RSG08d0XWilgVd7pI1VRZ2bDwa/hgIiizYP6hrP2gh7YP9gxGJEvvdV4kORxKGzkeeN2epbX1/TU0DJKBlXqpATYF4lpqr7mHGtfZdt/155pxDECPu5AGF8LvqrFkx9R14TpevuV1Zk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716397339; 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=+Z8qwgx2tbYux8MlEKpFhB/CS+fM9t1Ig/khgGvS7uY=; b=V5NxoCPddRF24rpUtIM4GX2QXISrUJFqxm0mjaW0ywGlBIENi5lGHFxWZy2Oc0DSp7OQVO4+eRQF6AZBpW8s2OuM4L8MGk49/LvAUbaB+wB76mQ0nJe+ksyQR7MjqjD8nK5ph0KlLYAwM8VCVvO0kiCzFvHVQafi0Z5WDAH1Row= 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 1716397339099629.7145757703898; Wed, 22 May 2024 10:02:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s9pLJ-0000Qp-Mr; Wed, 22 May 2024 13:01:33 -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 1s9pLI-0000QE-NZ for qemu-devel@nongnu.org; Wed, 22 May 2024 13:01: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 1s9pL7-0006G9-35 for qemu-devel@nongnu.org; Wed, 22 May 2024 13:01:32 -0400 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-563-_Lm71GWaMWCg_o11oeFB0A-1; Wed, 22 May 2024 13:01:14 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (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 499B3380008A; Wed, 22 May 2024 17:01:14 +0000 (UTC) Received: from corto.redhat.com (unknown [10.39.192.133]) by smtp.corp.redhat.com (Postfix) with ESMTP id E1AA55618; Wed, 22 May 2024 17:01:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716397279; 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=+Z8qwgx2tbYux8MlEKpFhB/CS+fM9t1Ig/khgGvS7uY=; b=Wsh1yfgtV6MzlpoPXD4kl+uheWoTblucQjO5sO8K9o6vuXl8+qkkYVvr4ubn96Gyn4p8yc qDvp+oexLUIxUxHs6lEclt0IunPjHByNZ82ILsG1yQIZD42ffWHJgM68bnbHmBgJn60+Oy rTwes6VVf5vJuGiRHMtkpV4e7eV5M1U= X-MC-Unique: _Lm71GWaMWCg_o11oeFB0A-1 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, Thomas Huth , Zhenzhong Duan , Matthew Rosato , Eric Farman , Tony Krowiak , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PATCH 2/7] s390x/css: Make CCWDeviceClass::realize return bool Date: Wed, 22 May 2024 19:01:02 +0200 Message-ID: <20240522170107.289532-3-clg@redhat.com> In-Reply-To: <20240522170107.289532-1-clg@redhat.com> References: <20240522170107.289532-1-clg@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.1 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=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: 1716397351395100003 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: Anthony Krowiak Reviewed-by: Eric Farman Reviewed-by: Thomas Huth Reviewed-by: Zhenzhong Duan --- 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 6dff95225df11c63f9b66975019026b215c8c448..5feeb0ee7a268b8709043b5bbc5= 6b06e707a448d 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 fb8c1acc64d5002c861a4913f292d8346dbef192..a7d682e5af9ce90e7e2fad8c24b= 30e39328c7cf4 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 a06e91dfb318e3500324851488c56806fa46c08d..4b8ede701df90949720262b6fc1= b65f4e505e34d 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.1 From nobody Mon Nov 25 07:23:38 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=1716397339; cv=none; d=zohomail.com; s=zohoarc; b=YTDBbTR4+inIEAYtFmnxdeCvnURzzVpO5TMnGrBzo+JtlYDTPZvf5jdHoB0MCN2do6MPou/QKIiS18vFELgrzy2Q8vxAZ/wWCTIguZgmwqT+oMEvMqWFp0mjpu1BQYYMskBbfJvezltgnBAhDdmjZerYqMqOzMym+LnK2IRZNOM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716397339; 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=zd1AqLvVL7wcYKVeJ4+z707gsI8ABGKG0N9STot3puE=; b=hI7EDRKTzJpCKXSMcr26JcrLXIwZYxql3qAEfoRdd/0jHuNU5t9sTZRywZ7WoFcZqSxmpm5cwJ4iNxHSPyff/fGQBxcwmrZMoEgt4RfRXOSb8WorB4mJAXEBuhiaZ/oaTvtyFV5lkre/7qwgAFoWtXtdLmGy0OkV2110lv7Q7FE= 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 1716397339321872.4128881615288; Wed, 22 May 2024 10:02:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s9pLK-0000Rj-E5; Wed, 22 May 2024 13:01: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 1s9pLI-0000Py-FT for qemu-devel@nongnu.org; Wed, 22 May 2024 13:01: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 1s9pL8-0006GK-Dv for qemu-devel@nongnu.org; Wed, 22 May 2024 13:01:32 -0400 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-529-cqFyCqcMOfq6tipHETMGDw-1; Wed, 22 May 2024 13:01:16 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (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 D7290800994; Wed, 22 May 2024 17:01:15 +0000 (UTC) Received: from corto.redhat.com (unknown [10.39.192.133]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7E131561B; Wed, 22 May 2024 17:01:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716397280; 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=zd1AqLvVL7wcYKVeJ4+z707gsI8ABGKG0N9STot3puE=; b=BSmj+cDN0SIvDCZbl1eWopwHnkAX62x9rp/2mP9efKIgxslBTx1rMhDxP/UYk55ORJWDU4 qzEGZlfmpx/zqUQUh/U++Z2qDI9XEx9F1ekbf59lOK72C9hLN+FAkp/nX7glC9nAq4UrIM RgAGO/wRxmt6yJbQuBZRavAFy/gDivQ= X-MC-Unique: cqFyCqcMOfq6tipHETMGDw-1 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, Thomas Huth , Zhenzhong Duan , Matthew Rosato , Eric Farman , Tony Krowiak , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PATCH 3/7] hw/s390x/ccw: Remove local Error variable from s390_ccw_realize() Date: Wed, 22 May 2024 19:01:03 +0200 Message-ID: <20240522170107.289532-4-clg@redhat.com> In-Reply-To: <20240522170107.289532-1-clg@redhat.com> References: <20240522170107.289532-1-clg@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.1 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=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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 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: 1716397341456100005 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: Anthony Krowiak Reviewed-by: Eric Farman Reviewed-by: Thomas Huth Reviewed-by: Zhenzhong Duan --- 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 4b8ede701df90949720262b6fc1b65f4e505e34d..b3d14c61d732880a651edcf28a0= 40ca723cb9f5b 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.1 From nobody Mon Nov 25 07:23:38 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=1716397339; cv=none; d=zohomail.com; s=zohoarc; b=BGP+qnZk3ARIzoCBgHo/inenFZp5kknWbh0Kl00hf6q60ef/OpdqjZl5NGEBZ702PtELXyhqoHmC4nXqhA6yWsDxIDi+BYemeacuNK8pOpxDy6R9WHOUetvrhSuiHxCcpaJzdrLN1qGJAkmkBMp0VpZBh1S8LjBmXmKyH53fxvw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716397339; 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=ZKjuk6fjg6iz0+aIvm9tzmOZTgOfGaENLQD4KGF73DA=; b=aVLP7F4uggONTiuBwNUyLQTWXONh1vV1PE8h+PHFkIqLwAVTmPU8yZEAD4zN6tzNwi0HbEbDuaCboJuDnHF2wqOe74bGVIGtR9efpWOBON7OlW/zNJqOvOzL20yeHpVW2pGJRcFdxhxoYYWub3l5TVGvvlPHXlhE0/QwiiVG6Pw= 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 171639733986098.88630256894874; Wed, 22 May 2024 10:02:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s9pLJ-0000Qn-Ey; Wed, 22 May 2024 13:01:33 -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 1s9pLI-0000Q5-Ju for qemu-devel@nongnu.org; Wed, 22 May 2024 13:01: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 1s9pL8-0006Gj-Dt for qemu-devel@nongnu.org; Wed, 22 May 2024 13:01:32 -0400 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-623-GsdxkOC3Pvi-B8vCsNr1JA-1; Wed, 22 May 2024 13:01:18 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (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 7299A803785; Wed, 22 May 2024 17:01:17 +0000 (UTC) Received: from corto.redhat.com (unknown [10.39.192.133]) by smtp.corp.redhat.com (Postfix) with ESMTP id 18C6F5619; Wed, 22 May 2024 17:01:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716397281; 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=ZKjuk6fjg6iz0+aIvm9tzmOZTgOfGaENLQD4KGF73DA=; b=Y/U+1SswCuKBGLXshdBrhLBdQstchWLWuugI3h7kk9STqv1Fo0VjNRA2wUnplCfmdZsED4 kZ54PSDEzd5NEQhu0A9XQG3aAR81cw/EkcqgMkBv6wZg9VRwarwd6sfQFcjQ73NGEdaKmy WSQguRb1BoPeehFGNqVrg7Qsi45hFXo= X-MC-Unique: GsdxkOC3Pvi-B8vCsNr1JA-1 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, Thomas Huth , Zhenzhong Duan , Matthew Rosato , Eric Farman , Tony Krowiak , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PATCH 4/7] s390x/css: Make S390CCWDeviceClass::realize return bool Date: Wed, 22 May 2024 19:01:04 +0200 Message-ID: <20240522170107.289532-5-clg@redhat.com> In-Reply-To: <20240522170107.289532-1-clg@redhat.com> References: <20240522170107.289532-1-clg@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.1 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=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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 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: 1716397341477100006 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: Anthony Krowiak Reviewed-by: Eric Farman Reviewed-by: Thomas Huth Reviewed-by: Zhenzhong Duan --- 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 2c807ee3a1ae8d85460fe65be8a62c64f212fe4b..2e0a70998132070996d6b0d083b= 8ddba5b9b87dc 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 b3d14c61d732880a651edcf28a040ca723cb9f5b..3c0975055089c3629dd76ce2e14= 84a4ef66d8d41 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 2600e62e37238779800dc2b3a0bd315d7633017b..9a8e052711fe2f7c067c52808b2= af30d0ebfee0c 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.1 From nobody Mon Nov 25 07:23:38 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=1716397339; cv=none; d=zohomail.com; s=zohoarc; b=T7eE+ujK/z8MG16+PrOnYqKdB2up9Xf2Z7x/RU5dZByyIKAfgpW+yclJ4Bc2Hih2xDPvQQHP3UwTabGDico0vBfa6ZG7JMk8wQPL6rXWLK1Dd5OUxrnIGk27P+adMoHat+XzXJSqjmGYMwmR1JhDn/5zfl1PZvuBXH4ssO1ZLjw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716397339; 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=66Bm2P/DmlIK9VNORtEOlS10BkUqgh5w4G4kzZgH418=; b=M526drfX/DhZtfQEO2mSL5ndlqiRObmvs3zjr2N7lv+D/nz9HJFr0AHQdMJAHkgHlnMJN5df0qipns52QtzvocMuCS3mn5JxvduFPGabvgtpcvAL5G6EUxVIX7rJmI5x8OBxmFYBsGF8yxzVqqVgbXDO6NXO+pn7C3dEQwHQqZo= 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 1716397339206182.3884412887378; Wed, 22 May 2024 10:02:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s9pLM-0000TW-Ih; Wed, 22 May 2024 13:01:36 -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 1s9pLJ-0000R1-UP for qemu-devel@nongnu.org; Wed, 22 May 2024 13:01:33 -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 1s9pLA-0006H7-My for qemu-devel@nongnu.org; Wed, 22 May 2024 13:01:33 -0400 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-30-n28t7gNEMwS6hPueYTB_yQ-1; Wed, 22 May 2024 13:01:19 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (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 0FCD4185A783; Wed, 22 May 2024 17:01:19 +0000 (UTC) Received: from corto.redhat.com (unknown [10.39.192.133]) by smtp.corp.redhat.com (Postfix) with ESMTP id A8151561A; Wed, 22 May 2024 17:01:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716397284; 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=66Bm2P/DmlIK9VNORtEOlS10BkUqgh5w4G4kzZgH418=; b=g/H5j2EwGdJXemSAG7IIAdceSF+J382z/vgij0/ag10DIFoe191H8QH14As2K0GvIZkG4K AcMtgNYxGr6SeRwFw8bOEb7af4KnEvu9S9pGUYwQiJR5GepirPGLwobqBtcdGSORWAGTje AzWiDwySw9k8uVi43d703zlTvqahzxM= X-MC-Unique: n28t7gNEMwS6hPueYTB_yQ-1 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, Thomas Huth , Zhenzhong Duan , Matthew Rosato , Eric Farman , Tony Krowiak , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PATCH 5/7] vfio/ccw: Use the 'Error **errp' argument of vfio_ccw_realize() Date: Wed, 22 May 2024 19:01:05 +0200 Message-ID: <20240522170107.289532-6-clg@redhat.com> In-Reply-To: <20240522170107.289532-1-clg@redhat.com> References: <20240522170107.289532-1-clg@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.1 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=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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 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: 1716397341586100009 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: Anthony Krowiak Reviewed-by: Eric Farman Reviewed-by: Thomas Huth Reviewed-by: Zhenzhong Duan --- 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 9a8e052711fe2f7c067c52808b2af30d0ebfee0c..a468fa2342b97e0ee36bd5fb844= 3025cc90a0453 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.1 From nobody Mon Nov 25 07:23:38 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=1716397378; cv=none; d=zohomail.com; s=zohoarc; b=m57sJvjv5K0QU5l4ikthgY/ZesD4q+GASgNh1Tbn38Tu0Fb4m8gQd8QySC2AhOXvvHWyEJm7GX9BCJp1a0IP0dR1/Jmx9jHw6+69mqMgd67UXPVCowquyMcCFrMz8j7S0LsugrjLoIBK3r9CcGwW9uiiYtAigPtBPF6MYshknJk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716397378; 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=TbSsdzriH3JaD7MJWAnTg9+wWX6VXaSHyl3vXa1NFWA=; b=MgzcBz7FTXcIwcuHZAleHCiOf+3qkCE73jeLbx6iZsYQAUpO3jd66zdcfZp4BayRE5UWizNVVORf03o4XUOosj4VouXjKyJHRY4XfKkbldUN4F0ylWc3V/kRGkf6O8DyWG6wkwTLsazwrgxAouq3rr+YtoP0BbyZM8qY57qeKzc= 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 1716397378305889.3068577566612; Wed, 22 May 2024 10:02:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s9pLN-0000UD-Ff; Wed, 22 May 2024 13:01:37 -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 1s9pLL-0000Sq-5X for qemu-devel@nongnu.org; Wed, 22 May 2024 13:01:35 -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 1s9pLC-0006HV-6w for qemu-devel@nongnu.org; Wed, 22 May 2024 13:01:34 -0400 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-465-cNKsTyMuP6yXEaZr7Y8Zqw-1; Wed, 22 May 2024 13:01:20 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (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 4F11A1C0513B; Wed, 22 May 2024 17:01:20 +0000 (UTC) Received: from corto.redhat.com (unknown [10.39.192.133]) by smtp.corp.redhat.com (Postfix) with ESMTP id 452E15618; Wed, 22 May 2024 17:01:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716397285; 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=TbSsdzriH3JaD7MJWAnTg9+wWX6VXaSHyl3vXa1NFWA=; b=Oc5qgTfjXSgUwFJ7IHkgQQX1tMppVSPekxLytvZbsj6tEOCabd/d1swpHNuYW3wXALMWub bKmPIXNVKpAqiSDuAeuNU5Bc3iljwpvHf9ntGCLFfdEr41V4YRbBXo/Qd0pWlpSWn8+QQB rQWomdzaLnWwnHDmVjcWthjDk4nyY+s= X-MC-Unique: cNKsTyMuP6yXEaZr7Y8Zqw-1 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, Thomas Huth , Zhenzhong Duan , Matthew Rosato , Eric Farman , Tony Krowiak Subject: [PATCH 6/7] vfio/ccw: Fix the missed unrealize() call in error path Date: Wed, 22 May 2024 19:01:06 +0200 Message-ID: <20240522170107.289532-7-clg@redhat.com> In-Reply-To: <20240522170107.289532-1-clg@redhat.com> References: <20240522170107.289532-1-clg@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 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=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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 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: 1716397379545100001 Content-Type: text/plain; charset="utf-8" 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 --- 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 a468fa2342b97e0ee36bd5fb8443025cc90a0453..36f2677a448c5e31523dcc3de7d= 973ec70e4a13c 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.1 From nobody Mon Nov 25 07:23:38 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1716397405894134.7484594842499; Wed, 22 May 2024 10:03:25 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s9pLN-0000UG-Gv; Wed, 22 May 2024 13:01:37 -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 1s9pLL-0000St-8j for qemu-devel@nongnu.org; Wed, 22 May 2024 13:01:35 -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 1s9pLC-0006HP-0T for qemu-devel@nongnu.org; Wed, 22 May 2024 13:01:35 -0400 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-680-HKe4mZzGOt-RDRzk4WRGLA-1; Wed, 22 May 2024 13:01:22 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (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 DF0B68058D4; Wed, 22 May 2024 17:01:21 +0000 (UTC) Received: from corto.redhat.com (unknown [10.39.192.133]) by smtp.corp.redhat.com (Postfix) with ESMTP id 85343561A; Wed, 22 May 2024 17:01:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716397285; 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=d6An/0arX6uyYzYZ5CvpGfu7Aty966JfOgx/O3OFYOw=; b=JEJX4HaqL+OYj3ifiQfxVBvJzXFOQ3+6l+EoQa4t3dY/EXKPK8XwpBBqo5IgSuN6RkrbSS evlU7x/rgs9mGHqCTv41vItSyoKXiaLE6GOOn4jVhb7qR/vrfkbIYtd/R/75i1adkZ6amP mKH6bVSxdbpBsDYysdtq+pmBv/qbO0Y= X-MC-Unique: HKe4mZzGOt-RDRzk4WRGLA-1 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, Thomas Huth , Zhenzhong Duan , Matthew Rosato , Eric Farman , Tony Krowiak , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PATCH 7/7] vfio/{ap, ccw}: Use warn_report_err() for IRQ notifier registration errors Date: Wed, 22 May 2024 19:01:07 +0200 Message-ID: <20240522170107.289532-8-clg@redhat.com> In-Reply-To: <20240522170107.289532-1-clg@redhat.com> References: <20240522170107.289532-1-clg@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.1 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=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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 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: fail (Header signature does not verify) X-ZM-MESSAGEID: 1716397407722100001 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: Anthony Krowiak Reviewed-by: Eric Farman Reviewed-by: Thomas Huth Reviewed-by: Zhenzhong Duan --- 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 c12531a7886a2fe87598be0861fba5923bd2c206..0c4354e3e70169ec072e16da091= 9936647d1d351 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 36f2677a448c5e31523dcc3de7d973ec70e4a13c..1f8e1272c7555cd0a770481d1ae= 92988f6e2e62e 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.1