From nobody Tue May 7 18:03:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1611829505; cv=none; d=zohomail.com; s=zohoarc; b=IYvRcsO/PxWRbNjThxP8CIhe+YsEGJuaW0Es0I5GTKPjgxdPwM4X4HleyB47mzDUa81d2ueVbONbUUMVIKgoyzgPd4U0wxe/zfR+gySEoojmOS+jIJTAhx4WuKrwV318DqN6PbecP8DoqyVe036USLc1S6fkpbTUr2XL8bOdFUM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611829505; 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=zHondSDWll4gHGndrLuGxcKyAXKQ+6wj3PujF1a9fEA=; b=mV3xTo1vgeXmi8C9N3Nbtx7GKq2WcKgKrCnadQ4VeCCAAKiL/1E9kJpzkM1mtX9YNCv07FUtMUL8R2g9AyF2tB4ilgXM+nOhPjir0akzrEpjYMkQayH7qf4jyawYxBOp0/WYRIBGiyaJ7FwBOsV7IfkIWShoKwMbecR68bN3z6I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1611829505910936.7544033142442; Thu, 28 Jan 2021 02:25:05 -0800 (PST) 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-299-mZXZZgAnMiSzv4p6VNICmA-1; Thu, 28 Jan 2021 05:25:02 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C45681934101; Thu, 28 Jan 2021 10:24:55 +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 53E2C1002C11; Thu, 28 Jan 2021 10:24:55 +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 A59EE5002C; Thu, 28 Jan 2021 10:24:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 10SAOlV8026572 for ; Thu, 28 Jan 2021 05:24:47 -0500 Received: by smtp.corp.redhat.com (Postfix) id 705E110023BE; Thu, 28 Jan 2021 10:24:47 +0000 (UTC) Received: from work.redhat.com (ovpn-112-226.ams2.redhat.com [10.36.112.226]) by smtp.corp.redhat.com (Postfix) with ESMTP id B4F4C10023BA; Thu, 28 Jan 2021 10:24:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611829504; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=zHondSDWll4gHGndrLuGxcKyAXKQ+6wj3PujF1a9fEA=; b=gK3gF0XLWeqM8IUU8McwypUCLK4CJ+hbZXgr3IG9HcMB/alVXbW1lTlGb/izIgE7H+QKyH Jk4elZhvsKHpqhvBgB76ZnLO5fWIDstii7Ac3V9JQw/sb8VhYW3MWJzqV0RKDoU6t1em6J liyXq0fBF2EaxuId9iSRQkmyaj0ytCk= X-MC-Unique: mZXZZgAnMiSzv4p6VNICmA-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 01/11] virfile: Remove redundant #ifndef Date: Thu, 28 Jan 2021 11:24:31 +0100 Message-Id: <20210128102441.20241-2-twiederh@redhat.com> In-Reply-To: <20210128102441.20241-1-twiederh@redhat.com> References: <20210128102441.20241-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This section is guarded by "#ifndef WIN32" in line 2109--2808. Found by clang-tidy's "readability-redundant-preprocessor" check. Signed-off-by: Tim Wiederhake Reviewed-by: Peter Krempa --- src/util/virfile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/virfile.c b/src/util/virfile.c index 609cafdd34..5201b7fb07 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -2632,7 +2632,7 @@ virDirCreateNoFork(const char *path, virReportSystemError(errno, _("stat of '%s' failed"), path); goto error; } -# ifndef WIN32 + if (((uid !=3D (uid_t) -1 && st.st_uid !=3D uid) || (gid !=3D (gid_t) -1 && st.st_gid !=3D gid)) && (chown(path, uid, gid) < 0)) { @@ -2641,7 +2641,7 @@ virDirCreateNoFork(const char *path, path, (unsigned int) uid, (unsigned int) gid); goto error; } -# endif /* !WIN32 */ + if (mode !=3D (mode_t) -1 && chmod(path, mode) < 0) { ret =3D -errno; virReportSystemError(errno, --=20 2.26.2 From nobody Tue May 7 18:03:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1611829529; cv=none; d=zohomail.com; s=zohoarc; b=c6P7ZuCsseRzsYrtTsWmAgzh5YSPG/yR7N//ZAha7rezp9YqDA0ASYts7t6+omDuG/HLS+LM3oYLiGPRlKvNgDuoVbsO85CSu7HXgsNgdGxXlAcbmUJ3XH7Q7wYnmuPJaP/uEGrDW0G/TbqApg/0/TNsl4QcV3GbmHUYjTytz9k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611829529; 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=lMMbDtI03mUAm2mY8v3d8keOFgSKKTpceTboeUWCHAA=; b=mSeU+KaFgq5fJFx8QjHfU8IsWqzGthjRlorPOlqFdlzVpptnJEetevZqEfirEi3v909aJgh0WJh3QBmmGM1/0qtqF6Mh4KgCcfMRVx/Yd3DV4QL5yH2np+BhZ0cGR7yKBA+IR4v+LC18RNnn8IYWLBTjGOQ9j6GdKAWDZ+ECauk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1611829529607587.6301427254092; Thu, 28 Jan 2021 02:25:29 -0800 (PST) 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-154-ggWfrpepO4-fSDdYG98APQ-1; Thu, 28 Jan 2021 05:25:24 -0500 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 417CF6E3AB; Thu, 28 Jan 2021 10:25:18 +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 1DB1E779CF; Thu, 28 Jan 2021 10:25:18 +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 DDA0750030; Thu, 28 Jan 2021 10:25:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 10SAOmqq026580 for ; Thu, 28 Jan 2021 05:24:48 -0500 Received: by smtp.corp.redhat.com (Postfix) id 8F81F10023BA; Thu, 28 Jan 2021 10:24:48 +0000 (UTC) Received: from work.redhat.com (ovpn-112-226.ams2.redhat.com [10.36.112.226]) by smtp.corp.redhat.com (Postfix) with ESMTP id C4CF410027A5; Thu, 28 Jan 2021 10:24:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611829526; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=lMMbDtI03mUAm2mY8v3d8keOFgSKKTpceTboeUWCHAA=; b=S6agab6YBJKwCXt4ipBSMW/vIR7XXSIsywKWUzr0PmfxSoPjpFi/4sjBuhERVRTX3KrR14 GxXIOil2HFUiZroLas8RpPky135DBl/dxtoEnaLafzwr4yORGqYKdBH79PwFvKdk2EhGpp 66T1WUoUicy48xpyQPjDmIOTevVkmQo= X-MC-Unique: ggWfrpepO4-fSDdYG98APQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 02/11] xen: Fix indentation in xenParseXLSpice Date: Thu, 28 Jan 2021 11:24:32 +0100 Message-Id: <20210128102441.20241-3-twiederh@redhat.com> In-Reply-To: <20210128102441.20241-1-twiederh@redhat.com> References: <20210128102441.20241-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This was found by clang-tidy's "readability-misleading-indentation" check. Signed-off-by: Tim Wiederhake Reviewed-by: Peter Krempa --- src/libxl/xen_xl.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/libxl/xen_xl.c b/src/libxl/xen_xl.c index 621ee63a99..6dcba43fe0 100644 --- a/src/libxl/xen_xl.c +++ b/src/libxl/xen_xl.c @@ -359,9 +359,8 @@ xenParseXLSpice(virConfPtr conf, virDomainDefPtr def) =20 graphics->data.spice.port =3D (int)port; =20 - if (!graphics->data.spice.tlsPort && - !graphics->data.spice.port) - graphics->data.spice.autoport =3D 1; + if (!graphics->data.spice.tlsPort && !graphics->data.spice.por= t) + graphics->data.spice.autoport =3D 1; =20 if (xenConfigGetBool(conf, "spicedisable_ticketing", &val, 0) = < 0) goto cleanup; --=20 2.26.2 From nobody Tue May 7 18:03:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1611829639; cv=none; d=zohomail.com; s=zohoarc; b=Odz8US8AyVUl0tHtHzbK8Ao4HfZvrdFNgvdK8OAYa06kA738BJHmTUIKW+TZ9NR7rR9T2mHivu4xVISYJ/TSm6/vdANNlnzgEweuJ85hv7aCnx/2QnmVvOoq0UbYAPjK/2xDH6NZOc0Wq5tboLzC80r7EEs8UsJ216NuMeQ1Lsk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611829639; 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=cnsFMOJ/ot7FfzP1GrL40DJAWLRVhxUpM2oYJhd2K1w=; b=oE7OjBXZIT0+d8oRT8ukKKChkJXmVf9SrezConMJFhgB1yRTuraKfUzHk05LXcYWoIUvQvxGLbVcL98jr+mNTU6Fcs8umbl47Awob9TSB7+ZoyLuhoKFBVmDCnWJsVRGJewmOqH7N7v8TLkdbCHoZRr9prm3pKTjIoE2ccY2DCw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1611829639612953.9059993012502; Thu, 28 Jan 2021 02:27:19 -0800 (PST) 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-588-P4L4GwP0POm3xI--6PnD8Q-1; Thu, 28 Jan 2021 05:27:16 -0500 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 C86879122B; Thu, 28 Jan 2021 10:27:11 +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 A09641F041; Thu, 28 Jan 2021 10:27:11 +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 65FD41809CA1; Thu, 28 Jan 2021 10:27:11 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 10SAOnIc026588 for ; Thu, 28 Jan 2021 05:24:49 -0500 Received: by smtp.corp.redhat.com (Postfix) id 9F5A610023BE; Thu, 28 Jan 2021 10:24:49 +0000 (UTC) Received: from work.redhat.com (ovpn-112-226.ams2.redhat.com [10.36.112.226]) by smtp.corp.redhat.com (Postfix) with ESMTP id E331810023BA; Thu, 28 Jan 2021 10:24:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611829638; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=cnsFMOJ/ot7FfzP1GrL40DJAWLRVhxUpM2oYJhd2K1w=; b=DrJe0dJRgDE+RAyAhHNqhozAESE1OnMWavppUWTJ08zWWuq7rdDI5dl2XRXnFu/cZmdOjM wpQsT4hukK8h40UJG9kRl3EcVwcNkS1ZBvfGrsQVnt5A3ZL4g04wI0WLZY/SjSSbkXEFk+ GzlJFYdT0Sw3vh+KIWMdLGO5wq5SgHQ= X-MC-Unique: P4L4GwP0POm3xI--6PnD8Q-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 03/11] qemu_tpm: Fix indentation in qemuTPMEmulatorBuildCommand Date: Thu, 28 Jan 2021 11:24:33 +0100 Message-Id: <20210128102441.20241-4-twiederh@redhat.com> In-Reply-To: <20210128102441.20241-1-twiederh@redhat.com> References: <20210128102441.20241-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This was found by clang-tidy's "readability-misleading-indentation" check. Signed-off-by: Tim Wiederhake Reviewed-by: Peter Krempa --- src/qemu/qemu_tpm.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_tpm.c b/src/qemu/qemu_tpm.c index 532e0912bd..f94cad8230 100644 --- a/src/qemu/qemu_tpm.c +++ b/src/qemu/qemu_tpm.c @@ -600,9 +600,11 @@ qemuTPMEmulatorBuildCommand(virDomainTPMDefPtr tpm, } =20 pwdfile_fd =3D qemuTPMSetupEncryption(tpm->data.emulator.secretuui= d, cmd); - if (pwdfile_fd) - migpwdfile_fd =3D qemuTPMSetupEncryption(tpm->data.emulator.secret= uuid, - cmd); + if (pwdfile_fd) { + migpwdfile_fd =3D qemuTPMSetupEncryption(tpm->data.emulator.se= cretuuid, + cmd); + } + if (pwdfile_fd < 0 || migpwdfile_fd < 0) goto error; =20 --=20 2.26.2 From nobody Tue May 7 18:03:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1611829530; cv=none; d=zohomail.com; s=zohoarc; b=Ys2bRej8fgM3lWFKIthuq8iECwfCTc/zqi0MAY8LdE4/dcGw71C7lsruKbZvepI46pnpC4zYuI/Pste79LB1UPH4jey0BaKud75tCS54rLgvjGV1BNTMvICiRK49pu9UinWt/iR5HyRyQ6vOwFgl6aMacX3y6PHSMJFgsIWAJoo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611829530; 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=bH2KIL31+P5eEC+UaXMZ2NG9yEu2eZG+zEi+9sWpPHA=; b=BUxSCjbfX5K4nyx3shPNxO+7KCiCN98R5lGULtZXDDZDwnrAxYA8LMyHrINL4rEu2SgSBWSDpV+I1pA8/jvoesTPv3zpGDDngwwyYM7S2NZKJU0MYaMIvlgb4msyH/j4012Pqi3BQ7a9Hi5qABFhrZ63MQM2hpAjbsHk+H6kSGU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1611829530527394.22382568473313; Thu, 28 Jan 2021 02:25:30 -0800 (PST) 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-306-eWEuDgOWNrWfWHeIFdx7DA-1; Thu, 28 Jan 2021 05:25:27 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 07DB3107ACF9; Thu, 28 Jan 2021 10:25:22 +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 D40A861461; Thu, 28 Jan 2021 10:25:21 +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 9CE6F1809C9F; Thu, 28 Jan 2021 10:25:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 10SAOo1e026594 for ; Thu, 28 Jan 2021 05:24:50 -0500 Received: by smtp.corp.redhat.com (Postfix) id AB1A510023BD; Thu, 28 Jan 2021 10:24:50 +0000 (UTC) Received: from work.redhat.com (ovpn-112-226.ams2.redhat.com [10.36.112.226]) by smtp.corp.redhat.com (Postfix) with ESMTP id F0E7910023BA; Thu, 28 Jan 2021 10:24:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611829529; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=bH2KIL31+P5eEC+UaXMZ2NG9yEu2eZG+zEi+9sWpPHA=; b=EGGvdM4TskyxzmZToavH7OU/2TVHoSUjyaFdoTESSWpRryoFiuqmGVmDYWINF1VmuIsZpV o0YYJlfmFpBBrg0H2NDU6erJ/NkMJN2ejfpnesAfS2ug9KniTqIYYNMQU54rhgWc2SYxPn 9PgaCWey+vsytFoyD/n0cKLaPRPr+TY= X-MC-Unique: eWEuDgOWNrWfWHeIFdx7DA-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 04/11] virsh-domain: Fix error handling of pthread_sigmask Date: Thu, 28 Jan 2021 11:24:34 +0100 Message-Id: <20210128102441.20241-5-twiederh@redhat.com> In-Reply-To: <20210128102441.20241-1-twiederh@redhat.com> References: <20210128102441.20241-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" pthread_sigmask() returns 0 on success and "a non-zero value on failure", but not neccessarily a negative one. Found by clang-tidy's "bugprone-posix-return" check. Signed-off-by: Tim Wiederhake Reviewed-by: Peter Krempa --- tools/virsh-domain.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 2bb136333f..298c3a6587 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -4226,7 +4226,7 @@ doSave(void *opaque) =20 sigemptyset(&sigmask); sigaddset(&sigmask, SIGINT); - if (pthread_sigmask(SIG_BLOCK, &sigmask, &oldsigmask) < 0) + if (pthread_sigmask(SIG_BLOCK, &sigmask, &oldsigmask) !=3D 0) goto out_sig; #endif /* !WIN32 */ =20 @@ -4756,7 +4756,7 @@ doManagedsave(void *opaque) =20 sigemptyset(&sigmask); sigaddset(&sigmask, SIGINT); - if (pthread_sigmask(SIG_BLOCK, &sigmask, &oldsigmask) < 0) + if (pthread_sigmask(SIG_BLOCK, &sigmask, &oldsigmask) !=3D 0) goto out_sig; #endif /* !WIN32 */ =20 @@ -5438,7 +5438,7 @@ doDump(void *opaque) =20 sigemptyset(&sigmask); sigaddset(&sigmask, SIGINT); - if (pthread_sigmask(SIG_BLOCK, &sigmask, &oldsigmask) < 0) + if (pthread_sigmask(SIG_BLOCK, &sigmask, &oldsigmask) !=3D 0) goto out_sig; #endif /* !WIN32 */ =20 @@ -10732,7 +10732,7 @@ doMigrate(void *opaque) =20 sigemptyset(&sigmask); sigaddset(&sigmask, SIGINT); - if (pthread_sigmask(SIG_BLOCK, &sigmask, &oldsigmask) < 0) + if (pthread_sigmask(SIG_BLOCK, &sigmask, &oldsigmask) !=3D 0) goto out_sig; #endif /* !WIN32 */ =20 --=20 2.26.2 From nobody Tue May 7 18:03:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1611829644; cv=none; d=zohomail.com; s=zohoarc; b=luOVngXSEQLsfsy0stIylMNOyURC0RJ1dIzK1XnzIe2glp9Fq+rFKCOdROuR3oX9zko+eRbUeFM6lJUfV40I+6xrs3j3XGU1fJcd7b1qgbL67UPOYlk5gbP1CyTLNaBb6j6PNxrup26lZgl7bQn759JL+HhWjX00a7IfJ+b0Txk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611829644; 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=AxcCmyo4fpWTR2rPjggK4KgOAS763+Gi45p0WMx/jjw=; b=fnMeIauHJuSylaLX2JIm8UA1t0NXnxKyfiYDorgNIA35fBbFPAMhgEHmlu61IzWuW4oUqIMVA7/uRTO9anTfZJeQIuKAYlayBb8pfOYTYixtTdKOC2kiSVET05s6LYTzNwmoaXHV4c15d0erY2k4aiMwSGsg4A8gPge6Bc6w3h8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1611829644871215.63498741550745; Thu, 28 Jan 2021 02:27:24 -0800 (PST) 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-11-TosHRVHCMmS8Ov9r5LC6PQ-1; Thu, 28 Jan 2021 05:27:21 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BB7BE107ACE3; Thu, 28 Jan 2021 10:27:15 +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 964D010023BA; Thu, 28 Jan 2021 10:27:15 +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 5D8B64A7C6; Thu, 28 Jan 2021 10:27:15 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 10SAOpJj026606 for ; Thu, 28 Jan 2021 05:24:51 -0500 Received: by smtp.corp.redhat.com (Postfix) id BF9DC10023BD; Thu, 28 Jan 2021 10:24:51 +0000 (UTC) Received: from work.redhat.com (ovpn-112-226.ams2.redhat.com [10.36.112.226]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0CD0710023BA; Thu, 28 Jan 2021 10:24:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611829643; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=AxcCmyo4fpWTR2rPjggK4KgOAS763+Gi45p0WMx/jjw=; b=JBh9t3/7xoAfYAs1xzkY8DV7IorNKYZKWP8YiQb0YF/ttgGSarrZvtaxnqTRNJZhBuaOGs Ta+HMoBWnr/IW76Lt3J2kM9e8KP5/dPXoPEqkctX6bxM/M7viUj3L44ZY00osrtMsb0rIM gRl9oy+ISkVzIDh+/6YwHXZ3q2BLkrE= X-MC-Unique: TosHRVHCMmS8Ov9r5LC6PQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 05/11] Replace bzero() with memset() Date: Thu, 28 Jan 2021 11:24:35 +0100 Message-Id: <20210128102441.20241-6-twiederh@redhat.com> In-Reply-To: <20210128102441.20241-1-twiederh@redhat.com> References: <20210128102441.20241-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This was found by clang-tidy's "clang-analyzer-security.insecureAPI.bzero" check. Signed-off-by: Tim Wiederhake Reviewed-by: Peter Krempa --- src/util/virarptable.c | 2 +- tests/virpcimock.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/virarptable.c b/src/util/virarptable.c index d62de5e3dd..dac3486470 100644 --- a/src/util/virarptable.c +++ b/src/util/virarptable.c @@ -120,7 +120,7 @@ virArpTableGet(void) table->n =3D num + 1; =20 addr =3D RTA_DATA(tb[NDA_DST]); - bzero(&virAddr, sizeof(virAddr)); + memset(&virAddr, 0, sizeof(virAddr)); virAddr.len =3D sizeof(virAddr.data.inet4); virAddr.data.inet4.sin_family =3D AF_INET; virAddr.data.inet4.sin_addr =3D *(struct in_addr *)addr; diff --git a/tests/virpcimock.c b/tests/virpcimock.c index 4aa96cae08..f6280fc8b5 100644 --- a/tests/virpcimock.c +++ b/tests/virpcimock.c @@ -233,7 +233,7 @@ pci_read_file(const char *path, if ((fd =3D real_open(newpath, O_RDWR)) < 0) goto cleanup; =20 - bzero(buf, buf_size); + memset(buf, 0, buf_size); if (saferead(fd, buf, buf_size - 1) < 0) { STDERR("Unable to read from %s", newpath); goto cleanup; --=20 2.26.2 From nobody Tue May 7 18:03:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1611829533; cv=none; d=zohomail.com; s=zohoarc; b=dVsJ5RbwHH/mWp3AYIY/oQEcEaO4AHY1B0Qt/2cXoJ0kjy1NCgc2f26iS1chE08B2PziS6JNT7jw832bCabzsAjdQLKGVpGMABwDBAkVR0LgLp3J1tMxp1ygMdzjGuvI3rdx9jltJh1qRYhLOiMD0CPV+Vcpo7tIig2oXLvG3pk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611829533; 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=Y6hHAHtYbQqbBNq9QhSYz9yqbyOnnUXYFlLlbG3b6/c=; b=YzvgEfNOJ5uRyMcYf191DOI0L1veNN92NTmyEA4+rTL8fNsCbRXJnACh2W3oD0XzqIcqgOPjo0jO+3TxB/yiI6TM/zYgKtuukcjJ1HqDJy/Vk1lPHfZabFrjU6J+mTfomoEJfznCucmnlFbBkSwljqz6zybm3MQvGHzVkUMvKhI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1611829533387491.5509844756132; Thu, 28 Jan 2021 02:25:33 -0800 (PST) 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-160-uTVRd8OEP7aEK5tDRPsRug-1; Thu, 28 Jan 2021 05:25:30 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C50F71936B66; Thu, 28 Jan 2021 10:25:24 +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 A1BD760C6A; Thu, 28 Jan 2021 10:25:24 +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 613E21809CA3; Thu, 28 Jan 2021 10:25:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 10SAOqAR026617 for ; Thu, 28 Jan 2021 05:24:52 -0500 Received: by smtp.corp.redhat.com (Postfix) id CE8C810023BA; Thu, 28 Jan 2021 10:24:52 +0000 (UTC) Received: from work.redhat.com (ovpn-112-226.ams2.redhat.com [10.36.112.226]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1DCEA10027A5; Thu, 28 Jan 2021 10:24:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611829532; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Y6hHAHtYbQqbBNq9QhSYz9yqbyOnnUXYFlLlbG3b6/c=; b=A+NbH6f0XkEO2M2Ut9vWOG8gddllOlqaEQE5tSQFCdDxDiE7w9uH9KR9AXqQ4WTQenmEsP AGRsAnHNSyqNDVK+YzpYtp6kzdIHTmVD9n68pltir0tkSwsApVUWsuewuQjJuM3rr86yeO FtliTSVQO7KmmIYV1rmcXU3zLtvkZ20= X-MC-Unique: uTVRd8OEP7aEK5tDRPsRug-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 06/11] udevGetIntSysfsAttr: Return -1 for missing attributes Date: Thu, 28 Jan 2021 11:24:36 +0100 Message-Id: <20210128102441.20241-7-twiederh@redhat.com> In-Reply-To: <20210128102441.20241-1-twiederh@redhat.com> References: <20210128102441.20241-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" If "udevGetDeviceSysfsAttr()" returns NULL, "udevGetIntSysfsAttr" would return "0", indicating success, without writing to "value". This was found by clang-tidy's "clang-analyzer-core.UndefinedBinaryOperatorResult" check in function "udevProcessCCW", flagging a read on the potentially uninitialized variable "online". Signed-off-by: Tim Wiederhake Reviewed-by: Peter Krempa --- src/node_device/node_device_udev.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_devi= ce_udev.c index 55a2731681..d5a12bab0e 100644 --- a/src/node_device/node_device_udev.c +++ b/src/node_device/node_device_udev.c @@ -254,7 +254,10 @@ udevGetIntSysfsAttr(struct udev_device *udev_device, =20 str =3D udevGetDeviceSysfsAttr(udev_device, attr_name); =20 - if (str && virStrToLong_i(str, NULL, base, value) < 0) { + if (!str) + return -1; + + if (virStrToLong_i(str, NULL, base, value) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("Failed to convert '%s' to int"), str); return -1; --=20 2.26.2 From nobody Tue May 7 18:03:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1611829536; cv=none; d=zohomail.com; s=zohoarc; b=Iv5WA1XDQh1fNpnk6xMm6vENy9b83B/pKLBslRNykNYxW5wsyZJII1UWcwTLHxxQxLhwrkdPSz1exUCLG6aig1aXcGMDZDFP9mTStjwUHsQpz1gKiyz4mddW7wiUweD8PJlqWSoKwcmsrDyJt9YYqoc2zeGVadD2kvUrU7Lzp04= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611829536; 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=lkVSmdtqJ0m4WqNIT78YytfxGojFPn80DU8l6Z15Ayo=; b=UoXHYFpF0xjwNWCRxMmpbTrNCX9r6LR9lY/J8IzklFMEejOhqm7hkmTIXdewdudtqEUdeHVrW0dJ3xaCplKAThMd5EWhoGAq36C/dM90K8AaX1AeO+BUCsD8fCuoakbbiE7ykAfXuli4ZF8j3MxM6jLT3de6hawn2TIsqPG8ZcM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1611829536657505.8364014296152; Thu, 28 Jan 2021 02:25:36 -0800 (PST) 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-500-5nqumeCVNZ-Its-D0KVbVg-1; Thu, 28 Jan 2021 05:25:33 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BA6EE107ACE3; Thu, 28 Jan 2021 10:25:27 +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 985F75D9EF; Thu, 28 Jan 2021 10:25:27 +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 626A350034; Thu, 28 Jan 2021 10:25:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 10SAOrOQ026624 for ; Thu, 28 Jan 2021 05:24:53 -0500 Received: by smtp.corp.redhat.com (Postfix) id E148210023BD; Thu, 28 Jan 2021 10:24:53 +0000 (UTC) Received: from work.redhat.com (ovpn-112-226.ams2.redhat.com [10.36.112.226]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2F02C10023BA; Thu, 28 Jan 2021 10:24:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611829535; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=lkVSmdtqJ0m4WqNIT78YytfxGojFPn80DU8l6Z15Ayo=; b=PDk9aNaEda2P95JL5C14xAidCZGFI/XsJEqPpHSuECHq1Da4mDJWlNQYdEIREBBXsLbV6y qlQDGXjztQ1mMvR207FS0gJKYcjhDRQPWH6FNlKbKRqRAymzgJ89Fh1XrIRD5M19UqL6fO HzwZ3B+DwKGNrPiUyPxntxqxEvtdmE4= X-MC-Unique: 5nqumeCVNZ-Its-D0KVbVg-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 07/11] virhostuptime: Fix rounding in uptime calculation Date: Thu, 28 Jan 2021 11:24:37 +0100 Message-Id: <20210128102441.20241-8-twiederh@redhat.com> In-Reply-To: <20210128102441.20241-1-twiederh@redhat.com> References: <20210128102441.20241-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" "f + 0.5" does not round correctly for values very close to ".5" for every integer multiple, e.g. "0.499999975". Found by clang-tidy's "bugprone-incorrect-roundings" check. Signed-off-by: Tim Wiederhake Reviewed-by: Peter Krempa --- src/util/virhostuptime.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/util/virhostuptime.c b/src/util/virhostuptime.c index 696a38fbb5..7508a5a9b6 100644 --- a/src/util/virhostuptime.c +++ b/src/util/virhostuptime.c @@ -32,6 +32,8 @@ #include "virtime.h" #include "virthread.h" =20 +#include + #define VIR_FROM_THIS VIR_FROM_NONE =20 VIR_LOG_INIT("util.virhostuptime"); @@ -76,7 +78,7 @@ virHostGetBootTimeProcfs(unsigned long long *btime) return -EINVAL; } =20 - *btime =3D now / 1000 - up + 0.5; + *btime =3D llround(now / 1000 - up); =20 return 0; } --=20 2.26.2 From nobody Tue May 7 18:03:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1611829649; cv=none; d=zohomail.com; s=zohoarc; b=euHbwwV4Pev7drvXuA3Z5QNG45YOV+xWQzPIJBLAeGL5GZWz7n3u9/4bnjDxgcEdYw1zeX3QT0AW7zib4YyEGxEHtnLi8Gtj40Vruc+7HXdfR4mEhII3D1l2ms2CFXKrgzIrc/pUFWN7A6hdA91zHcM0R9KPc4D4PS5L2av+g0U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611829649; 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=sF+P/nAQ/ZYpIxhHLIs1TmEMiUR7MGK6AgT9TIwzibs=; b=aXdGVbQdJUNurhEEAxGsyw7h5L20XwGo+IP0fFICjKDFVC4gVLhuLXdvnrZzIs0nQ7uty/iNmGFZAXXBmG94psfujBiSqhQQBCstIBjVBP6uaqgv+Im8DoSnQyov8fbSwRDnZiYCeQyuSb0osso9nyodDTLT69zq0KV7RA2cyng= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1611829649868439.7293231302307; Thu, 28 Jan 2021 02:27:29 -0800 (PST) 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-181-9gHAyih6OOiQlfNnnnWwHg-1; Thu, 28 Jan 2021 05:27:24 -0500 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 02406107ACF9; Thu, 28 Jan 2021 10:27:19 +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 CCA951F045; Thu, 28 Jan 2021 10:27:18 +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 931D51809C9F; Thu, 28 Jan 2021 10:27:18 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 10SAOsCc026629 for ; Thu, 28 Jan 2021 05:24:55 -0500 Received: by smtp.corp.redhat.com (Postfix) id EF5AF10023BD; Thu, 28 Jan 2021 10:24:54 +0000 (UTC) Received: from work.redhat.com (ovpn-112-226.ams2.redhat.com [10.36.112.226]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4146310023BA; Thu, 28 Jan 2021 10:24:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611829646; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=sF+P/nAQ/ZYpIxhHLIs1TmEMiUR7MGK6AgT9TIwzibs=; b=aTznyAskZM2k1mmgtQdbNE5xxkmsr/+gnZsIasENf6dwuc8VObVLuEPNud7KypVZZ/z1DF 59Wz2KEnFrrtaklrzBCvSXvmueM7kLLosY+uCIb2sFtLhiRNuFPY2lXTnsrkA9hyupiK25 Du8tDxNsLUlO7exy95fweNt8ufvqzGQ= X-MC-Unique: 9gHAyih6OOiQlfNnnnWwHg-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 08/11] tests: Prevent malloc with size 0 Date: Thu, 28 Jan 2021 11:24:38 +0100 Message-Id: <20210128102441.20241-9-twiederh@redhat.com> In-Reply-To: <20210128102441.20241-1-twiederh@redhat.com> References: <20210128102441.20241-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Found by clang-tidy's "clang-analyzer-optin.portability.UnixAPI" check. Signed-off-by: Tim Wiederhake Reviewed-by: Peter Krempa --- tests/commandhelper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/commandhelper.c b/tests/commandhelper.c index ba5681b715..9394a42726 100644 --- a/tests/commandhelper.c +++ b/tests/commandhelper.c @@ -99,7 +99,7 @@ int main(int argc, char **argv) { origenv++; } =20 - if (!(newenv =3D malloc(sizeof(*newenv) * n))) + if ((n =3D=3D 0) || !(newenv =3D malloc(sizeof(*newenv) * n))) abort(); =20 origenv =3D environ; --=20 2.26.2 From nobody Tue May 7 18:03:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1611829533; cv=none; d=zohomail.com; s=zohoarc; b=bK6qfkNSuFG18wuBFNh9gridpA0RZWLre88EceFqzUmgi95FJAEosEBEzuW60KohXNtNs8C7IfZmu9Q2x1F0hvKlNFNoDAkbI6fZBL3ZmfC8I+1HK3Emq6vbEnE/5f3nvemdKNVMKfOc9FoYNQI08pKnZQ3YHwwuhBCdNHeOXZ8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611829533; 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=vIPnCpIWfd20xQA3QMxgbk5BNBS8pe6lTNid/HxJ5vM=; b=fa5sq9jl5Oz2ttljvXule8EI5SLtX781zMl9fVZqNeujF2ScMVDgptuXXmNM1DBqPo+djoe4CzTWgKWh8yiM/9rXSHrV71aKtSGDjf+dajNt5TxeDaFeMZRjdJ1Vl+C4+IsxfKXaBASKhDU0UsU+AIBZTzbSFV0NTpLEZQydG3Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1611829533231993.4266997806653; Thu, 28 Jan 2021 02:25:33 -0800 (PST) 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-131-pgT7vKu4Nc--Vn61lI9urA-1; Thu, 28 Jan 2021 05:25:30 -0500 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 182C88145EC; Thu, 28 Jan 2021 10:25:22 +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 E438F19726; Thu, 28 Jan 2021 10:25:21 +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 A834C50033; Thu, 28 Jan 2021 10:25:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 10SAOuKt026637 for ; Thu, 28 Jan 2021 05:24:56 -0500 Received: by smtp.corp.redhat.com (Postfix) id 0DE5010023BD; Thu, 28 Jan 2021 10:24:56 +0000 (UTC) Received: from work.redhat.com (ovpn-112-226.ams2.redhat.com [10.36.112.226]) by smtp.corp.redhat.com (Postfix) with ESMTP id 507E110027A5; Thu, 28 Jan 2021 10:24:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611829532; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=vIPnCpIWfd20xQA3QMxgbk5BNBS8pe6lTNid/HxJ5vM=; b=Tu2+84P/VBPxoMV/4ycw/q5WAg1GnfcraUnySATtZtNq3O4ByJYujd1ElL+ZOga+8Q0gU2 aUH5UtZcUlIn752egoCBP0q4guAFrhZcH/BO1xYIJ99OYZBJHdtbx/JD/vBRuYlXyGes/o nTkxydU095RigrLJr2XnM0xbfUcDeJE= X-MC-Unique: pgT7vKu4Nc--Vn61lI9urA-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 09/11] vircryptotest: Directly assign string to avoid memcpy Date: Thu, 28 Jan 2021 11:24:39 +0100 Message-Id: <20210128102441.20241-10-twiederh@redhat.com> In-Reply-To: <20210128102441.20241-1-twiederh@redhat.com> References: <20210128102441.20241-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Found by clang-tidy's "bugprone-not-null-terminated-result" check. clang-tidy's finding is a false positive in this case, as the memset call guarantees null termination. The assignment can be simplified though, and this happens to silence the warning. Signed-off-by: Tim Wiederhake Reviewed-by: Peter Krempa --- tests/vircryptotest.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/vircryptotest.c b/tests/vircryptotest.c index 90140077cf..2c3d4bfe75 100644 --- a/tests/vircryptotest.c +++ b/tests/vircryptotest.c @@ -122,7 +122,7 @@ static int mymain(void) { int ret =3D 0; - uint8_t secretdata[8]; + uint8_t secretdata[8] =3D "letmein"; uint8_t expected_ciphertext[16] =3D {0x48, 0x8e, 0x9, 0xb9, 0x6a, 0xa6, 0x24, 0x5f, 0x1b, 0x8c, 0x3f, 0x48, @@ -166,9 +166,6 @@ mymain(void) ret =3D -1; \ } while (0) =20 - memset(&secretdata, 0, 8); - memcpy(&secretdata, "letmein", 7); - VIR_CRYPTO_ENCRYPT(VIR_CRYPTO_CIPHER_AES256CBC, "aes265cbc", secretdata, 7, expected_ciphertext, 16); =20 --=20 2.26.2 From nobody Tue May 7 18:03:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1611829650; cv=none; d=zohomail.com; s=zohoarc; b=igX/+K9cBwgdCwWFokIX35tRUiIP9Wxi3/ADOkQpsOGvfECCweZ5079k13xk/Xr7dFMmHv5CtKoRPWr96Qqz6BkVvwqqepPVhuNQXC+NRj3zNHmyfTKAu12HaUptg13c8HqTHCfOif/7O61K7W5Nnqvu105oCVkmeKJ7jFrPc+w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611829650; 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=h/yt9NwImjZidWX7Ip7Cgop4JLTA2RvjKBJIS430vLM=; b=JKDqNJZePMM/NPKgNF3P+MQbFoxexR45Z7Ru1N2cy6qJJxmgFaFIEvKcvlOpTdKV/A+ph957W1Qt8U8ONthivI/lAZHNIT2LNEBn0h7lTj/ePIlKFmxWTptVpRbwi3EiEDLYVG2DPQXl65AUkx46d8FLvqoILZz+EJmiiwQul68= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1611829650716285.3320236862106; Thu, 28 Jan 2021 02:27:30 -0800 (PST) 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-528-P47K4QGIORuXYc_FuQFMTw-1; Thu, 28 Jan 2021 05:27:27 -0500 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 12BBC8049C7; Thu, 28 Jan 2021 10:27:22 +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 E322B62AFA; Thu, 28 Jan 2021 10:27:21 +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 ABECB4E58E; Thu, 28 Jan 2021 10:27:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 10SAOv0K026651 for ; Thu, 28 Jan 2021 05:24:57 -0500 Received: by smtp.corp.redhat.com (Postfix) id 1CD86100AE30; Thu, 28 Jan 2021 10:24:57 +0000 (UTC) Received: from work.redhat.com (ovpn-112-226.ams2.redhat.com [10.36.112.226]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6284610023BD; Thu, 28 Jan 2021 10:24:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611829649; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=h/yt9NwImjZidWX7Ip7Cgop4JLTA2RvjKBJIS430vLM=; b=F1ndRjUIre96nqqenulxH21G7ho8V3hj4FvLmKgH4C9zaG5bspp0rjfkmh5tbg4qejrk/a PH39n4wqd04tKxqnV0RuTp5ZNt0IViJj+1O7xR+o4l07Bwx51Wy9fsZEzYvOAw9n1nPeGH sv7LVrKP96+nUIEbJqwlm1Kkq5fW/Eg= X-MC-Unique: P47K4QGIORuXYc_FuQFMTw-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 10/11] vircommand: Remove NULL check in virCommandAddArg Date: Thu, 28 Jan 2021 11:24:40 +0100 Message-Id: <20210128102441.20241-11-twiederh@redhat.com> In-Reply-To: <20210128102441.20241-1-twiederh@redhat.com> References: <20210128102441.20241-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" `val` is declared `ATTRIBUTE_NONNULL`. Found by clang-tidy's "clang-diagnostic-tautological-pointer-compare" check. Signed-off-by: Tim Wiederhake Reviewed-by: Peter Krempa --- src/util/vircommand.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/util/vircommand.c b/src/util/vircommand.c index c3a98bbeac..223010c6aa 100644 --- a/src/util/vircommand.c +++ b/src/util/vircommand.c @@ -1525,11 +1525,6 @@ virCommandAddArg(virCommandPtr cmd, const char *val) if (!cmd || cmd->has_error) return; =20 - if (val =3D=3D NULL) { - cmd->has_error =3D EINVAL; - return; - } - arg =3D g_strdup(val); =20 /* Arg plus trailing NULL. */ --=20 2.26.2 From nobody Tue May 7 18:03:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1611829685; cv=none; d=zohomail.com; s=zohoarc; b=ZCzyR+MkgyjaUD7Fgn2WXW9EVSDPKs0qvlZIQ5rPwxqNS//BKukeiGqi/Ic+5owL8ueR5PwuhsVZ/W1Xbu8m9ogtEk0LtJUqFYq1KEVmDqpXsQWTk5TNzwNLLF4Ipl2vu1eE6up1mtArXcxglWVA3ruMbt3ctoTIvKNwWmfi06A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611829685; 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=S4j4N88J61VQE7e1eYQJ6r7XfddjP375W0zy6bH52jo=; b=bocuM1YgklRo7YIZL2SzxPDIjqhavIOaLpVSgyldSMrGBqbgqbESSvxkEXd5AAdzpQJqPJlY/5siDl8Ggc3r+65NFUj3Q3F4gRu/N9kAU44xEPmlKH4ytJ0vx/L8Jgs7cyjWdQmFjUhEGRoNw1A/vCMma0RE17fVyN2KNGtinDo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1611829685285715.582301365368; Thu, 28 Jan 2021 02:28:05 -0800 (PST) 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-572-LG9bB44KP-ynod1fm9lA3A-1; Thu, 28 Jan 2021 05:27:30 -0500 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 BE0C8100A647; Thu, 28 Jan 2021 10:27:24 +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 9AA2862AFA; Thu, 28 Jan 2021 10:27:24 +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 5F97B1809CA3; Thu, 28 Jan 2021 10:27:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 10SAOwtH026663 for ; Thu, 28 Jan 2021 05:24:58 -0500 Received: by smtp.corp.redhat.com (Postfix) id 33EEA10023BD; Thu, 28 Jan 2021 10:24:58 +0000 (UTC) Received: from work.redhat.com (ovpn-112-226.ams2.redhat.com [10.36.112.226]) by smtp.corp.redhat.com (Postfix) with ESMTP id 71C6E100AE31; Thu, 28 Jan 2021 10:24:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611829684; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=S4j4N88J61VQE7e1eYQJ6r7XfddjP375W0zy6bH52jo=; b=cr0sqP0VHEYYGAn5Tna2CDdaraLdOaIyfcJr/m9R7F5E3YsiRvej83oEfml8UE5rka7e0z /cakwdAmPLMRBX8ktb0nNW27eLrVR9odIvDYOEHISWGZIGGnHPU//JOrMhjfMmCoLK6w4o 2LLb48qVOxmiYMsmuTdtV0pIa40q+fA= X-MC-Unique: LG9bB44KP-ynod1fm9lA3A-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 11/11] vircommand: Simplify virCommandAddArg Date: Thu, 28 Jan 2021 11:24:41 +0100 Message-Id: <20210128102441.20241-12-twiederh@redhat.com> In-Reply-To: <20210128102441.20241-1-twiederh@redhat.com> References: <20210128102441.20241-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake Reviewed-by: Peter Krempa --- src/util/vircommand.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/util/vircommand.c b/src/util/vircommand.c index 223010c6aa..f83d49ffac 100644 --- a/src/util/vircommand.c +++ b/src/util/vircommand.c @@ -1520,21 +1520,16 @@ virCommandAddEnvXDG(virCommandPtr cmd, const char *= baseDir) void virCommandAddArg(virCommandPtr cmd, const char *val) { - char *arg; - if (!cmd || cmd->has_error) return; =20 - arg =3D g_strdup(val); - /* Arg plus trailing NULL. */ if (VIR_RESIZE_N(cmd->args, cmd->maxargs, cmd->nargs, 1 + 1) < 0) { - VIR_FREE(arg); cmd->has_error =3D ENOMEM; return; } =20 - cmd->args[cmd->nargs++] =3D arg; + cmd->args[cmd->nargs++] =3D g_strdup(val); } =20 =20 --=20 2.26.2