From nobody Tue May 7 09:29:58 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=1600810403; cv=none; d=zohomail.com; s=zohoarc; b=UWfGWLW/z6mv2BpEUYXY/NNghMY5z5UW9m7E7nzYHpG+RlJNzATgcEQI0SujiVEBpZkEYsRR3rVyfs2BBGyzIEa/eUWjGLlZtPKXqxVRnXVUkabmGYUz5d93T/v5sQOL9DY7oKfsGL7xQ+6mgbkkCJMdMKuEnn+mnIdld29scC4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600810403; 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=qjO+tjH0mIqIKP35K6uRx3t+RL80UKJk8x/GMjCho+g=; b=KgPLGbGMnHWc/a3iBst/PyZ8RKLT7yUHGPUZ1/2Xw5Tm0ayCZpyS51i90g6KatIsD5b4T0m4Zcx/IPg2QXGkn+z+8oDqi5IDkvi4HBxkEsZp0aO8t/OQuZkvlUSGZf+kKxkfocCw6xC48lJFVqEUzpZ1gZocUmC8PpMJ5Jp1TAM= 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 160081040308389.09993305312582; Tue, 22 Sep 2020 14:33:23 -0700 (PDT) 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-571-Q_Pml44BM128fcEsxt2ngg-1; Tue, 22 Sep 2020 17:33:19 -0400 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 A61E7186841D; Tue, 22 Sep 2020 21:33:13 +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 878DA73689; Tue, 22 Sep 2020 21:33:13 +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 546DB1826D33; Tue, 22 Sep 2020 21:33:13 +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 08MLWlkm022703 for ; Tue, 22 Sep 2020 17:32:47 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1EFF7100164C; Tue, 22 Sep 2020 21:32:47 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 98F5C100239F for ; Tue, 22 Sep 2020 21:32:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600810401; 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=qjO+tjH0mIqIKP35K6uRx3t+RL80UKJk8x/GMjCho+g=; b=EkHtx+ekbjTshTVlI7hDv5KtwgiRKCNvDdxUJ8iijTrjggNKWVX2sHKtCrhWrelhDXsSVG VtpdEgNW9oDlPJeBjlCcWt3YjnyYNuthQhTcB7Vc+dqEpJcqypgZRPilTS882R40DIIMp7 SBSELjJLyVRTvFjBenlPky/mUhAYR/o= X-MC-Unique: Q_Pml44BM128fcEsxt2ngg-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 1/5] util: event: check return value of virInitialize Date: Tue, 22 Sep 2020 23:32:29 +0200 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.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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) This function can possibly fail. Signed-off-by: J=C3=A1n Tomko Fixes: 2e07a1e14635ad25c57b66c13488feff4c8d2b0c Reviewed-by: Peter Krempa --- src/util/virevent.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/util/virevent.c b/src/util/virevent.c index 3477d63554..f6eb806faf 100644 --- a/src/util/virevent.c +++ b/src/util/virevent.c @@ -305,7 +305,8 @@ int virEventRegisterDefaultImpl(void) { VIR_DEBUG("registering default event implementation"); =20 - virInitialize(); + if (virInitialize() < 0) + return -1; =20 virResetLastError(); =20 --=20 2.26.2 From nobody Tue May 7 09:29:58 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=1600810379; cv=none; d=zohomail.com; s=zohoarc; b=X9rPBiIKeamiJjqZwmTd8uwlrp2yZM8PJA20C/d20vCUplHydo3hAz1IkJbIjY4oZ/EBTaS0JFaR0BmAV93nLTG2smxg5TsVKR90swyRUPEMOYRCIl8YacDXFbNpTeZ2087ZaTomoJBqpeAUsmEjvGN6H3EmvN3m+3UsUxIhYQk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600810379; 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=OQih0JBfw6267FyDV0aDBR8nPmYiBT2NfGqQY8K7NuM=; b=M9BYTOGQD0ga6onBjH01jXtXLek/Z6SDKKOj44SRnwgMVtNEyi61c1tr3wDMK39DK7Qjqr1CaBZUCFY/3f0GcnSMe/9E40753o3mg3K7TyFETG+3/bOSnliWVYxlrJalEzbaVRjraAJsD9hm4iCItJRAILXK8b636fO68DvgYR4= 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 1600810379865741.6939922739116; Tue, 22 Sep 2020 14:32:59 -0700 (PDT) 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-288-ex7D9SYcNFaSoy8mbbSlrA-1; Tue, 22 Sep 2020 17:32:56 -0400 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 295B61074641; Tue, 22 Sep 2020 21:32:51 +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 09F1F55767; Tue, 22 Sep 2020 21:32:51 +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 A5E868C7AD; Tue, 22 Sep 2020 21:32:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08MLWlmu022709 for ; Tue, 22 Sep 2020 17:32:47 -0400 Received: by smtp.corp.redhat.com (Postfix) id E7DBF1001901; Tue, 22 Sep 2020 21:32:47 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6DFF1100164C for ; Tue, 22 Sep 2020 21:32:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600810378; 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=OQih0JBfw6267FyDV0aDBR8nPmYiBT2NfGqQY8K7NuM=; b=afU3V1XiQcLK0WrY0+LIw/wgtpjbrcT59w9PtPE2QmbOYS3Rf1UcQ39GAm6E3GRpZP53ys gKHHlGT0+ALKlPAzJgnyRe2u8GLksr9v9wQzcdR5PIpxO2h/4lH3AWcN0vuB2fy6WqcIUQ nE68FqDF3zkD//qCZSLaHFNDRmnREO8= X-MC-Unique: ex7D9SYcNFaSoy8mbbSlrA-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 2/5] qemu: firmware: check virJSONValueObjectGet return value Date: Tue, 22 Sep 2020 23:32:30 +0200 Message-Id: <2a8531d31d6938376f798f18d12a38f1c8b573b7.1600810297.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.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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) If the mapping is not present, we should not try to access its elements. Signed-off-by: J=C3=A1n Tomko Fixes: 8b5b80f4c5f7342eedce0747469223387ab709ef Reviewed-by: Peter Krempa --- src/qemu/qemu_firmware.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_firmware.c b/src/qemu/qemu_firmware.c index ffe2df20aa..480ce0b00d 100644 --- a/src/qemu/qemu_firmware.c +++ b/src/qemu/qemu_firmware.c @@ -434,10 +434,17 @@ qemuFirmwareMappingParse(const char *path, virJSONValuePtr doc, qemuFirmwarePtr fw) { - virJSONValuePtr mapping =3D virJSONValueObjectGet(doc, "mapping"); + virJSONValuePtr mapping; const char *deviceStr; int tmp; =20 + if (!(mapping =3D virJSONValueObjectGet(doc, "mapping"))) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("missing mapping in '%s'"), + path); + return -1; + } + if (!(deviceStr =3D virJSONValueObjectGetString(mapping, "device"))) { virReportError(VIR_ERR_INTERNAL_ERROR, _("missing device type in '%s'"), --=20 2.26.2 From nobody Tue May 7 09:29:58 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=1600810424; cv=none; d=zohomail.com; s=zohoarc; b=XJR+36Ehc4QaBQJIxmBaYLeLeBqCjMlY1fMwbbSAf5A9Bnsdq5RnMfoBFYXXmfFQ2EWCb398XdD/0SfMijcF5QP1tFuxAbXAmMF6h354W3SIheTKPbvCVGep5CH17/x8YP2kwMeuwIcEx8LKCANMw2/C55OrBgetBCd1ttr/bpc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600810424; 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=DyRz2ElP1Suo6JvCN77XrNVWW0wuu9XXtzFZG31bAmo=; b=B00wlBBNartjnXIw9Djm2kZmLMnRZXVOXWqofMMLOtVx+M0zVaZiv5+qyLk9CTYAOGPZFWisES5+qVOswmaFT5LelPpmBR8hXjuHhz8y57ovMoefZ9GsnFC1ArTixpjQqudMdWjf95//rP19ws5xAPADKqzVUFwnmgd9AF8ctNk= 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 1600810424932489.27698858384997; Tue, 22 Sep 2020 14:33:44 -0700 (PDT) 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-93-PPHkObOeN9KlDzpKFHFf2Q-1; Tue, 22 Sep 2020 17:33:40 -0400 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 6ABC5800400; Tue, 22 Sep 2020 21:33: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 4646D10023A7; Tue, 22 Sep 2020 21:33: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 157758C7D3; Tue, 22 Sep 2020 21:33:34 +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 08MLWmdi022719 for ; Tue, 22 Sep 2020 17:32:48 -0400 Received: by smtp.corp.redhat.com (Postfix) id BD1D2100164C; Tue, 22 Sep 2020 21:32:48 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 435D31001901 for ; Tue, 22 Sep 2020 21:32:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600810423; 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=DyRz2ElP1Suo6JvCN77XrNVWW0wuu9XXtzFZG31bAmo=; b=WWROzpBPPyOWqueUWt425OUld62uTMHwgkitrAePI36A0M91ssFqyLn6a2sEykeJpiGBId OiEdx4X5DbkYMnndgxTdF9MeK6X4mZbkZy2T0fal5SMpV7xn8M0AzYJxo9oNqA5E+QXXo0 fXEEHhOibus8Ea4cCvESgiPnYSSCaQI= X-MC-Unique: PPHkObOeN9KlDzpKFHFf2Q-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 3/5] rpc: socket: properly call virSetCloseExec Date: Tue, 22 Sep 2020 23:32:31 +0200 Message-Id: <609a5f70495fb295e904a5a082cfa63e0f39b809.1600810297.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.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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) cppcheck reports: style: Argument 'fd<0' to function virSetCloseExec is always 0 [knownArgume= nt] Signed-off-by: J=C3=A1n Tomko Fixes: 4b9919af4024a6fbc3d4ee996d8a4c27dbc44285 Reviewed-by: Peter Krempa --- src/rpc/virnetsocket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c index ebdeadc4a0..f79a638775 100644 --- a/src/rpc/virnetsocket.c +++ b/src/rpc/virnetsocket.c @@ -1388,7 +1388,7 @@ int virNetSocketDupFD(virNetSocketPtr sock, bool cloe= xec) } #ifndef F_DUPFD_CLOEXEC if (cloexec && - virSetCloseExec(fd < 0)) { + virSetCloseExec(fd) < 0) { int saveerr =3D errno; closesocket(fd); errno =3D saveerr; --=20 2.26.2 From nobody Tue May 7 09:29:58 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=1600810379; cv=none; d=zohomail.com; s=zohoarc; b=dtTdpHFGrn9APvr3XhBxfFwnGrgr5vjIgNUio4oFu6zjVnHl4Xfm6adREJbYeRb0ApZiRukv3XHFhH8+Vr+/xmwHfL6zL2gvKYT45aD4ckZoFs545tDKNNLXnPJLQmkkYdpdnA8CTtl8qma6gYVBi164P9h5LYk5qVnq91JebM4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600810379; 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=WxfaJ2AFziJSVnqT13cpzr4M8vcYUb0WFEjq3MJIDCg=; b=CaSaQOmgsii56NEYPXOOhLqal63onGi6p6s5OkoHIbjIwJOOh7BqlgK3O2UU6lwXd4+14cXyVkfmZY/H8aKKUpavW8fdTRcpArtumAKwRBEz0ErmxrfUibCRQNtTQb+BAUJo2BAlw97kiFS7OBrJX3VrXnFaGvotyff4YsspeCg= 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 1600810379862338.6703855366925; Tue, 22 Sep 2020 14:32:59 -0700 (PDT) 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-290-vT9Evp4OPby7Vx1-BlBRbQ-1; Tue, 22 Sep 2020 17:32:56 -0400 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 50A9081CAFB; Tue, 22 Sep 2020 21:32:51 +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 288DB1A923; Tue, 22 Sep 2020 21:32:51 +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 E085C1826D2E; Tue, 22 Sep 2020 21:32:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08MLWn0u022731 for ; Tue, 22 Sep 2020 17:32:49 -0400 Received: by smtp.corp.redhat.com (Postfix) id 929DF1001901; Tue, 22 Sep 2020 21:32:49 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 18A61100164C for ; Tue, 22 Sep 2020 21:32:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600810378; 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=WxfaJ2AFziJSVnqT13cpzr4M8vcYUb0WFEjq3MJIDCg=; b=Yq7jDKQ5Tk+64Uka0ikhFMejEhBqA0zTAh3jqRq8oVQdI9wOd0rD+OSYuGLjCpyy99Vz0l pvb/2U4o+eV8jV7Y9wyhRPqKqMVL22gXYUsMbZsXHVHwrzMoQjLndYDv14FAKgtdK4NDlM CeUBYT4SNnn0WA1Q0NmQTI/bZMIVH88= X-MC-Unique: vT9Evp4OPby7Vx1-BlBRbQ-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 4/5] virsh: do not return bool in virshNetworkPortUUIDCompleter Date: Tue, 22 Sep 2020 23:32:32 +0200 Message-Id: <40ac45c2dd7532a17039719f84d142821262a716.1600810297.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.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) portability: Returning an integer in a function with pointer return type is not portable. [CastIntegerToAddressAtReturn] Signed-off-by: J=C3=A1n Tomko Reviewed-by: Peter Krempa --- tools/virsh-completer-network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/virsh-completer-network.c b/tools/virsh-completer-networ= k.c index a63d657477..73f7115ab2 100644 --- a/tools/virsh-completer-network.c +++ b/tools/virsh-completer-network.c @@ -103,7 +103,7 @@ virshNetworkPortUUIDCompleter(vshControl *ctl, return NULL; =20 if (!(net =3D virshCommandOptNetwork(ctl, cmd, NULL))) - return false; + return NULL; =20 if ((nports =3D virNetworkListAllPorts(net, &ports, flags)) < 0) return NULL; --=20 2.26.2 From nobody Tue May 7 09:29:58 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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=1600810445; cv=none; d=zohomail.com; s=zohoarc; b=Ci+X1y5CkYBniKkMcSQf6sUXxEjz5zsqnSj39QZn/uAiff13XacnW72CGOjYXUD6ZTje365CbzGhx7chEimttJfwNlvSTtlYYXCN4ia6KKvQJtkS0JAYrwPC0u9W/qWyPIJUzQnHPsRW2pvEfvK0I0hItIqQ1Fp8aA28xqA5aas= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600810445; 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=5PjobLUoFMWK7l2PiMz7yiO+kCU3jLTVqKk+gxwurVQ=; b=FAxTiYPuyMxtmrGzFFppWxzLSEQ0xxWYmN3jQkQ9fMvY12f/Aza0AlOsiZ+5A88WWMet+waC7UjkwY/xxTVD8HVAMt32WkMZimNJWliCh5DTMRB2EWWrqzwtpc5/lyF0uFfUpLeoVJkS1w+aseIYNiatm9qgB0eWXdxOizmSry4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1600810445960228.01114960928658; Tue, 22 Sep 2020 14:34:05 -0700 (PDT) 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-527-rZf0lkvxM2ONZQg9aV0urQ-1; Tue, 22 Sep 2020 17:34:01 -0400 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 01025801ABB; Tue, 22 Sep 2020 21:33:55 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CF2EC1A923; Tue, 22 Sep 2020 21:33:54 +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 999348C7AD; Tue, 22 Sep 2020 21:33:54 +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 08MLWobG022740 for ; Tue, 22 Sep 2020 17:32:50 -0400 Received: by smtp.corp.redhat.com (Postfix) id 68357100164C; Tue, 22 Sep 2020 21:32:50 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id E26B01001901 for ; Tue, 22 Sep 2020 21:32:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600810444; 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=5PjobLUoFMWK7l2PiMz7yiO+kCU3jLTVqKk+gxwurVQ=; b=bLChz3MHA/UDOUKliioJMeu2StfQecqmNGbr+bPjHRa+urk3795QHWq4G+FbNzTGU7Je5n NevPWqfVFhzakhxg+nj+2wmMc9nEh+IHW6h2VogMw3UMY6mA5GajS43krURZwazAo/ifWJ dpD67/wNg6EXNZq9Ee37PfLr4+ybhc8= X-MC-Unique: rZf0lkvxM2ONZQg9aV0urQ-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 5/5] Use (un)signed printf specifiers correctly Date: Tue, 22 Sep 2020 23:32:33 +0200 Message-Id: <42c0b30d5bd99e335b50119994b1bce540a80370.1600810297.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.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) Various places reported by cppcheck's invalidPrintfArgType_sint and invalidPrintfArgType_uint. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Peter Krempa --- examples/c/domain/domtop.c | 2 +- examples/c/domain/suspend.c | 2 +- tests/qemusecuritymock.c | 2 +- tests/virhashtest.c | 4 ++-- tests/virpcimock.c | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/c/domain/domtop.c b/examples/c/domain/domtop.c index 15611c586d..5228445b7c 100644 --- a/examples/c/domain/domtop.c +++ b/examples/c/domain/domtop.c @@ -115,7 +115,7 @@ parse_argv(int argc, char *argv[], } *milliseconds =3D val; if (*milliseconds !=3D val) { - ERROR("Integer overflow: %ld", val); + ERROR("Integer overflow: %lu", val); exit(EXIT_FAILURE); } break; diff --git a/examples/c/domain/suspend.c b/examples/c/domain/suspend.c index 980c4584c7..3ff24f6861 100644 --- a/examples/c/domain/suspend.c +++ b/examples/c/domain/suspend.c @@ -105,7 +105,7 @@ parse_argv(int argc, char *argv[], } *seconds =3D val; if (*seconds !=3D val) { - ERROR("Integer overflow: %ld", val); + ERROR("Integer overflow: %lu", val); return -1; } break; diff --git a/tests/qemusecuritymock.c b/tests/qemusecuritymock.c index 6da8a91a9e..d544ae56cd 100644 --- a/tests/qemusecuritymock.c +++ b/tests/qemusecuritymock.c @@ -265,7 +265,7 @@ mock_chown(const char *path, int ret =3D -1; =20 if (gid >> 16 || uid >> 16) { - fprintf(stderr, "Attempt to set too high UID or GID: %lld %lld", + fprintf(stderr, "Attempt to set too high UID or GID: %llu %llu", (unsigned long long) uid, (unsigned long long) gid); abort(); } diff --git a/tests/virhashtest.c b/tests/virhashtest.c index 4d05cbb0f8..af30791241 100644 --- a/tests/virhashtest.c +++ b/tests/virhashtest.c @@ -34,7 +34,7 @@ testHashInit(int size) } =20 if (virHashTableSize(hash) !=3D oldsize) { - VIR_TEST_DEBUG("hash grown from %zd to %zd", + VIR_TEST_DEBUG("hash grown from %zu to %zu", (size_t)oldsize, (size_t)virHashTableSize(hash)); } } @@ -313,7 +313,7 @@ testHashRemoveSet(const void *data G_GNUC_UNUSED) =20 if (count !=3D rcount) { VIR_TEST_VERBOSE("\nvirHashRemoveSet didn't remove expected number= of" - " entries, %d !=3D %u", + " entries, %d !=3D %d", rcount, count); goto cleanup; } diff --git a/tests/virpcimock.c b/tests/virpcimock.c index 787172d24c..469aa01bb0 100644 --- a/tests/virpcimock.c +++ b/tests/virpcimock.c @@ -120,7 +120,7 @@ struct pciDeviceAddress { unsigned int device; unsigned int function; }; -# define ADDR_STR_FMT "%04x:%02x:%02x.%d" +# define ADDR_STR_FMT "%04x:%02x:%02x.%u" =20 struct pciDevice { struct pciDeviceAddress addr; --=20 2.26.2