From nobody Mon Sep 16 19:48:11 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=1693920945; cv=none; d=zohomail.com; s=zohoarc; b=Kk0pRa6XFCEOuNAv1MKsRqJ8pDzdmA4PQ6TyDK9m5UXiwXP+Ifw26svXTfkprP8CtAsqWuKMvWY/R+TR84WXUNBbegUmvIGLahzvdozwJ6zmoY/qg5DXcorvgmHDVsBoDU+7ImDvVy66XV2H/PKgGZOxxREdHEi/38g6fUWSLrI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693920945; 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=6hiJtq76llf4suk2suhiniYLU3T/nFjmm+OQsyz/3XE=; b=SECyOfpC6kR92ZtBenrNNgQJV8Qzkl3LIOAKOwQXithDx0irl9tr1rdsvEcCSCgkXyct3sJYCeUG8jx0/GrzQE47YK0HRx6JcyOqazXZGbRKO1URnzbUU1nOIKjj/EDMnMNykw8pPXH4rLKAL0cnfvFgxJSBCqEzjvpacE3bhiY= 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 1693920945553268.25976541981606; Tue, 5 Sep 2023 06:35:45 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-612-Q3ARm-DHOYmSDDPtvZAeOw-1; Tue, 05 Sep 2023 09:35:41 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 21F493822557; Tue, 5 Sep 2023 13:35:38 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0BE7A40C84A8; Tue, 5 Sep 2023 13:35:38 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id C096C19472A9; Tue, 5 Sep 2023 13:35:36 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 698E01946589 for ; Tue, 5 Sep 2023 13:35:35 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 5A39D47FC73; Tue, 5 Sep 2023 13:35:35 +0000 (UTC) Received: from maggie.brq.redhat.com (unknown [10.43.2.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id 01C87493110 for ; Tue, 5 Sep 2023 13:35:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1693920944; 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=6hiJtq76llf4suk2suhiniYLU3T/nFjmm+OQsyz/3XE=; b=FhlIpvHNHkzj7nXe1IuXX2jxctbRNauEBBesWH0wmC0jJCOilE/kQCb9PwjSlCwDoJWzfI rMmK8HNjgJqlTliwz3uwSdVUKtiwosdxfuayhOwsFdX/M5hBMnNrZd0TZhDuBwMOGJfvbw vQWP8afVxtl679ytdCxdt8Ff2wDyDWY= X-MC-Unique: Q3ARm-DHOYmSDDPtvZAeOw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 1/3] ch: Use uint for @maxvcpus in virCHDomainRefreshThreadInfo() Date: Tue, 5 Sep 2023 15:35:30 +0200 Message-ID: <0977605d1a05a038751181086b6504f33e6258c3.1693920916.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1693920946792100001 Content-Type: text/plain; charset="utf-8"; x-default="true" The @maxvcpus variable inside of virCHDomainRefreshThreadInfo() holds retval of virDomainDefGetVcpusMax() which returns an unsigned int. Also, the variable is then passed to VIR_WARN() with incorrect format directive (%ld). Switch variable to uint and fix the format directive. Signed-off-by: Michal Privoznik --- src/ch/ch_domain.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ch/ch_domain.c b/src/ch/ch_domain.c index 35e3471cba..d6b64b6c59 100644 --- a/src/ch/ch_domain.c +++ b/src/ch/ch_domain.c @@ -225,7 +225,7 @@ chValidateDomainDeviceDef(const virDomainDeviceDef *dev, int virCHDomainRefreshThreadInfo(virDomainObj *vm) { - size_t maxvcpus =3D virDomainDefGetVcpusMax(vm->def); + unsigned int maxvcpus =3D virDomainDefGetVcpusMax(vm->def); virCHMonitorThreadInfo *info =3D NULL; size_t nthreads; size_t ncpus =3D 0; @@ -252,7 +252,7 @@ virCHDomainRefreshThreadInfo(virDomainObj *vm) =20 /* TODO: Remove the warning when hotplug is implemented.*/ if (ncpus !=3D maxvcpus) - VIR_WARN("Mismatch in the number of cpus, expected: %ld, actual: %= ld", + VIR_WARN("Mismatch in the number of cpus, expected: %u, actual: %z= u", maxvcpus, ncpus); =20 return 0; --=20 2.41.0