From nobody Thu May 2 04:36:47 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=1612183362; cv=none; d=zohomail.com; s=zohoarc; b=R6w6AAVJn49rRTUVBrJem/39ss5dUZ4/pkIBH/27OYSVYEp5SlQzdSN2NryS+gNZzjcdI+xD1TQnLpC1FK7g/SxTs7byU1PESgAio0ZI809FCZrNAcuwvmFhKVF8epl1waJGbSvP5t4d71mQb24JASIdiyH4Km3jfkJirQAM25Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612183362; 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=zGPho9w6wIOnX4XEjl/KVIMMbHNGJqVRTSwNUw2Q/nc=; b=ncAVflgXgG7G5aN0/62k9xwRJlT6+Xwiw1W3sATt/u8Iw1ByruhlCBDXi597vSwY6J4SCXiq03vZTw05MR5nF3/E0rVsyxR/PcPl6BTLbZUKOO4HmoVkudh/inETvrAzlSKrMYRrJovuHIIRRWTHH+5ZabzSyRFpsfcBuwkxJfo= 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 1612183362729393.27225076637717; Mon, 1 Feb 2021 04:42:42 -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-440-I53RD4M6M-GobCrK3-3F7Q-1; Mon, 01 Feb 2021 07:42:39 -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 5C507803F6A; Mon, 1 Feb 2021 12:42:34 +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 3AA41648A3; Mon, 1 Feb 2021 12:42:34 +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 02DE75003F; Mon, 1 Feb 2021 12:42:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 111CgDf1014639 for ; Mon, 1 Feb 2021 07:42:13 -0500 Received: by smtp.corp.redhat.com (Postfix) id 363735D756; Mon, 1 Feb 2021 12:42:13 +0000 (UTC) Received: from work.redhat.com (ovpn-113-167.ams2.redhat.com [10.36.113.167]) by smtp.corp.redhat.com (Postfix) with ESMTP id 492FE62461; Mon, 1 Feb 2021 12:42:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612183361; 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=zGPho9w6wIOnX4XEjl/KVIMMbHNGJqVRTSwNUw2Q/nc=; b=dP6e0t4STVgVaDxPbufAlRP0BhCIDCpGSA+VAvGDSugUxNG5Be0H0Da6qir1IJFo1R15UF XZekbWSDiGPwi7ZpGxb9mVpbu3rBMvWzSeeukTpwIlKihkBuXT+MOPvtTLHF+fEsRayqvY NbVfqGWzjCQfZMvT5fAPSHmq8bvna1Q= X-MC-Unique: I53RD4M6M-GobCrK3-3F7Q-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 01/10] virfile: Remove redundant #ifndef Date: Mon, 1 Feb 2021 13:41:58 +0100 Message-Id: <20210201124207.148709-2-twiederh@redhat.com> In-Reply-To: <20210201124207.148709-1-twiederh@redhat.com> References: <20210201124207.148709-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Peter Krempa , 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 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 Thu May 2 04:36:47 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=1612183370; cv=none; d=zohomail.com; s=zohoarc; b=isxoTom2dyxJsWhtfOuybEVBmgl89ILypLJINiAxahRvWkKTl9VKYbPLLzkk9pes15/eym84pyhTKvrBizrVfeUFxQvozHHu13RSCl1O8jwLzynfPExjCtENDZINLuLLikKFhHXQ4LHMRAmz0cdiJ3EMSeXPvuABIMAusMky7Nc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612183370; 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=/pVJskXJ/XKsGMXiNLJRuia/NTOx3tGCznS+qMbyoWo=; b=m8prvcQzYYbUOBaKL4FR8xbZmQYRYSTpagG4n4EjZfqFcp24tGculz+cDwVut/DT/F/O5ZMi1dZkyKygOx2JhpLRZCT8+ElmdXhZWG1QpjL8n+q6pXO5xzNV82x4mx8MFXZORY/hv/MeLRPVoulTNEFKdwOzmpWXyP29wasWR90= 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 1612183370558938.3268891040033; Mon, 1 Feb 2021 04:42:50 -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-466-3vO9efKXMT21_FL-vVAKnA-1; Mon, 01 Feb 2021 07:42:46 -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 62D43107ACFB; Mon, 1 Feb 2021 12:42:37 +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 3D65410016FB; Mon, 1 Feb 2021 12:42:37 +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 08EFE50043; Mon, 1 Feb 2021 12:42:37 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 111CgEYl014651 for ; Mon, 1 Feb 2021 07:42:14 -0500 Received: by smtp.corp.redhat.com (Postfix) id 8474317C2E; Mon, 1 Feb 2021 12:42:14 +0000 (UTC) Received: from work.redhat.com (ovpn-113-167.ams2.redhat.com [10.36.113.167]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9783A5D749; Mon, 1 Feb 2021 12:42:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612183369; 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=/pVJskXJ/XKsGMXiNLJRuia/NTOx3tGCznS+qMbyoWo=; b=Iq/C3vrSRmmg2I+bq9vixnePzHA98AVzRv8dCDpWuq0I/CwY6LPcQLBWpv0PvZ1PrY7Hko W7Q7BcYgfkB4mwaee8ql4EWnyssRU1hfwlR1xvCI3gsZJ3cPnX4ZFF2e7MOKNovluZVLqO WlyUXPRylmssrBDZTo/9bnwT0J+TXko= X-MC-Unique: 3vO9efKXMT21_FL-vVAKnA-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 02/10] xen: Fix indentation in xenParseXLSpice Date: Mon, 1 Feb 2021 13:41:59 +0100 Message-Id: <20210201124207.148709-3-twiederh@redhat.com> In-Reply-To: <20210201124207.148709-1-twiederh@redhat.com> References: <20210201124207.148709-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Peter Krempa , 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 "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 Thu May 2 04:36:47 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=1612183349; cv=none; d=zohomail.com; s=zohoarc; b=leabPAIBN0t68fD6GZxigoJTSWHddHgv4qx+RMTqwx6JQeAgP25oTJa3Xw5CLlgkoW38UEJjP5akw0AMA6FIlm/Pu5hMrulv6f+IVKLWrImihMJutoWLvBBtkQ2gzKBAsufJoJOzRed2r158XKsxlFKAU46nI9Y0ZrS5cumq0Ig= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612183349; 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=WXcYSbgbqxL5hh2mG2VW8IyS3sd7+Y6jgVVYIXzFoS0=; b=OdzOjy18wg/I12VAzmq0RO6qjsvjUxgmUKHYmc7eNn3/8oTGW4theu4YcvHKvRqO2Kf1vJslbjRehvms797RoVCkyXdfawCXiQ6zvFlC9Dbyj9ZVUTNtHdfxXXbZ//r4M4gHKYxV4qkxtujAz+e/WuKPHHdfIcRnS8krsJ1UcQo= 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 1612183349195483.3442846163904; Mon, 1 Feb 2021 04:42: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-540-FX6ebWgEP6i2CUDQC-fAGQ-1; Mon, 01 Feb 2021 07:42: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 6E90E809DC9; Mon, 1 Feb 2021 12:42: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 082D9614FC; Mon, 1 Feb 2021 12:42: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 3D9034EA69; Mon, 1 Feb 2021 12:42:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 111CgFrv014676 for ; Mon, 1 Feb 2021 07:42:15 -0500 Received: by smtp.corp.redhat.com (Postfix) id E402A5D749; Mon, 1 Feb 2021 12:42:15 +0000 (UTC) Received: from work.redhat.com (ovpn-113-167.ams2.redhat.com [10.36.113.167]) by smtp.corp.redhat.com (Postfix) with ESMTP id E4E8862461; Mon, 1 Feb 2021 12:42:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612183346; 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=WXcYSbgbqxL5hh2mG2VW8IyS3sd7+Y6jgVVYIXzFoS0=; b=HMaVBVFE9G6wDDX4N3yTGvFr2g1wRpvOdS0knu8dv1Ij8654Iylbf9vPjbGc5ITmNjouy1 uvydT9nLIMxA71J4WW3K1bxj2R4kB81SYHGbw8KgpWpow6wVVzW5EMEw7SGMJIjQ0e5tAf oVDhNZ2UT8cZeROFalj+1dL0KaogBKU= X-MC-Unique: FX6ebWgEP6i2CUDQC-fAGQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 03/10] qemu_tpm: Fix indentation in qemuTPMEmulatorBuildCommand Date: Mon, 1 Feb 2021 13:42:00 +0100 Message-Id: <20210201124207.148709-4-twiederh@redhat.com> In-Reply-To: <20210201124207.148709-1-twiederh@redhat.com> References: <20210201124207.148709-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Peter Krempa , 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/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 Thu May 2 04:36:47 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=1612183348; cv=none; d=zohomail.com; s=zohoarc; b=nrRDHDOf76XHsPhvjh96V26qMkeRSpPBhHMM4Fl7WAywWlkMSMdricKe8UZzhHBecS6TUVl7aIRJ2o7d0malp9LvxOZ/jp2Z1/dsmJLay6ALGZXYCrKYoQuVRWj2m0idaNkVH0YMupZ8p1sX/5ikYjRtM22jEqTsbTdDUKrI2J8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612183348; 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=/uvRJgu9a34xYMCQHXpoZ4KkxByXqwzqpvUVwyJpwrE=; b=kfHaEvqDEpqimhrlErPeaHV/yVASao7HM6tRZAbGREnZ5uItAFJauicY8TYIVq4zJnDulcKjuDRQNkiWn/A7RHazmd5uD3jDH2A4aJ48eXvdC8NS7Lo966843NoWor1arardxOQhb3BxgJJbwsudNUjc/O/+XAIB/tBIbgdXsIQ= 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 1612183348908509.1347952461873; Mon, 1 Feb 2021 04:42:28 -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-430-TaDw23foM3SoceKc99XEtQ-1; Mon, 01 Feb 2021 07:42:25 -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 12327193578C; Mon, 1 Feb 2021 12:42:20 +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 B664C6E405; Mon, 1 Feb 2021 12:42:19 +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 8157F5003A; Mon, 1 Feb 2021 12:42:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 111CgHfj014682 for ; Mon, 1 Feb 2021 07:42:17 -0500 Received: by smtp.corp.redhat.com (Postfix) id 4964A5D756; Mon, 1 Feb 2021 12:42:17 +0000 (UTC) Received: from work.redhat.com (ovpn-113-167.ams2.redhat.com [10.36.113.167]) by smtp.corp.redhat.com (Postfix) with ESMTP id 506C262461; Mon, 1 Feb 2021 12:42:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612183347; 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=/uvRJgu9a34xYMCQHXpoZ4KkxByXqwzqpvUVwyJpwrE=; b=bcfErMe8i63X8gwsfKRbd1UFhtGG/4867dj2k5FUT/c342hINgMTfYUWGyPM2xgJiorJeC K0wPFH+6CLv56x8zYL7ApPFTW4EVzgcmgts2M1lIJrEpOvskyxGvhnPRXCAitYDHsDo66N 9ch9yMqKe8R3v1nu5OvV1wG8yId89+k= X-MC-Unique: TaDw23foM3SoceKc99XEtQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 04/10] virsh-domain: Fix error handling of pthread_sigmask Date: Mon, 1 Feb 2021 13:42:01 +0100 Message-Id: <20210201124207.148709-5-twiederh@redhat.com> In-Reply-To: <20210201124207.148709-1-twiederh@redhat.com> References: <20210201124207.148709-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Peter Krempa , 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" 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 Thu May 2 04:36:47 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=1612183363; cv=none; d=zohomail.com; s=zohoarc; b=Zl0SDxDyunwGb6FIb67f9ugTRPUlv634n7QyrXOm/WLsXzg+bZQQtDVNOvqpXf6nYm52MpsqxrmN1acXPN9G+t1v+5YesL90Kxb/dm4lJLqFdKMPniJrfvaVQLQg5NVmRd8gDq6/5eeZvgczzO35e7n4jTCmInQriKk1FWd8D1Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612183363; 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=ZIdTg6bA6ytt4UUtgwGbfBzWqLmrULzPUN+gLKRtCN4=; b=hqqz/NsB4JjIsPbwwqT6jaVnMovVXQK9OnaQ95WbUK0VXGoxvCKVFcXs64X60CSV2/TufZSbnvh1Rv/BaBM0Rm96MMfO6vi6a+uJZmeIBgr10F52G2Ij61x3pWPt65xwRxH7+HyzkQeJnlFPOLg0dRkigNXfXKxeP45NuWhvdAg= 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 1612183363212631.4738544960841; Mon, 1 Feb 2021 04:42:43 -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-589-_mVtAxmoN-aFrzHc0_-2KQ-1; Mon, 01 Feb 2021 07:42:39 -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 9CD20801AE2; Mon, 1 Feb 2021 12:42:33 +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 793B760C5F; Mon, 1 Feb 2021 12:42:33 +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 414D71809C9F; Mon, 1 Feb 2021 12:42:33 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 111CgIeQ014693 for ; Mon, 1 Feb 2021 07:42:18 -0500 Received: by smtp.corp.redhat.com (Postfix) id 7A0E45D756; Mon, 1 Feb 2021 12:42:18 +0000 (UTC) Received: from work.redhat.com (ovpn-113-167.ams2.redhat.com [10.36.113.167]) by smtp.corp.redhat.com (Postfix) with ESMTP id AA94E5D749; Mon, 1 Feb 2021 12:42:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612183362; 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=ZIdTg6bA6ytt4UUtgwGbfBzWqLmrULzPUN+gLKRtCN4=; b=bzzJszXjKdZk9vvHBnnpU2bnXvDr6WOUy1PaHxHQfQ5SuLo/9ksRSiM3DQXOJqfSJsiCxl FweJecwpyPb5S/K95yI+kS3+U1kRvotYAtonUqdEAmPA25VCigEYA2mYGzT3ZN0dJW49ml 09taWTcDetn8w83bD/3pzzEOXXASBoc= X-MC-Unique: _mVtAxmoN-aFrzHc0_-2KQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 05/10] Replace bzero() with memset() Date: Mon, 1 Feb 2021 13:42:02 +0100 Message-Id: <20210201124207.148709-6-twiederh@redhat.com> In-Reply-To: <20210201124207.148709-1-twiederh@redhat.com> References: <20210201124207.148709-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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" This was found by clang-tidy's "clang-analyzer-security.insecureAPI.bzero" check. bzero is marked as deprecated ("LEGACY") in POSIX.1-2001 and removed in POSIX.1-2008. Besides its deprecation, bzero can be unsafe to use under certain circumstances, e.g. when used to zero-out memory containing secrects. These calls can be optimized away by the compiler, if it concludes no further access happens to the memory, thus leaving the secrets still in memory. Hence its classification as "insecureAPI". 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 Thu May 2 04:36:47 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=1612183372; cv=none; d=zohomail.com; s=zohoarc; b=Ah/g7mDfwLEkq2q6/foQ1/6Ue5+9m21GQDtv6Q46X758vNQHc8XKt3xUznsWTFQBHfIMVUYWe/EC90YWcUXIlrdkUyU6g+O2ldzK72JGu6/G/9X/PV5E/vYpgGnIDq1YY1HRcC2xVwqIshJ5VMB1EZkivDOeWfeGsEx17vWcXRc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612183372; 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=p53PxZNtm9H1yE/Hs2qjKSE6fjXfHCX+8XCMAI+k5gU=; b=MFM6kL20G0R5h4ssvr1/dD4qfDvg4MdSIfsQXAubmMhEasFzML47tVU7p8VS5rXq1ngfSlxq7wHueehq8Hz+zDQIpVBvKk3c9np4alM4OGpRq8W0Eb3dxVkyxObw37+P1dKG89EZBSuQoDpr5F3tESPDhz/CRvvCLyZoVN8OjMs= 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 1612183372049622.7205675162754; Mon, 1 Feb 2021 04:42:52 -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-239-dvOGBOSQPI-K259WPZt1dw-1; Mon, 01 Feb 2021 07:42:46 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2DE1B801AF6; Mon, 1 Feb 2021 12:42:40 +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 0781D72167; Mon, 1 Feb 2021 12:42:40 +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 C7D4F50047; Mon, 1 Feb 2021 12:42:39 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 111CgJKQ014705 for ; Mon, 1 Feb 2021 07:42:19 -0500 Received: by smtp.corp.redhat.com (Postfix) id ADC755D749; Mon, 1 Feb 2021 12:42:19 +0000 (UTC) Received: from work.redhat.com (ovpn-113-167.ams2.redhat.com [10.36.113.167]) by smtp.corp.redhat.com (Postfix) with ESMTP id DB9DF62461; Mon, 1 Feb 2021 12:42:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612183369; 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=p53PxZNtm9H1yE/Hs2qjKSE6fjXfHCX+8XCMAI+k5gU=; b=LbmHWs0a3B20Bf0+zS3HFKxUMLQ72IYWfwZ083wpJn1FpWYXMmtd2yrhj76o3rqtpOXF9+ TpeJ44lT/SXzmYlysTwVCw/TwKMuyj7j27zm9QBlIrcgV7Ny30R6pnfVoKtqN5Mi8ssMTs Vz/4qpUbrKNtGsNqBdzJXwpTNO8XcsU= X-MC-Unique: dvOGBOSQPI-K259WPZt1dw-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 06/10] udevProcessCCW: Initialize variable Date: Mon, 1 Feb 2021 13:42:03 +0100 Message-Id: <20210201124207.148709-7-twiederh@redhat.com> In-Reply-To: <20210201124207.148709-1-twiederh@redhat.com> References: <20210201124207.148709-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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.11 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" `udevGetIntSysfsAttr` does not necessarily write to the third parameter, even when it returns 0. This was found by clang-tidy's "clang-analyzer-core.UndefinedBinaryOperatorResult" check. Signed-off-by: Tim Wiederhake Reviewed-by: Peter Krempa --- src/node_device/node_device_udev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_devi= ce_udev.c index fceb135aa5..09048fb23f 100644 --- a/src/node_device/node_device_udev.c +++ b/src/node_device/node_device_udev.c @@ -1100,7 +1100,7 @@ static int udevProcessCCW(struct udev_device *device, virNodeDeviceDefPtr def) { - int online; + int online =3D 0; =20 /* process only online devices to keep the list sane */ if (udevGetIntSysfsAttr(device, "online", &online, 0) < 0 || online != =3D 1) --=20 2.26.2 From nobody Thu May 2 04:36:47 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=1612183362; cv=none; d=zohomail.com; s=zohoarc; b=oFKt4M2AN3v6pLb7yhYSWBMeh5D6Jk6FZ87HpqenmEVhMZYR86FMtgOWxcFNgUWHAyjPamNBobr3rjLyv2R9YQD1PM03PQRsi6CuFwqq89/bBoV/1rNSvupxkOQcOmSifedwhipL+oa3Z+zEPeQqQU0qhew69Gnd335kt9enbD4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612183362; 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=Qa124Ry/yNFFGDpuUZkxQrYujNTwsuqy7Iks8se8MOo=; b=FRjtemGATV/Q1wDIY6/oxJFmyIZQkkqsmy9rfCFCBchfUs7TsJ8NW6cTyg+KQTflkVOSSiSFYgjUTCWf6Ed/wtR+pM9V3UEYURulfH6KZPKhpuvDsanit7asburEkky5BNbtcHHj6sMHUPuMK7RaKS9XvOsrwHsCVBJJ4hb6fz4= 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 1612183362946372.3727015640245; Mon, 1 Feb 2021 04:42:42 -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-457-wn18cl4PPQaoDw6Ko3tN6w-1; Mon, 01 Feb 2021 07:42:39 -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 A3EB21005D52; Mon, 1 Feb 2021 12:42:33 +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 820E560C64; Mon, 1 Feb 2021 12:42:33 +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 488551809CA0; Mon, 1 Feb 2021 12:42:33 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 111CgLNP014717 for ; Mon, 1 Feb 2021 07:42:21 -0500 Received: by smtp.corp.redhat.com (Postfix) id 0637D62461; Mon, 1 Feb 2021 12:42:21 +0000 (UTC) Received: from work.redhat.com (ovpn-113-167.ams2.redhat.com [10.36.113.167]) by smtp.corp.redhat.com (Postfix) with ESMTP id 179FB5D749; Mon, 1 Feb 2021 12:42:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612183362; 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=Qa124Ry/yNFFGDpuUZkxQrYujNTwsuqy7Iks8se8MOo=; b=DiA4+Bs0GhOYTQBQWl3sfG79l6cbh3no3hNvf57patvA7nFd7SuuGxxYmewUTAcqYeiKBX KQfvKzK6nfcpAJ3YFtgowNo1kChcwOHpi8BK03Mw2i5RekIKjqq969Bu1/9uKirso7Vb/q ZpxJmp705aDA7r40Bdgmqou4u+qygWA= X-MC-Unique: wn18cl4PPQaoDw6Ko3tN6w-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 07/10] virhostuptime: Fix rounding in uptime calculation Date: Mon, 1 Feb 2021 13:42:04 +0100 Message-Id: <20210201124207.148709-8-twiederh@redhat.com> In-Reply-To: <20210201124207.148709-1-twiederh@redhat.com> References: <20210201124207.148709-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Peter Krempa , 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" "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 Thu May 2 04:36:47 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=1612183369; cv=none; d=zohomail.com; s=zohoarc; b=DNSuxaTqzcnRtgkPg1oxTe3GwPzmuNfV26zXgAXxbj7LCpm0dtPIqan2YaSdFmRslJ/cz8sinVTxPelmvGSKKPF9bbvFko3OdLttYGxm4Bnk6GE0JPxfmM0Ts9wLmL/UhuUePjVtZr0TPf5uU3Ookhk2PP4wvcA5hIzocD1EzMg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612183369; 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=BJK460+TH4jPFWAtouI0lXJuksUyjUdwRJtoMLSGFpE=; b=Xlo09JonHeT8Ir1fsRB5dznDVY/bRCiIZPIlgx9yQIWzjc8u2zr//QC/ztUisU4nO/j8s8iXQHIogUrOxSpHxjTacJoHuiY8wtJpm/KiU/4GqymVPFYi1U1axA1S1iqPBfmaCsiwiL7Oom0uPTHVcwXCpsxN3XdPuhOFoWUZ97A= 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 161218336954063.651327553042734; Mon, 1 Feb 2021 04:42:49 -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-25-NitYEil2PNyhqQEIMiS_Xw-1; Mon, 01 Feb 2021 07:42:46 -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 A66A9195D570; Mon, 1 Feb 2021 12:42:36 +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 850105D749; Mon, 1 Feb 2021 12:42:36 +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 128311809CA4; Mon, 1 Feb 2021 12:42:36 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 111CgMcN014724 for ; Mon, 1 Feb 2021 07:42:22 -0500 Received: by smtp.corp.redhat.com (Postfix) id 35E4B5D756; Mon, 1 Feb 2021 12:42:22 +0000 (UTC) Received: from work.redhat.com (ovpn-113-167.ams2.redhat.com [10.36.113.167]) by smtp.corp.redhat.com (Postfix) with ESMTP id 66B176A8E5; Mon, 1 Feb 2021 12:42:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612183368; 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=BJK460+TH4jPFWAtouI0lXJuksUyjUdwRJtoMLSGFpE=; b=Tl5F8Tt2g6fahMfCx7KUo3/D2EFF0ITa3Ug9XzXWkDkJ5wBIqaD1wUjZDPDljQ3syrs5rm ZKafprDYVY8x7XLUtplw4rgyV+0RvWy1TWJAqT7/333d9FlHe2OEEHlqTAMOiDjEnysdFL PkPTU4UWA9PK2QLqvSpnH5haj2UU/Sw= X-MC-Unique: NitYEil2PNyhqQEIMiS_Xw-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 08/10] tests: Prevent malloc with size 0 Date: Mon, 1 Feb 2021 13:42:05 +0100 Message-Id: <20210201124207.148709-9-twiederh@redhat.com> In-Reply-To: <20210201124207.148709-1-twiederh@redhat.com> References: <20210201124207.148709-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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" Found by clang-tidy's "clang-analyzer-optin.portability.UnixAPI" check. Signed-off-by: Tim Wiederhake Reviewed-by: Peter Krempa --- tests/commandhelper.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/commandhelper.c b/tests/commandhelper.c index bf6a5baa40..b3c65ab3cc 100644 --- a/tests/commandhelper.c +++ b/tests/commandhelper.c @@ -156,6 +156,9 @@ static int printEnvironment(FILE *log) for (length =3D 0; environ[length]; length++) { } =20 + if (length =3D=3D 0) + return 0; + if (!(newenv =3D malloc(sizeof(*newenv) * length))) return -1; =20 --=20 2.26.2 From nobody Thu May 2 04:36:47 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=1612183387; cv=none; d=zohomail.com; s=zohoarc; b=IijpW++EnTuXsBFWCXOQmBFDaPCHMtTObX8r+w7/Z6pkXt7WlBnlVkmGBKEDmkGRfCoEBh49ZTChvoSNtG1PKD6MJeeLYmHh5bc3scAOTsTor25eGjnTGkbqCs0FrF0GkzfZ20EK8CKkA8xtZmz28EVwiOLxQwWapJKT9ww+bfw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612183387; 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=ra7lWdSwwmvPgFlTHE+dMfE2AP6sF8iVaFE6kNYXxnM=; b=IEcYyPrIgF9odSauaLtFwl2qwIajEoXCAEq2UEViAPNLnm4obDiqhgRyZh4OP4FpkueKbN+MYaou0nyQok8wZUUBNO1QESuWSO4RgqI/jSzt+mtWr6atDH4LX2SmEpFdAV8+vD03cvyfXchWeni4/Gr02I3/DPrmcK/NPl/lU5M= 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 1612183387651511.19534228346436; Mon, 1 Feb 2021 04:43:07 -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-396-cF_iDvGwOpil9tMMscA7og-1; Mon, 01 Feb 2021 07:42:43 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 96C94803F43; Mon, 1 Feb 2021 12:42:36 +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 6ECA650AC6; Mon, 1 Feb 2021 12:42:36 +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 01EA05003E; Mon, 1 Feb 2021 12:42:36 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 111CgNtN014740 for ; Mon, 1 Feb 2021 07:42:23 -0500 Received: by smtp.corp.redhat.com (Postfix) id 8486F5D756; Mon, 1 Feb 2021 12:42:23 +0000 (UTC) Received: from work.redhat.com (ovpn-113-167.ams2.redhat.com [10.36.113.167]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9711462461; Mon, 1 Feb 2021 12:42:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612183385; 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=ra7lWdSwwmvPgFlTHE+dMfE2AP6sF8iVaFE6kNYXxnM=; b=RSmjjLx7KbldOvU3+pfqUqj4xsZc6gBpv2HgLJtk0w1Mgq1eCXSWS+RnD8VJbtt75OFgB1 vRdwhLJ4UdD0HhzVNT6gHHVHE0A8N0/MSmHfw9GwaJNEHS0vIvECLOckUx2Wwr2iHecDKR SgJnqPXmxo9uMPMWJN+nPNl81g8H8V0= X-MC-Unique: cF_iDvGwOpil9tMMscA7og-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 09/10] vircryptotest: Directly assign string to avoid memcpy Date: Mon, 1 Feb 2021 13:42:06 +0100 Message-Id: <20210201124207.148709-10-twiederh@redhat.com> In-Reply-To: <20210201124207.148709-1-twiederh@redhat.com> References: <20210201124207.148709-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Peter Krempa , 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.11 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 Thu May 2 04:36:48 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=1612183389; cv=none; d=zohomail.com; s=zohoarc; b=ffdnlGjcuKTOn4lEn8oxRefuYaVJWQ8WlmGM/+NaJCxEZhe2WKOzoPRtyvxG8uKPCoIcXLtGu65Y09HbyVtXd3u90ybK/HonDkMcL4ZKYq2r8oc6UPsPLVW7/SF2J9f2jem+Cx8JpqmgV7pt7NA1cWYHg2sR7H+1wYd6YhskWAw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612183389; 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=cgSsOJGP175ojW9+XJF2qzyf7hw9DvFFkh6vfTGSGps=; b=bSiMU8HZVeq2Q11b4s4HTa34i/Q+mSIeAKdPffrnNzr1++x7v8JBKe2L/2ry5Zflqi9NIG3QmKDfJfGQ5c5FvazLTetY1TY+II8yikraUcb4koz9CelM9qToaeUSFLjfRxPDzRW5hZomosJhIB8V514hw0uoXAgoO/8vBNhdP1s= 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 1612183389399690.854356217208; Mon, 1 Feb 2021 04:43:09 -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-212-bGluX4BGOQG0CDcW074tPg-1; Mon, 01 Feb 2021 07:42:49 -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 35E181084C80; Mon, 1 Feb 2021 12:42:39 +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 1490F5C3E5; Mon, 1 Feb 2021 12:42:39 +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 D218B1809CA6; Mon, 1 Feb 2021 12:42:38 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 111CgOKj014758 for ; Mon, 1 Feb 2021 07:42:24 -0500 Received: by smtp.corp.redhat.com (Postfix) id D36EA62461; Mon, 1 Feb 2021 12:42:24 +0000 (UTC) Received: from work.redhat.com (ovpn-113-167.ams2.redhat.com [10.36.113.167]) by smtp.corp.redhat.com (Postfix) with ESMTP id E50126267B; Mon, 1 Feb 2021 12:42:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612183388; 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=cgSsOJGP175ojW9+XJF2qzyf7hw9DvFFkh6vfTGSGps=; b=U7aHPQ+0xYU941zyin0Z/fL9Fz4sE+K+qm1yb7KcjnHLaH+vlqTbpPFcwMmTwf3RqZPtdV /CYWkV0BX8hhNSgU1B0K3tnjBivJksirz1csxM61Dap4YJAZidefIzVm4lU+hyU1lxPuM/ x8M8KMn7+xy6F/jcLRaNG9D05BGyNDE= X-MC-Unique: bGluX4BGOQG0CDcW074tPg-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 10/10] vircommand: Simplify virCommandAddArg Date: Mon, 1 Feb 2021 13:42:07 +0100 Message-Id: <20210201124207.148709-11-twiederh@redhat.com> In-Reply-To: <20210201124207.148709-1-twiederh@redhat.com> References: <20210201124207.148709-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Peter Krempa , 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" 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 c3a98bbeac..b1a26f68aa 100644 --- a/src/util/vircommand.c +++ b/src/util/vircommand.c @@ -1520,8 +1520,6 @@ virCommandAddEnvXDG(virCommandPtr cmd, const char *ba= seDir) void virCommandAddArg(virCommandPtr cmd, const char *val) { - char *arg; - if (!cmd || cmd->has_error) return; =20 @@ -1530,16 +1528,13 @@ virCommandAddArg(virCommandPtr cmd, const char *val) 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