From nobody Sat Feb 7 05:48:59 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.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=1637677244; cv=none; d=zohomail.com; s=zohoarc; b=ChrFFey5M2Z+mQGqQxqVzi0+TEjbrU1SZiJtczY+F2BlUe+H06lOFjZgs+ZZZqnunq5IYtEKioKZ6dj645vcgjicBw9kuaABuJ4YRH+qjmtV8C1ywgXw6NJJvbLS9i9MvRBD4jqh/CsWdjguTE2yDyYgg/0aTRmipl4zbfqrJPM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1637677244; 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=Q5r3iCD1pSkLn1Rl8B+gvORtvrg8brDLo7bk9tnofaI=; b=Lpg4T/oOku9tv1O2yEhR06JZlkfB+ptGj5cQn73mhw+QL69rIsM+soBiG5/1oMvYGXKULWCOyUgUUemz8W6jd2E31wgMTDoyx0Lw5AbsSXoEN129kcVdZkHjP+AjPyrBWI8F+dD7W7oiex5gqoRSpZrd3yU6/hxO5bZQOcLjKs0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1637677244780875.3064548578056; Tue, 23 Nov 2021 06:20:44 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-410-fAQWW5i6Ocy47rs39Qtamw-1; Tue, 23 Nov 2021 09:20:41 -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 E4220192205D; Tue, 23 Nov 2021 14:20:35 +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 C48AE7945E; Tue, 23 Nov 2021 14:20:35 +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 94EC21832E85; Tue, 23 Nov 2021 14:20:35 +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 1ANEKNCr032146 for ; Tue, 23 Nov 2021 09:20:23 -0500 Received: by smtp.corp.redhat.com (Postfix) id 3D65A101E59D; Tue, 23 Nov 2021 14:20:23 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.43.2.72]) by smtp.corp.redhat.com (Postfix) with ESMTP id BA2A1101E58D for ; Tue, 23 Nov 2021 14:20:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1637677243; 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=Q5r3iCD1pSkLn1Rl8B+gvORtvrg8brDLo7bk9tnofaI=; b=FbDU4h1nPKZAWCijRjplz1f/4GGrhH0T3sGI2+z6vM8yaAKI7eSEAGSrvAyb3Durlm98LH v52VZuk+J64lQsQy2zgI/niCaqjK48v3Lz8E8kSm5a02jyjgAu1fiZ2rRDjS2P/CBqKhhm RK0zYeuFXmpe3U/ZEbvfjmZ4cDcoZmc= X-MC-Unique: fAQWW5i6Ocy47rs39Qtamw-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 4/4] tests: pcivpdtest: check return value of virCreateAnonymousFile Date: Tue, 23 Nov 2021 15:19:58 +0100 Message-Id: <4d7f2d125be1c630f2774b8e7e41a521296a056e.1637677135.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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.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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1637677246421100001 Fixes: 59c1bc3a0e25e6d725db41990f11e0b53137115d Fixes: 43820e4b8037680ec451761216750c6b139db67a Fixes: 600f580d623ae4077ddeb6c7cb24f8a315a7c73b Signed-off-by: J=C3=A1n Tomko --- tests/virpcivpdtest.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/virpcivpdtest.c b/tests/virpcivpdtest.c index 284350fe29..62c51cdeb9 100644 --- a/tests/virpcivpdtest.c +++ b/tests/virpcivpdtest.c @@ -446,6 +446,8 @@ testVirPCIVPDReadVPDBytes(const void *opaque G_GNUC_UNU= SED) buf =3D g_malloc0(dataLen); =20 fd =3D virCreateAnonymousFile(fullVPDExample, dataLen); + if (fd < 0) + return -1; =20 readBytes =3D virPCIVPDReadVPDBytes(fd, buf, dataLen, 0, &csum); =20 @@ -482,6 +484,9 @@ testVirPCIVPDParseVPDStringResource(const void *opaque = G_GNUC_UNUSED) =20 dataLen =3D G_N_ELEMENTS(stringResExample); fd =3D virCreateAnonymousFile(stringResExample, dataLen); + if (fd < 0) + return -1; + result =3D virPCIVPDParseVPDLargeResourceString(fd, 0, dataLen, &csum,= res); VIR_FORCE_CLOSE(fd); =20 @@ -552,6 +557,9 @@ testVirPCIVPDParseFullVPD(const void *opaque G_GNUC_UNU= SED) =20 dataLen =3D G_N_ELEMENTS(fullVPDExample); fd =3D virCreateAnonymousFile(fullVPDExample, dataLen); + if (fd < 0) + return -1; + res =3D virPCIVPDParse(fd); VIR_FORCE_CLOSE(fd); =20 @@ -620,6 +628,9 @@ testVirPCIVPDParseZeroLengthRW(const void *opaque G_GNU= C_UNUSED) =20 dataLen =3D G_N_ELEMENTS(fullVPDExample); fd =3D virCreateAnonymousFile(fullVPDExample, dataLen); + if (fd < 0) + return -1; + res =3D virPCIVPDParse(fd); VIR_FORCE_CLOSE(fd); =20 @@ -670,6 +681,9 @@ testVirPCIVPDParseNoRW(const void *opaque G_GNUC_UNUSED) =20 dataLen =3D G_N_ELEMENTS(fullVPDExample); fd =3D virCreateAnonymousFile(fullVPDExample, dataLen); + if (fd < 0) + return -1; + res =3D virPCIVPDParse(fd); VIR_FORCE_CLOSE(fd); =20 @@ -723,6 +737,9 @@ testVirPCIVPDParseFullVPDSkipInvalidKeywords(const void= *opaque G_GNUC_UNUSED) =20 dataLen =3D G_N_ELEMENTS(fullVPDExample); fd =3D virCreateAnonymousFile(fullVPDExample, dataLen); + if (fd < 0) + return -1; + res =3D virPCIVPDParse(fd); VIR_FORCE_CLOSE(fd); =20 @@ -776,6 +793,9 @@ testVirPCIVPDParseFullVPDSkipInvalidValues(const void *= opaque G_GNUC_UNUSED) =20 dataLen =3D G_N_ELEMENTS(fullVPDExample); fd =3D virCreateAnonymousFile(fullVPDExample, dataLen); + if (fd < 0) + return -1; + res =3D virPCIVPDParse(fd); VIR_FORCE_CLOSE(fd); =20 --=20 2.31.1