From nobody Fri Apr 19 18:11:06 2024 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=1637677234; cv=none; d=zohomail.com; s=zohoarc; b=RH1d/meHLqNTZMBLgttPpHoAdTJ9b4ZnqYAf98pwXC24f77m92umBlWpCHy6NcituHY8aWPcjfWBT+YePUJZ174J4MoqY4ncgZ/aVYP9YwePtf9H2nkqMzFiIl9BoDu9is0Aa2g+EzUKzgqL3ISRFJtm9Q8AdxZ/CEicDSkqYNk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1637677234; 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=RANY34BsiGpUtsE6QICIXlweIMfaGzTS8qxD0rPai3M=; b=chpaIAdYMSCpJT++RfRwgSVaOrpEcFejh4iIMpN1PhW1wxSb0HmWZncmHzhG6RVBITuf+CGhyOc3+XbI59kbwA3neyFvom3nEffdaTb8yEZFlgh6BWVKhPFMLrHk6f8oSkMoAy5QLdM4BpiFMYS44u0OZiQJ9Er2Onv2j77n9sY= 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 1637677234554349.83559202137076; Tue, 23 Nov 2021 06:20:34 -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-566-_D3hFqClOKuYkbt1zNa3PQ-1; Tue, 23 Nov 2021 09:20:29 -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 D4C1E8066EC; Tue, 23 Nov 2021 14:20:23 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AEA02108DF; Tue, 23 Nov 2021 14:20:23 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 1392B4E58E; Tue, 23 Nov 2021 14:20:22 +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 1ANEKKaY032115 for ; Tue, 23 Nov 2021 09:20:20 -0500 Received: by smtp.corp.redhat.com (Postfix) id C6101101E5BF; Tue, 23 Nov 2021 14:20:20 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.43.2.72]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4E4E3101E59D for ; Tue, 23 Nov 2021 14:20:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1637677233; 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=RANY34BsiGpUtsE6QICIXlweIMfaGzTS8qxD0rPai3M=; b=POAMJHFf0KXQPlssF9tnktzQDVnZHSRFfk+NSALcz0LCqGy5jh81IIh8xZ4SBn0XYgaMlq t/XuP34Dqgll1vDBJjS2Tye1VxkI31O4m+tmdfM/FjpIh0FembAXEyfZTJwiqNIuEhCxs1 i28oeZ0cj4Hf8yfveqm9UKqyYaOtq14= X-MC-Unique: _D3hFqClOKuYkbt1zNa3PQ-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 1/4] tools: virt-host-validate: fix memory leak Date: Tue, 23 Nov 2021 15:19:55 +0100 Message-Id: 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.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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1637677235312100005 virHostValidateGetCPUFlags returns an allocated virBitmap and it needs to be freed. Fixes: a0ec7165e3bbc416478740f6d2e8fef2ece18602 Signed-off-by: J=C3=A1n Tomko Reviewed-by: Krist=C3=ADna Hanicov=C3=A1 --- tools/virt-host-validate-ch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/virt-host-validate-ch.c b/tools/virt-host-validate-ch.c index b00fdd0e90..b26f82738d 100644 --- a/tools/virt-host-validate-ch.c +++ b/tools/virt-host-validate-ch.c @@ -28,7 +28,7 @@ int virHostValidateCh(void) { int ret =3D 0; - virBitmap *flags; + g_autoptr(virBitmap) flags =3D NULL; bool hasHwVirt =3D false; bool hasVirtFlag =3D false; virArch arch =3D virArchFromHost(); --=20 2.31.1 From nobody Fri Apr 19 18:11:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1637677233; cv=none; d=zohomail.com; s=zohoarc; b=MqHzxGsk77Y3WXypu8YKOX+CR7ShgtDZ4NKcEa8t8OjnqKovcJCx3nnPLpuVrE/jWO1HqY0k5mStbZGO55LTCIJYR4g3O2Sb77972F0J1agJZPzqexEKdqQElYRauNIvSDHCLv7Bf7KLXgX9WqDHXau3QEMWBlRz7wGhv4s9Yjk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1637677233; 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=CGtO0/cEJGKjxrB1MAejhpuM1mO+hwtrVwz9YP15PLM=; b=efkEPsyFZQLdX0T68CIXzSMYtOIISGowfDHaTBJ8j03rx69Bwi13M4Tm9BiTChyYlbIyJ9XnF8n9IWNoewseLDZg2LSvnIXGbOYHXbq7d5m3SkaXPig0FKQKREbF4muPp10b6Mk9f0dWE9GSQo0fd6FM61/x6PH6OCTlKFbrbb8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 1637677233765810.2047287439015; Tue, 23 Nov 2021 06:20:33 -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-19-ipydBtmzMw-saSEeVNux5w-1; Tue, 23 Nov 2021 09:20:31 -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 003768799EE; Tue, 23 Nov 2021 14:20:26 +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 D570F794AF; Tue, 23 Nov 2021 14:20:25 +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 9A2DF1832E80; Tue, 23 Nov 2021 14:20:25 +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 1ANEKLQr032125 for ; Tue, 23 Nov 2021 09:20:21 -0500 Received: by smtp.corp.redhat.com (Postfix) id 9902F101E5BF; Tue, 23 Nov 2021 14:20:21 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.43.2.72]) by smtp.corp.redhat.com (Postfix) with ESMTP id 21D7B101E59D for ; Tue, 23 Nov 2021 14:20:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1637677232; 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=CGtO0/cEJGKjxrB1MAejhpuM1mO+hwtrVwz9YP15PLM=; b=J1zN67HoyQCc7iL/cSTfIZ+ZpBtUeJ1o4rhhx0dJDExLshNkZHFZ7Mlwupre1bcImAtfDO 34gwVUpE0sR3kUZJ1rOMgboaGx5/ne1ffxpKkUNk35D9Q9oQKoNNgeGzxRTkkgVtdlgnl0 r2Q1atgiS+cJAnBxjtwnyqsouVVhAmc= X-MC-Unique: ipydBtmzMw-saSEeVNux5w-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 2/4] vbox: fix vboxCapsInit Date: Tue, 23 Nov 2021 15:19:56 +0100 Message-Id: <0d0955259757067564644e5c7f661d45d79c4c83.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: 1637677235176100002 There is a stray mis-indented 'return NULL' left after a recent refactor. Fixes: c18d9e23fafabcfbb80481e0705931036b8e7331 Signed-off-by: J=C3=A1n Tomko Reviewed-by: Krist=C3=ADna Hanicov=C3=A1 --- src/vbox/vbox_common.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c index 62c8e22cb5..72f1b9c466 100644 --- a/src/vbox/vbox_common.c +++ b/src/vbox/vbox_common.c @@ -102,7 +102,6 @@ vboxCapsInit(void) =20 guest =3D virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM, caps->host.arch, NULL, NULL, 0, NULL); - return NULL; =20 virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_VBOX, NULL, NULL, 0, NULL); --=20 2.31.1 From nobody Fri Apr 19 18:11:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1637677264; cv=none; d=zohomail.com; s=zohoarc; b=csSQsqQKExtmNctMJEH0vv/4m0IsB8+a6jesMUjniN2BJQ7DKAgkzT7vCfZyQoI6jmqo8ZbvpwrgG9YT6YifAutKWtAYhLNIlanvcfQUNlkJMdfIgz5IWo8GJy87YGk3LIMv6NVEpxmg4e+oTU5x3OKgX+vs6fMe/UifU+8K8Sc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1637677264; 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=Z2NBKtJLHEaZQRqahuTt5ZI3XhoylS9KrFpsfJTXyIg=; b=cxsxQWsot2AR6JIyrehkAF1A7iurZ+8LmfSMybZnd1ZqmQ8wmihznP/xIxbrhAimfFWnAoGE/HHUhqNy+AM9rx1XOgysdW+HV8aDqxOHX57yrLGwi1IN+3MyY1hhrLXTHqih2TxQRCcUWUGtBNgKDVgHKyCEl+9mocwQeGipLp0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 1637677264431247.53383837894228; Tue, 23 Nov 2021 06:21:04 -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-259-KlwyOWzoPPq_FnQbHByYQA-1; Tue, 23 Nov 2021 09:20:42 -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 EF00487D542; Tue, 23 Nov 2021 14:20:35 +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 D16D560CC9; 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 9D65A4EA39; 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 1ANEKM6R032138 for ; Tue, 23 Nov 2021 09:20:22 -0500 Received: by smtp.corp.redhat.com (Postfix) id 6AC9D100760F; Tue, 23 Nov 2021 14:20:22 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.43.2.72]) by smtp.corp.redhat.com (Postfix) with ESMTP id E78B9101E59D for ; Tue, 23 Nov 2021 14:20:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1637677263; 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=Z2NBKtJLHEaZQRqahuTt5ZI3XhoylS9KrFpsfJTXyIg=; b=AYY0c4+vuAvXN8wlLqBpw8Dzptsr/AzJnYr2M0izxq6WmPSn7ILzn+2ef7J05DXu3yMWu+ 7Y3MYK+BfexQgmtah17eNWEOs7B8aAIFMj5qNdT2qiJ1NOlA88x1PWuoCDbS7WwaJoT37S oEVLktXE+3uaGiMwsodDMMAI3imXxt8= X-MC-Unique: KlwyOWzoPPq_FnQbHByYQA-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 3/4] ch: fix logic in virCHMonitorBuildPtyJson Date: Tue, 23 Nov 2021 15:19:57 +0100 Message-Id: <8c622fc56930fa773b5541e9c049f64c97c0b11b.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.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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1637677265563100001 There is a leftover 'ptys' variable, which we only assign to and one assignment to 'content', where we add an empty 'pty' object. Remove 'ptys'. Fixes: 93accefd9eca1bc3d7e923a979ab2d1b8a312ff7 Signed-off-by: J=C3=A1n Tomko Reviewed-by: Krist=C3=ADna Hanicov=C3=A1 --- src/ch/ch_monitor.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/ch/ch_monitor.c b/src/ch/ch_monitor.c index 691d1ce64b..12c10da874 100644 --- a/src/ch/ch_monitor.c +++ b/src/ch/ch_monitor.c @@ -88,8 +88,6 @@ virCHMonitorBuildCPUJson(virJSONValue *content, virDomain= Def *vmdef) static int virCHMonitorBuildPTYJson(virJSONValue *content, virDomainDef *vmdef) { - virJSONValue *ptys =3D virJSONValueNewObject(); - if (vmdef->nconsoles) { g_autoptr(virJSONValue) pty =3D virJSONValueNewObject(); if (virJSONValueObjectAppendString(pty, "mode", "Pty") < 0) @@ -100,7 +98,7 @@ virCHMonitorBuildPTYJson(virJSONValue *content, virDomai= nDef *vmdef) =20 if (vmdef->nserials) { g_autoptr(virJSONValue) pty =3D virJSONValueNewObject(); - if (virJSONValueObjectAppendString(ptys, "mode", "Pty") < 0) + if (virJSONValueObjectAppendString(pty, "mode", "Pty") < 0) return -1; if (virJSONValueObjectAppend(content, "serial", &pty) < 0) return -1; --=20 2.31.1 From nobody Fri Apr 19 18:11:06 2024 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 Reviewed-by: Krist=C3=ADna Hanicov=C3=A1 --- 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