From nobody Mon May 20 15:23:13 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=1643820136; cv=none; d=zohomail.com; s=zohoarc; b=WAjJkcOK+j2FLubZDk4STkCBL+e4yulTtbhhP1T+sYjOldxxsNeZi3bPRw3Q678q7ZZ0wPTvFmovr9x/jh6kA1mdt+/FBnU/YFITwzLwELzumnPqHcpZy7w9yipbzxdtIxFb3KvN20PFNuDqoWNZdhu+r1eVgHj+o50zNCt0YG0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1643820136; 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=8MKyQlPgZTK15CiCLpb/pBqkv7LCCcQMw75EjM6X00w=; b=ZNbpq7qZKVOUgbaC3ZBU5fKPGb7q8UYIsB+PDiwL1QHn3lotWL8qX2xAhSeP8KMVlewWxo0LrmLRjIUhxHoOGA7xR+yq2tsCe63XAKD9IvDW/i7ipYNb4wDVmbJ/6hSoGh2mVT0h3/gWZjLDSHry0K+EL8I03vPkgonI/Zve2is= 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 1643820136649721.4627282471859; Wed, 2 Feb 2022 08:42:16 -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-663-kvG0kQj7Nyi1Dez5y80mUQ-1; Wed, 02 Feb 2022 11:42:12 -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 2A7511091DA8; Wed, 2 Feb 2022 16:42:07 +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 09A9478AAA; Wed, 2 Feb 2022 16:42:07 +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 A165C1806D1C; Wed, 2 Feb 2022 16:42:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 212GdP64022878 for ; Wed, 2 Feb 2022 11:39:25 -0500 Received: by smtp.corp.redhat.com (Postfix) id 7860C70D5E; Wed, 2 Feb 2022 16:39:25 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.85]) by smtp.corp.redhat.com (Postfix) with ESMTP id 016C462D4E for ; Wed, 2 Feb 2022 16:39:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643820135; 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=8MKyQlPgZTK15CiCLpb/pBqkv7LCCcQMw75EjM6X00w=; b=IRlhhURu5nzk+nlLRxMi+ERo+uGbdiQedxy15GNsQjBVRV9CDWDj+w5LBqDyWEeXGU1X1M 1z7r18K6sxoHFb7u6/9KLKlZglqbY8Mt6H36GJ000jYhyqf0KCNtvWQtUV0aErpTAue4Ol Qm7ehzOBfr1Wh7B+VvAxy+zNI8XRjJc= X-MC-Unique: kvG0kQj7Nyi1Dez5y80mUQ-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 1/2] ch: virCHMonitorGetIOThreads: fix g_steal_pointer usage Date: Wed, 2 Feb 2022 17:39:21 +0100 Message-Id: <5f8d26585f5195def16080e6d4023090432495a3.1643819932.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1643820138856100001 Fixes: 81226d88034fd460855ac75dd2c985ca91ff6219 Signed-off-by: J=C3=A1n Tomko Reviewed-by: Andrea Bolognani --- src/ch/ch_monitor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ch/ch_monitor.c b/src/ch/ch_monitor.c index 4d5d2c69b8..60905e36c2 100644 --- a/src/ch/ch_monitor.c +++ b/src/ch/ch_monitor.c @@ -977,7 +977,7 @@ virCHMonitorGetIOThreads(virCHMonitor *mon, } =20 VIR_DEBUG("niothreads =3D %ld", niothreads); - *iothreads =3D g_steal_pointer(iothreadinfolist); + *iothreads =3D g_steal_pointer(&iothreadinfolist); return niothreads; =20 error: --=20 2.34.1 From nobody Mon May 20 15:23:13 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=1643820054; cv=none; d=zohomail.com; s=zohoarc; b=PCvg83SVVloIIRM6SLPiG4fCPCWRBblSr9wwlaBETKOI2uImuk+ex9JTw1I0SuQxtmMK3r+Glq2gqF9x7wT46vV+LiBmsMlwWmwmUBGHRkoQSbskujQ7YDaq9ioA/QQV8BCOHH0ft3zYTzgJRl6rghPoGJmZ4ICybvhqSW/NMjU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1643820054; 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=eFr6LBPuFKSikz6CAmmCDMAZ+WWuEVJp0b3yXz5mqq0=; b=T14NMk5fZSILCdLWfMRMZ3tqkCPrmZRJbgwWqWJD3xzM3PdWUakgxlgdL9+F+Y8i1mSaGJ1xSiiFPA2qMkfS248GDEQc9oKs6jSIhD34rZmV6ym5KtRauJsNcIBnJLHkzxvYP8IAGO8xaOAZLJpwEnLCHtll9ER4/oUFuKtK+uc= 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 1643820054737917.5013807491925; Wed, 2 Feb 2022 08:40:54 -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-195-GAncQsAtPT-buVhEhiW05w-1; Wed, 02 Feb 2022 11:40:50 -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 744D08710FB; Wed, 2 Feb 2022 16:40:45 +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 119477D4A3; Wed, 2 Feb 2022 16:40:43 +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 03A244BB7C; Wed, 2 Feb 2022 16:40:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 212GdQ3P022889 for ; Wed, 2 Feb 2022 11:39:26 -0500 Received: by smtp.corp.redhat.com (Postfix) id 4A86970D5E; Wed, 2 Feb 2022 16:39:26 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.85]) by smtp.corp.redhat.com (Postfix) with ESMTP id C501962D4E for ; Wed, 2 Feb 2022 16:39:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643820054; 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=eFr6LBPuFKSikz6CAmmCDMAZ+WWuEVJp0b3yXz5mqq0=; b=U0mWBQKNVBpUjP/F5te7kBhNtvxC31/lZgx74X8GqEtQWXPmn2PcPxyqoR88iAsY3FbuzM PsS9i5qKzbqn2rpy3GIenSGwZ7hPhXS+bxWgUNAVreeushepC/qXf3PWgFKn1zGuibLTKq SLsMA+jKcqjDvV2oB8mouFBRfPUNtgA= X-MC-Unique: GAncQsAtPT-buVhEhiW05w-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 2/2] ch: virCHProcessSetupIOThreads: use correct type for return value Date: Wed, 2 Feb 2022 17:39:22 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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: 1643820057334100001 virCHMonitorGetIOThreads returns an int, not size_t. Also return early if it's negative, because promoting it to an unsigned type in the for loop condition could lead to an infinte loop. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Andrea Bolognani --- src/ch/ch_process.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ch/ch_process.c b/src/ch/ch_process.c index 414e203154..e4313d1008 100644 --- a/src/ch/ch_process.c +++ b/src/ch/ch_process.c @@ -327,9 +327,11 @@ virCHProcessSetupIOThreads(virDomainObj *vm) virCHDomainObjPrivate *priv =3D vm->privateData; virDomainIOThreadInfo **iothreads =3D NULL; size_t i; - size_t niothreads; + int niothreads; + + if ((niothreads =3D virCHMonitorGetIOThreads(priv->monitor, &iothreads= )) < 0) + return -1; =20 - niothreads =3D virCHMonitorGetIOThreads(priv->monitor, &iothreads); for (i =3D 0; i < niothreads; i++) { VIR_DEBUG("IOThread index =3D %ld , tid =3D %d", i, iothreads[i]->= iothread_id); if (virCHProcessSetupIOThread(vm, iothreads[i]) < 0) --=20 2.34.1