From nobody Fri May 3 04:32:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1597327533; cv=none; d=zohomail.com; s=zohoarc; b=c/Kz+wE1CqFM1KkY5ic8N5+oYg1PUMF44Eva15mqX1BCvzSh2J0s6QfeSyu5evoQ8yHNsh6/0PxWQPU4aJXNOMIODvB1TejBgZ1Cno8eH6RnIPQ1tWlCLU/41tZlS6JcOdidjmuiUZCeuOf5MPEHF7sPGMeeq5SUuJLtJxkJxgA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597327533; 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; bh=kf4lNc+KZMsm+sjp4yJMyXqkF6NWx4ldVGNCkW6qvds=; b=hpjP0shMj+vxa/60/xWOFvkHdnab8Fyw2YWc4/F+a7tU1apJ3oaWcFyKKOoxjm18mPkKaDb9H7amsFWE7LoCVNDgK4xvPKmDHZ3JghyakLr/UFeuNxqzCRY3bGgioXv6os+eCePenkFwxAZ4wKz2nzXlO3tBxAGtDzbKVUYUWoQ= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1597327533010611.0004024355565; Thu, 13 Aug 2020 07:05:33 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-10-M49pm_hkMTai6co9myfdDQ-1; Thu, 13 Aug 2020 10:05:29 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 78243100CFC4; Thu, 13 Aug 2020 14:05:23 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4F7DF19C78; Thu, 13 Aug 2020 14:05:23 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 176B64EE17; Thu, 13 Aug 2020 14:05:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 07DE4lDl017567 for ; Thu, 13 Aug 2020 10:04:48 -0400 Received: by smtp.corp.redhat.com (Postfix) id D472A1111A46; Thu, 13 Aug 2020 14:04:47 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CEE281111C9E for ; Thu, 13 Aug 2020 14:04:45 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 63ECA804C9D for ; Thu, 13 Aug 2020 14:04:45 +0000 (UTC) Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-270-17SVOZ8BPKmWTncKAxmEqQ-1; Thu, 13 Aug 2020 10:04:41 -0400 Received: from pps.filterd (m0127361.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 07DE3NRI033728 for ; Thu, 13 Aug 2020 10:04:40 -0400 Received: from ppma05fra.de.ibm.com (6c.4a.5195.ip4.static.sl-reverse.com [149.81.74.108]) by mx0a-001b2d01.pphosted.com with ESMTP id 32t93tb3t3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 13 Aug 2020 10:04:39 -0400 Received: from pps.filterd (ppma05fra.de.ibm.com [127.0.0.1]) by ppma05fra.de.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 07DE0ERM027528 for ; Thu, 13 Aug 2020 14:03:55 GMT Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by ppma05fra.de.ibm.com with ESMTP id 32skp83fkn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 13 Aug 2020 14:03:55 +0000 Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 07DE3qp319923224 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 13 Aug 2020 14:03:52 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CB16042049; Thu, 13 Aug 2020 14:03:52 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AB2E54204C; Thu, 13 Aug 2020 14:03:52 +0000 (GMT) Received: from localhost.localdomain (unknown [9.145.171.229]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 13 Aug 2020 14:03:52 +0000 (GMT) X-MC-Unique: M49pm_hkMTai6co9myfdDQ-1 X-MC-Unique: 17SVOZ8BPKmWTncKAxmEqQ-1 From: Boris Fiuczynski To: libvir-list@redhat.com Subject: [PATCH 1/3] qemu: avoid maybe-uninitialized warning by GCC 10 Date: Thu, 13 Aug 2020 16:03:44 +0200 Message-Id: <20200813140346.4284-2-fiuczy@linux.ibm.com> In-Reply-To: <20200813140346.4284-1-fiuczy@linux.ibm.com> References: <20200813140346.4284-1-fiuczy@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-08-13_12:2020-08-13, 2020-08-13 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=1 spamscore=0 malwarescore=0 adultscore=0 mlxscore=0 bulkscore=0 clxscore=1015 lowpriorityscore=0 mlxlogscore=878 impostorscore=0 phishscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008130106 X-MIME-Autoconverted: from 8bit to quoted-printable by mx0a-001b2d01.pphosted.com id 07DE3NRI033728 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false; X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 07DE4lDl017567 X-loop: libvir-list@redhat.com Cc: mhartmay@linux.ibm.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable GCC 10 complains about "well_formed_uri" may be used uninitialzed. Even though it is a false positive, we can easily avoid it. Avoiding ../src/qemu/qemu_migration.c: In function =E2=80=98qemuMigrationDstPrepar= eDirect=E2=80=99: ../src/qemu/qemu_migration.c:2920:16: error: =E2=80=98well_formed_uri=E2= =80=99 may be used uninitialized in this function [-Werror=3Dmaybe-uninitia= lized] 2920 | if (well_formed_uri) { | ^ Signed-off-by: Boris Fiuczynski Reviewed-by: Marc Hartmayer Reviewed-by: Erik Skultety --- src/qemu/qemu_migration.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 0f2f92b211..142faa2cf9 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -2886,7 +2886,7 @@ qemuMigrationDstPrepareDirect(virQEMUDriverPtr driver, =20 *uri_out =3D g_strdup_printf(incFormat, "tcp", hostname, port); } else { - bool well_formed_uri; + bool well_formed_uri =3D false; =20 if (!(uri =3D qemuMigrationAnyParseURI(uri_in, &well_formed_uri))) goto cleanup; --=20 2.25.1 From nobody Fri May 3 04:32:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1597327482; cv=none; d=zohomail.com; s=zohoarc; b=ni9S5EQkKhe9nkNSxBCq9S31OcIQsTiWspnAS0WQ86wWeb2Vg8IxzGkyYyKWRinjGDDrcYHTGTPPp/3M3DkRmEpbEJicuGffRCrCKrbZaIhYU34teEbRv2r2oEVAih5euH2rg3V981y61XrStQECMfabfkYCzRKid3gcqHvxnZQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597327482; 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; bh=+urRYcnQL8hsfRK6Fnq9VGD2cFvFXXe4fgbyKzWbp34=; b=kFtRYKxSMRi1/DmfXjT6G5yPTsKkXMSV7VbDeT+3nYHyP7mIkk3wilJ0tqK1Nv5ieT/yfbLYBzmq56UYOLMyQF8mb9yp8Rfi7XCYmgWtS0UCICexoIgMQKnkbY/59ifOpMZZvv+x3qQY6FbmR/ayU6j4L56n8asyBI9i69BAnrk= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1597327482061878.6223218494056; Thu, 13 Aug 2020 07:04:42 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-430-enQz5sQIPeyZBxtXpvKQ2Q-1; Thu, 13 Aug 2020 10:04:36 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DC616425CB; Thu, 13 Aug 2020 14:04:30 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BF99162A27; Thu, 13 Aug 2020 14:04:28 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 8E9D9181A870; Thu, 13 Aug 2020 14:04:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 07DE45a1017413 for ; Thu, 13 Aug 2020 10:04:05 -0400 Received: by smtp.corp.redhat.com (Postfix) id 20C2D2166B44; Thu, 13 Aug 2020 14:04:05 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1C18F2166BA0 for ; Thu, 13 Aug 2020 14:04:03 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6E9FA804C9D for ; Thu, 13 Aug 2020 14:04:03 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-61-q8TACZXSMh-75d47n01OdA-1; Thu, 13 Aug 2020 10:04:00 -0400 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 07DE2Z63014261 for ; Thu, 13 Aug 2020 10:03:59 -0400 Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 32w0nhk4sy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 13 Aug 2020 10:03:58 -0400 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 07DE0W1C008450 for ; Thu, 13 Aug 2020 14:03:56 GMT Received: from b06avi18878370.portsmouth.uk.ibm.com (b06avi18878370.portsmouth.uk.ibm.com [9.149.26.194]) by ppma04ams.nl.ibm.com with ESMTP id 32skp85mja-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 13 Aug 2020 14:03:55 +0000 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 07DE3rZm22675850 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 13 Aug 2020 14:03:53 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 02D8942049; Thu, 13 Aug 2020 14:03:53 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D75F64204B; Thu, 13 Aug 2020 14:03:52 +0000 (GMT) Received: from localhost.localdomain (unknown [9.145.171.229]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 13 Aug 2020 14:03:52 +0000 (GMT) X-MC-Unique: enQz5sQIPeyZBxtXpvKQ2Q-1 X-MC-Unique: q8TACZXSMh-75d47n01OdA-1 From: Boris Fiuczynski To: libvir-list@redhat.com Subject: [PATCH 2/3] tools: avoid potential null pointer dereference by GCC 10 Date: Thu, 13 Aug 2020 16:03:45 +0200 Message-Id: <20200813140346.4284-3-fiuczy@linux.ibm.com> In-Reply-To: <20200813140346.4284-1-fiuczy@linux.ibm.com> References: <20200813140346.4284-1-fiuczy@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-08-13_11:2020-08-13, 2020-08-13 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 impostorscore=0 suspectscore=1 malwarescore=0 adultscore=0 bulkscore=0 mlxlogscore=860 phishscore=0 spamscore=0 lowpriorityscore=0 clxscore=1015 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008130102 X-MIME-Autoconverted: from 8bit to quoted-printable by mx0a-001b2d01.pphosted.com id 07DE2Z63014261 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false; X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 07DE45a1017413 X-loop: libvir-list@redhat.com Cc: mhartmay@linux.ibm.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable GCC 10 complains about "arg" possibly being a NULL dereference. Even though it might be a false positive, we can easily avoid it. Avoiding ../tools/vsh.c: In function =E2=80=98vshCommandOptStringReq=E2=80=99: ../tools/vsh.c:1034:19: error: potential null pointer dereference [-Werror= =3Dnull-dereference] 1034 | else if (!*arg->data && !(arg->def->flags & VSH_OFLAG_EMPTY_OK= )) | ~~~^~~~~~ Signed-off-by: Boris Fiuczynski Reviewed-by: Marc Hartmayer Reviewed-by: Erik Skultety --- tools/vsh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/vsh.c b/tools/vsh.c index 5e2e3ac219..11f493f969 100644 --- a/tools/vsh.c +++ b/tools/vsh.c @@ -1031,7 +1031,7 @@ vshCommandOptStringReq(vshControl *ctl, /* this should not be propagated here, just to be sure */ if (ret =3D=3D -1) error =3D N_("Mandatory option not present"); - else if (!*arg->data && !(arg->def->flags & VSH_OFLAG_EMPTY_OK)) + else if (arg && !*arg->data && !(arg->def->flags & VSH_OFLAG_EMPTY_OK)) error =3D N_("Option argument is empty"); =20 if (error) { --=20 2.25.1 From nobody Fri May 3 04:32:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1597327481; cv=none; d=zohomail.com; s=zohoarc; b=AzbVXaeKElXnbl1QgdZpxfXQtmdK9OGQ7LFqvR41ZVgSdnFT4brrsBpzEf5oyQ/FEd4eu0PCk03x5o4KD/ZioWWgmeRAZ9ImChykONzNHXDhRi9xiPbERxuAG2axCahXzkj1gCWHZSP17yPlDaSaGTth6yUFVq6AbApe67ov8lY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597327481; 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; bh=/er7ZQPe6Prwfa4AsPNhG9PmBQa8GSNeuk/pQQta92Q=; b=KjlvG0DCx7Mql0Ha+gXYkFuD5BGcLprflboQgyHnErvr8l1EAA0mmc5q2xIqvOw6Gym72HvOJeOFihnv6qQfk5yIKd0g+hh1V54h0z7GxC5PKAcCpXoBwQt+19xBmXWCzkBkhUh0ezA8g/uRFA34/W+xDh5bAQBGG1XYBnTG0EY= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1597327481735542.6229863561693; Thu, 13 Aug 2020 07:04:41 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-491-vvgIaVPJPoyDEYgTR4MGsg-1; Thu, 13 Aug 2020 10:04:37 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DAAEE1014DF5; Thu, 13 Aug 2020 14:04:29 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B85F36FDA7; Thu, 13 Aug 2020 14:04:28 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 8E8954A7DB; Thu, 13 Aug 2020 14:04:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 07DE45Jb017412 for ; Thu, 13 Aug 2020 10:04:05 -0400 Received: by smtp.corp.redhat.com (Postfix) id 16F292166BA4; Thu, 13 Aug 2020 14:04:05 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 127C52166BA0 for ; Thu, 13 Aug 2020 14:04:03 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CB8F7101A540 for ; Thu, 13 Aug 2020 14:04:02 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-128-aP8l2IKIP4GlB_miSxXCmw-1; Thu, 13 Aug 2020 10:03:59 -0400 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 07DE20xQ079591 for ; Thu, 13 Aug 2020 10:03:58 -0400 Received: from ppma04fra.de.ibm.com (6a.4a.5195.ip4.static.sl-reverse.com [149.81.74.106]) by mx0a-001b2d01.pphosted.com with ESMTP id 32w30q7fyv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 13 Aug 2020 10:03:58 -0400 Received: from pps.filterd (ppma04fra.de.ibm.com [127.0.0.1]) by ppma04fra.de.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 07DE0QR8015534 for ; Thu, 13 Aug 2020 14:03:56 GMT Received: from b06avi18878370.portsmouth.uk.ibm.com (b06avi18878370.portsmouth.uk.ibm.com [9.149.26.194]) by ppma04fra.de.ibm.com with ESMTP id 32skp7ufh3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 13 Aug 2020 14:03:56 +0000 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 07DE3rge61932004 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 13 Aug 2020 14:03:53 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2FFD14204D; Thu, 13 Aug 2020 14:03:53 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1055B4204B; Thu, 13 Aug 2020 14:03:53 +0000 (GMT) Received: from localhost.localdomain (unknown [9.145.171.229]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 13 Aug 2020 14:03:52 +0000 (GMT) X-MC-Unique: vvgIaVPJPoyDEYgTR4MGsg-1 X-MC-Unique: aP8l2IKIP4GlB_miSxXCmw-1 From: Boris Fiuczynski To: libvir-list@redhat.com Subject: [PATCH 3/3] storage: avoid maybe-uninitialized warning by GCC 10 Date: Thu, 13 Aug 2020 16:03:46 +0200 Message-Id: <20200813140346.4284-4-fiuczy@linux.ibm.com> In-Reply-To: <20200813140346.4284-1-fiuczy@linux.ibm.com> References: <20200813140346.4284-1-fiuczy@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-08-13_11:2020-08-13, 2020-08-13 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 mlxscore=0 adultscore=0 clxscore=1015 lowpriorityscore=0 phishscore=0 suspectscore=1 impostorscore=0 mlxlogscore=924 spamscore=0 priorityscore=1501 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008130102 X-MIME-Autoconverted: from 8bit to quoted-printable by mx0a-001b2d01.pphosted.com id 07DE20xQ079591 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false; X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 07DE45Jb017412 X-loop: libvir-list@redhat.com Cc: mhartmay@linux.ibm.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.003 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable GCC 10 complains about variables may be used uninitialized. Even though it might be false positives, we can easily avoid them. Avoiding ../src/storage/storage_backend_iscsi_direct.c:634:11: error: =E2=80=98nb_b= lock=E2=80=99 may be used uninitialized in this function [-Werror=3Dmaybe-u= ninitialized] 634 | while (lba < nb_block) { | ^ ../src/storage/storage_backend_iscsi_direct.c:619:14: note: =E2=80=98nb_bl= ock=E2=80=99 was declared here 619 | uint64_t nb_block; | ^~~~~~~~ ../src/storage/storage_backend_iscsi_direct.c:637:16: error: =E2=80=98bloc= k_size=E2=80=99 may be used uninitialized in this function [-Werror=3Dmaybe= -uninitialized] 637 | task =3D iscsi_write16_sync(iscsi, lun, lba, data, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 638 | block_size * to_write, | ~~~~~~~~~~~~~~~~~~~~~~ 639 | block_size, 0, 0, 0, 0, 0); | ~~~~~~~~~~~~~~~~~~~~~~~~~~ ../src/storage/storage_backend_iscsi_direct.c:618:14: note: =E2=80=98block= _size=E2=80=99 was declared here 618 | uint32_t block_size; | ^~~~~~~~~~ ../src/storage/storage_backend_iscsi_direct.c: In function =E2=80=98virSto= rageBackendISCSIDirectRefreshPool=E2=80=99: ../src/storage/storage_backend_iscsi_direct.c:320:39: error: =E2=80=98nb_b= lock=E2=80=99 may be used uninitialized in this function [-Werror=3Dmaybe-u= ninitialized] 320 | vol->target.capacity =3D block_size * nb_block; | ~~~~~~~~~~~^~~~~~~~~~ ../src/storage/storage_backend_iscsi_direct.c:306:14: note: =E2=80=98nb_bl= ock=E2=80=99 was declared here 306 | uint64_t nb_block; | ^~~~~~~~ ../src/storage/storage_backend_iscsi_direct.c:320:39: error: =E2=80=98bloc= k_size=E2=80=99 may be used uninitialized in this function [-Werror=3Dmaybe= -uninitialized] 320 | vol->target.capacity =3D block_size * nb_block; | ~~~~~~~~~~~^~~~~~~~~~ ../src/storage/storage_backend_iscsi_direct.c:305:14: note: =E2=80=98block= _size=E2=80=99 was declared here 305 | uint32_t block_size; | ^~~~~~~~~~ Signed-off-by: Boris Fiuczynski Reviewed-by: Marc Hartmayer Reviewed-by: Erik Skultety --- src/storage/storage_backend_iscsi_direct.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/storage/storage_backend_iscsi_direct.c b/src/storage/stora= ge_backend_iscsi_direct.c index c37c671db6..027fa83de7 100644 --- a/src/storage/storage_backend_iscsi_direct.c +++ b/src/storage/storage_backend_iscsi_direct.c @@ -302,8 +302,8 @@ virISCSIDirectRefreshVol(virStoragePoolObjPtr pool, char *portal) { virStoragePoolDefPtr def =3D virStoragePoolObjGetDef(pool); - uint32_t block_size; - uint64_t nb_block; + uint32_t block_size =3D 0; + uint64_t nb_block =3D 0; g_autoptr(virStorageVolDef) vol =3D NULL; =20 if (virISCSIDirectTestUnitReady(iscsi, lun) < 0) @@ -615,8 +615,8 @@ virStorageBackendISCSIDirectVolWipeZero(virStorageVolDe= fPtr vol, struct iscsi_context *iscsi) { uint64_t lba =3D 0; - uint32_t block_size; - uint64_t nb_block; + uint32_t block_size =3D 0; + uint64_t nb_block =3D 0; struct scsi_task *task =3D NULL; int lun =3D 0; int ret =3D -1; --=20 2.25.1