From nobody Wed Nov 12 07:06:20 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1568716062; cv=none; d=zoho.com; s=zohoarc; b=WWphoBndnoS4DQ7DqB/qyoLRXQLth0isOONcPm4umBdQv9uvIouMO4Y0ovc70X3bbZpp4/mb9cNkLrWUN7K9TdZn/h63hBlZFCTPGAyd8IY4PMRm3aR1YYsyLCEoNtRI49Lqv2KxEwM/h9LUwldMCLukUsBYeBdYBQuNS9oAa6U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568716062; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=gTL2ylAhV3CS37TM1uHZOZhCPa5SRTjU9r31eH2ack0=; b=fufh3nLK1LaBgHE8zINgUSPuRTmBSc6Px8fJ5hr1pVhF6ns3GcQ1LdVzA3a70Js0YR1YrZH0/5vfv9NKXLBLN/gP7zBKq8kGLwe6OubQ2T9NXNGDXMGmala625o9QIIclCRjtDK06L/WPHZFAh3oPJMc9wgHX9p78bQWE92rDs0= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1568716062343501.0694011768941; Tue, 17 Sep 2019 03:27:42 -0700 (PDT) Received: from localhost ([::1]:43730 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iAAhw-0003mM-TW for importer@patchew.org; Tue, 17 Sep 2019 06:27:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43916) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iAAcO-0007b8-Lj for qemu-devel@nongnu.org; Tue, 17 Sep 2019 06:21:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iAAcN-00040t-Ed for qemu-devel@nongnu.org; Tue, 17 Sep 2019 06:21:56 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:41276) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iAAcN-00040S-6c for qemu-devel@nongnu.org; Tue, 17 Sep 2019 06:21:55 -0400 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x8HAHEck118301 for ; Tue, 17 Sep 2019 06:21:54 -0400 Received: from e06smtp01.uk.ibm.com (e06smtp01.uk.ibm.com [195.75.94.97]) by mx0a-001b2d01.pphosted.com with ESMTP id 2v2wfs8gc2-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 17 Sep 2019 06:21:54 -0400 Received: from localhost by e06smtp01.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 17 Sep 2019 11:21:51 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp01.uk.ibm.com (192.168.101.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 17 Sep 2019 11:21:43 +0100 Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x8HALftR47054914 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 17 Sep 2019 10:21:41 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9BE1B42047; Tue, 17 Sep 2019 10:21:41 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A2B324203F; Tue, 17 Sep 2019 10:21:40 +0000 (GMT) Received: from bahia.lan (unknown [9.145.22.84]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 17 Sep 2019 10:21:40 +0000 (GMT) From: Greg Kurz To: qemu-devel@nongnu.org Date: Tue, 17 Sep 2019 12:21:40 +0200 In-Reply-To: <156871562997.196432.17776290406203122029.stgit@bahia.lan> References: <156871562997.196432.17776290406203122029.stgit@bahia.lan> User-Agent: StGit/unknown-version MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 x-cbid: 19091710-4275-0000-0000-000003678A50 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19091710-4276-0000-0000-00003879EF83 Message-Id: <156871570029.196432.9320869242034561567.stgit@bahia.lan> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-09-17_05:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1034 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=656 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1909170106 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] [PATCH 11/17] scsi: Pass local error object pointer to error_append_hint() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Peter Maydell , "Michael S. Tsirkin" , Jeff Cody , Mark Cave-Ayland , Michael Roth , Gerd Hoffmann , Subbaraya Sundeep , Juan Quintela , David Hildenbrand , Markus Armbruster , Halil Pasic , Christian Borntraeger , =?utf-8?q?Marc-Andr=C3=A9?= Lureau , David Gibson , "Daniel P. =?utf-8?q?Berrang=C3=A9=22?= , qemu-block@nongnu.org, qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org"@d06av24.portsmouth.uk.ibm.com, Eric Farman , "Dr. David Alan Gilbert" , Yuval Shaia , Alex Williamson , John Snow , Richard Henderson , Kevin Wolf , Cornelia Huck , Max Reitz , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Ensure that hints are added even if errp is &error_fatal or &error_abort. Signed-off-by: Greg Kurz --- hw/scsi/scsi-disk.c | 7 +++++-- hw/scsi/scsi-generic.c | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index 915641a0f1b4..3d5e257bb66b 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/scsi-disk.c @@ -2619,9 +2619,12 @@ static void scsi_block_realize(SCSIDevice *dev, Erro= r **errp) /* check we are using a driver managing SG_IO (version 3 and after) */ rc =3D blk_ioctl(s->qdev.conf.blk, SG_GET_VERSION_NUM, &sg_version); if (rc < 0) { - error_setg_errno(errp, -rc, "cannot get SG_IO version number"); + Error *local_err =3D NULL; + + error_setg_errno(&local_err, -rc, "cannot get SG_IO version number= "); if (rc !=3D -EPERM) { - error_append_hint(errp, "Is this a SCSI device?\n"); + error_append_hint(&local_err, "Is this a SCSI device?\n"); + error_propagate(errp, local_err); } goto out; } diff --git a/hw/scsi/scsi-generic.c b/hw/scsi/scsi-generic.c index e7798ebcd0d4..f6a5b538cbcc 100644 --- a/hw/scsi/scsi-generic.c +++ b/hw/scsi/scsi-generic.c @@ -674,9 +674,12 @@ static void scsi_generic_realize(SCSIDevice *s, Error = **errp) /* check we are using a driver managing SG_IO (version 3 and after */ rc =3D blk_ioctl(s->conf.blk, SG_GET_VERSION_NUM, &sg_version); if (rc < 0) { - error_setg_errno(errp, -rc, "cannot get SG_IO version number"); + Error *local_err =3D NULL; + + error_setg_errno(&local_err, -rc, "cannot get SG_IO version number= "); if (rc !=3D -EPERM) { - error_append_hint(errp, "Is this a SCSI device?\n"); + error_append_hint(&local_err, "Is this a SCSI device?\n"); + error_propagate(errp, local_err); } return; }