From nobody Tue Dec 16 13:57:21 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1743676889; cv=none; d=zohomail.com; s=zohoarc; b=mTE2bbV6eZ0T992R6ECJ66K2NH1iLc0EZUZlZctMv2QyrFodIdx5H7hP0zn9aufV9AAXNBZ5OaqWn2hw//2sWUNBpykXHsdWdstW1m4UT7Tt8p/8fQ6C/kpI7j/6pt0LDHnNYJ1g7N11cuZZzCTw/707fISmyFL7tBW7QO9wZIQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1743676889; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=f28xi2wyhaQe1LH0VUfjjUJS/HwlKRxDpn1YfI7H4/k=; b=mari0TZTcEMdMp10XOaEooWZXyPyG6315SI19UMFqJcLduUJDwjgpBVG7BSGaHgHcP3F/hhWsCqjNRvsdbNMgu8W/40lSrMxx+4aIRYPwJPdFvQBU/P0KzYcshIi3b17SqlR+ab9q8CXhqu0frA2j438os+QiXAPwxp3vfTfs78= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1743676889279358.92361462427914; Thu, 3 Apr 2025 03:41:29 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id A4B171668; Thu, 3 Apr 2025 06:41:28 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 29E091573; Thu, 3 Apr 2025 06:37:15 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 77C521597; Thu, 3 Apr 2025 06:37:08 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 5DFDA13FB for ; Thu, 3 Apr 2025 06:36:54 -0400 (EDT) Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-563-YPp5l2EsO62VosjQLmsuBA-1; Thu, 03 Apr 2025 06:36:52 -0400 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 20B7F1809CA5 for ; Thu, 3 Apr 2025 10:36:52 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.3.236]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 697B71955BC2 for ; Thu, 3 Apr 2025 10:36:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1743676614; h=from:from: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; bh=VKOoz9LoXwnvbHf5u2LMsQ6QBl7wcFILEPFq55Gh3Pg=; b=PvYpi7J5B2oDYAufJhACfNTfNVn9L9/jHliu4Subv6R/zglPucag4x/lYwGLrBUgR7X00e F/pvXEOeiQGgTH9lopKwophHMGelCEqTuA6VRj58hyB7YMo813AWhXTfxwQORFFbGqD5N/ 10yiFsJ+UFwVJM8cfs4wm6E+bSePohc= X-MC-Unique: YPp5l2EsO62VosjQLmsuBA-1 X-Mimecast-MFC-AGG-ID: YPp5l2EsO62VosjQLmsuBA_1743676612 To: devel@lists.libvirt.org Subject: [PATCH 3/3] ch: Fix printf format strings wrt size_t argument Date: Thu, 3 Apr 2025 12:36:45 +0200 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: m4h1sLNfKuwxqr9LJEmiACNoTNz2w227IDPPOzFHaXI_1743676612 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: DYU2MYK7QXAGAZGCCTP6RZ22AQWY2RUW X-Message-ID-Hash: DYU2MYK7QXAGAZGCCTP6RZ22AQWY2RUW X-MailFrom: mprivozn@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: From: Michal Privoznik via Devel Reply-To: Michal Privoznik X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1743676889819019000 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Michal Privoznik In a few places, when a size_t typed argument is passed to a printf-like function the corresponding specifier is %ld instead of %zu. Fix those places. Signed-off-by: Michal Privoznik --- src/ch/ch_monitor.c | 4 ++-- src/ch/ch_process.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ch/ch_monitor.c b/src/ch/ch_monitor.c index 1c2c1f2858..78b6551d6c 100644 --- a/src/ch/ch_monitor.c +++ b/src/ch/ch_monitor.c @@ -156,7 +156,7 @@ virCHMonitorBuildPayloadJson(virJSONValue *content, vir= DomainDef *vmdef) buf =3D g_base64_decode(vmdef->sec->data.sev_snp.host_data, &l= en); if (len !=3D host_data_len) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Invalid host_data provided. Expected '%1= $ld' bytes"), + _("Invalid host_data provided. Expected '%1= $zu' bytes"), host_data_len); return -1; } @@ -1139,7 +1139,7 @@ virCHMonitorBuildRestoreJson(virDomainDef *vmdef, g_autoptr(virJSONValue) nets =3D virJSONValueNewArray(); for (i =3D 0; i < vmdef->nnets; i++) { g_autoptr(virJSONValue) net_json =3D virJSONValueNewObject(); - g_autofree char *id =3D g_strdup_printf("%s_%ld", CH_NET_ID_PR= EFIX, i); + g_autofree char *id =3D g_strdup_printf("%s_%zu", CH_NET_ID_PR= EFIX, i); if (virJSONValueObjectAppendString(net_json, "id", id) < 0) return -1; if (virJSONValueObjectAppendNumberInt(net_json, "num_fds", vmd= ef->nets[i]->driver.virtio.queues)) diff --git a/src/ch/ch_process.c b/src/ch/ch_process.c index a008b52752..95c808cb41 100644 --- a/src/ch/ch_process.c +++ b/src/ch/ch_process.c @@ -701,7 +701,7 @@ chProcessAddNetworkDevices(virCHDriver *driver, VIR_DEBUG("payload sent with net-add request to CH =3D %s", payloa= d); =20 virBufferAsprintf(&buf, "%s", virBufferCurrentContent(&http_header= s)); - virBufferAsprintf(&buf, "Content-Length: %ld\r\n\r\n", strlen(payl= oad)); + virBufferAsprintf(&buf, "Content-Length: %zu\r\n\r\n", strlen(payl= oad)); virBufferAsprintf(&buf, "%s", payload); payload_len =3D virBufferUse(&buf); payload =3D virBufferContentAndReset(&buf); @@ -1130,7 +1130,7 @@ virCHProcessStartRestore(virCHDriver *driver, virDoma= inObj *vm, const char *from virBufferAddLit(&http_headers, "Host: localhost\r\n"); virBufferAddLit(&http_headers, "Content-Type: application/json\r\n"); virBufferAsprintf(&buf, "%s", virBufferCurrentContent(&http_headers)); - virBufferAsprintf(&buf, "Content-Length: %ld\r\n\r\n", strlen(payload)= ); + virBufferAsprintf(&buf, "Content-Length: %zu\r\n\r\n", strlen(payload)= ); virBufferAsprintf(&buf, "%s", payload); payload_len =3D virBufferUse(&buf); payload =3D virBufferContentAndReset(&buf); --=20 2.49.0