From nobody Thu Apr 25 05:53:22 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=1605540989; cv=none; d=zohomail.com; s=zohoarc; b=RaikeOc4l0gchXjeojWCvqi0nUlBAczBsHPdtsIng+ZQ/HOAREwLBsimDr3PxLxLsN/rETNZGscEqwpszkbmDb+zrsj6KUUultFz/cBXb3pnI4Bt9BQrkCJ9/eHFaKABNgvQXdQYO7W9gyETIpUPbVz68Maph6kKa1s386keqBM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605540989; h=Content-Type:Content-Transfer-Encoding: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=RyRG905rjA3rgMmDB0YbDG+IbjR4g8Nb6wPPcEbQ1hU=; b=ajdvswEZ8gysxTf5IAZLMRA0AcYiPJvrOBlkwU2lGbnjshULr8a4WLzWOloIS75w2Qd5ILf8uOgNjkZrMliSYRiImR/LSGvj+8914xjnlwGBMPEfdO/FlnUZ14KLDBCfXIbf+bVfTy+CGEHkciLMll96Mb53hruBtdJKZRB8L/M= 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 1605540989110571.7313271918971; Mon, 16 Nov 2020 07:36: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-329-Y2ED-pllM3mfsOpwtMjHvA-1; Mon, 16 Nov 2020 10:36:23 -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 56F7B108593D; Mon, 16 Nov 2020 15:36:17 +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 7CCBB6EF4F; Mon, 16 Nov 2020 15:36:16 +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 E92BA58122; Mon, 16 Nov 2020 15:36:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0AGFaCoR022057 for ; Mon, 16 Nov 2020 10:36:12 -0500 Received: by smtp.corp.redhat.com (Postfix) id C290819D6C; Mon, 16 Nov 2020 15:36:12 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.193.172]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3C4EA196FD for ; Mon, 16 Nov 2020 15:36:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605540987; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=RyRG905rjA3rgMmDB0YbDG+IbjR4g8Nb6wPPcEbQ1hU=; b=KLiVmUvbM//FDyoMooVlpkOpVLU6VAgM3iQuUBGU1BKIvXziEXPvXYHS6Uu7VVEJiObPTV /xPjNHDgGTt7YpA9unbyLCvtw9+hn2ODkN53zFymMKRty0uErsD8H9hLyhWytJBqsGvHa7 mYsaOk20mqq3MKzbGsm+VHB8Uaifcks= X-MC-Unique: Y2ED-pllM3mfsOpwtMjHvA-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH 1/2] src: rework static analysis detection Date: Mon, 16 Nov 2020 16:36:05 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Inspired by QEMU code. Signed-off-by: Pavel Hrdina Reviewed-by: Daniel P. Berrang=C3=A9 --- meson.build | 14 -------------- src/internal.h | 4 ++++ 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/meson.build b/meson.build index cecaad199d..dbbc9632f1 100644 --- a/meson.build +++ b/meson.build @@ -142,20 +142,6 @@ if get_option('test_coverage') endif =20 =20 -# Detect when running under the clang static analyzer's scan-build driver -# or Coverity-prevent's cov-build. Define STATIC_ANALYSIS accordingly. - -rc =3D run_command( - 'sh', '-c', - 'test -n "${CCC_ANALYZER_HTML}"' + - ' -o -n "${CCC_ANALYZER_ANALYSIS+set}"' + - ' -o -n "$COVERITY_BUILD_COMMAND$COVERITY_LD_PRELOAD"', -) -if rc.returncode() =3D=3D 0 - conf.set('STATIC_ANALYSIS', 1) -endif - - # Add RPATH information when building for a non-standard prefix, or # when explicitly requested to do so =20 diff --git a/src/internal.h b/src/internal.h index d167e56b48..5226667d3d 100644 --- a/src/internal.h +++ b/src/internal.h @@ -29,6 +29,10 @@ #include #include "glibcompat.h" =20 +#if defined __clang_analyzer__ || defined __COVERITY__ +#define STATIC_ANALYSIS 1 +#endif + #if STATIC_ANALYSIS # undef NDEBUG /* Don't let a prior NDEBUG definition cause trouble. */ # include --=20 2.26.2 From nobody Thu Apr 25 05:53:22 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=1605540999; cv=none; d=zohomail.com; s=zohoarc; b=A/E2fvV1kJNQVGb50Qp0Fh2qDr2zbMH+2rXUcEj6rCHiYa63l4Z7PsvA8bLzPlVfRqpK0IDAraY7KSdyxi4cyxfQu0bxnqV6VTZPeoCljcUbwIssMFcmRbkRSEOtw4CFgQYWFZGAxPO7YTau5SFV3Z+3w3+T0WdTFvlsWcDeuuI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605540999; h=Content-Type:Content-Transfer-Encoding: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=GOhx/D/bVY3DKWkLQGp3dvQrmJb/OOpsQ5K8FBthwwc=; b=OudQBZ50iXxxSshoyUVO2r5vWcM3EOkiJoS6lh7jfBbYvhqjrheBdBBkzl/tKSfagWQT+dJcPjVVsjETrJ9JMoinEyYZd251+0LP7iFWIIedfgtM4AVCVjKrIvbhCd0GcZrjrwzXA7jIdlwy2aixr7/0AvrwP2EAEC7wVdTXl3I= 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 1605540999968799.2335708523531; Mon, 16 Nov 2020 07:36:39 -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-50-H24FW6yNMY-nRxeFQu0vbw-1; Mon, 16 Nov 2020 10:36:36 -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 AC78E186841C; Mon, 16 Nov 2020 15:36:30 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 869095DA30; Mon, 16 Nov 2020 15:36:30 +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 4E4B3183D020; Mon, 16 Nov 2020 15:36:30 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0AGFaDhM022067 for ; Mon, 16 Nov 2020 10:36:13 -0500 Received: by smtp.corp.redhat.com (Postfix) id A775319D6C; Mon, 16 Nov 2020 15:36:13 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.193.172]) by smtp.corp.redhat.com (Postfix) with ESMTP id 23E2F196FE for ; Mon, 16 Nov 2020 15:36:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605540998; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=GOhx/D/bVY3DKWkLQGp3dvQrmJb/OOpsQ5K8FBthwwc=; b=IOT8RfGaki9pmYcnF0B/1bz0QWem9TBtrLaoswPBxTJZSg3bFLSzRxivijO3xv8IhQktn4 0nGwOGQulF7SYk466Jj7/8aSl1bHfkOIzwRQP/XQZ4KjXwIuNT4NItFh/w5SjdSEl6OTdz 4m3sxC5iie1DGR4fHVAoO3RBNJQOSr4= X-MC-Unique: H24FW6yNMY-nRxeFQu0vbw-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH 2/2] gitlab-ci: add coverity job Date: Mon, 16 Nov 2020 16:36:06 +0100 Message-Id: <13a14c08007adaad07a66a48dc4cb4d447f6b1c1.1605540918.git.phrdina@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.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" Introduce new job to make a coverity build and upload coverity data to scan.coverity.com where the analysis is then executed. Signed-off-by: Pavel Hrdina Reviewed-by: Daniel P. Berrang=C3=A9 --- .gitlab-ci.yml | 20 ++++++++++++++++++++ ci/containers/README.rst | 22 ++++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 725c76e9ee..6792accf8f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -585,3 +585,23 @@ check-dco: - $CI_PROJECT_NAMESPACE =3D=3D 'libvirt' variables: GIT_DEPTH: 1000 + + +# Coverity job that is run only by schedules +coverity: + image: $CI_REGISTRY_IMAGE/ci-centos-8:latest + needs: + - x64-centos-8-container + stage: builds + script: + - curl https://scan.coverity.com/download/linux64 --form project=3D$CO= VERITY_SCAN_PROJECT_NAME --form token=3D$COVERITY_SCAN_TOKEN -o /tmp/cov-an= alysis-linux64.tgz + - tar xfz /tmp/cov-analysis-linux64.tgz + - meson build + - cov-analysis-linux64-*/bin/cov-build --dir cov-int ninja -C build + - tar cfz cov-int.tar.gz cov-int + - curl https://scan.coverity.com/builds?project=3D$COVERITY_SCAN_PROJE= CT_NAME --form token=3D$COVERITY_SCAN_TOKEN --form email=3D$GITLAB_USER_EMA= IL --form file=3D@cov-int.tar.gz --form version=3D"$(git describe --tags)" = --form description=3D"$(git describe --tags) / $CI_COMMIT_TITLE / $CI_COMMI= T_REF_NAME:$CI_PIPELINE_ID" + only: + refs: + - schedules + variables: + - $COVERITY_SCAN_PROJECT_NAME && $COVERITY_SCAN_TOKEN diff --git a/ci/containers/README.rst b/ci/containers/README.rst index 530897e311..f2ee132613 100644 --- a/ci/containers/README.rst +++ b/ci/containers/README.rst @@ -12,3 +12,25 @@ https://gitlab.com/libvirt/libvirt-ci The containers are built during the CI process and cached in the GitLab container registry of the project doing the build. The cached containers can be deleted at any time and will be correctly rebuilt. + + +Coverity scan integration +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D + +This will be used only by the main repository for master branch by running +scheduled pipeline in GitLab. + +The service is proved by `Coverity Scan`_ and requires that the project is +registered there to get free coverity analysis which we already have for +`libvirt project`_. + +To run the coverity job it requires two new variables: + + * ``COVERITY_SCAN_PROJECT_NAME``, containing the `libvirt project`_ + name. + + * ``COVERITY_SCAN_TOKEN``, token visible to admins of `libvirt project`_ + + +.. _Coverity Scan: https://scan.coverity.com/ +.. _libvirt project: https://scan.coverity.com/projects/libvirt --=20 2.26.2