From nobody Mon Feb 9 08:40:03 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1650611119156961.5971237674438; Fri, 22 Apr 2022 00:05:19 -0700 (PDT) Received: from localhost ([::1]:38262 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhnLx-0006KU-Pd for importer@patchew.org; Fri, 22 Apr 2022 03:05:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52940) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhnJ0-0003fa-R6 for qemu-devel@nongnu.org; Fri, 22 Apr 2022 03:02:14 -0400 Received: from mail.weilnetz.de ([37.120.169.71]:50532 helo=mail.v2201612906741603.powersrv.de) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhnIz-00005R-53 for qemu-devel@nongnu.org; Fri, 22 Apr 2022 03:02:14 -0400 Received: from qemu.weilnetz.de (qemu.weilnetz.de [188.68.58.204]) by mail.v2201612906741603.powersrv.de (Postfix) with ESMTP id 86EE9DA180C; Fri, 22 Apr 2022 09:02:11 +0200 (CEST) Received: by qemu.weilnetz.de (Postfix, from userid 1000) id 7C171462074; Fri, 22 Apr 2022 09:02:11 +0200 (CEST) From: Stefan Weil To: qemu-devel@nongnu.org Subject: [PATCH 1/3] libvhost-user: Fix wrong type of argument to formatting function (reported by LGTM) Date: Fri, 22 Apr 2022 09:01:42 +0200 Message-Id: <20220422070144.1043697-2-sw@weilnetz.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220422070144.1043697-1-sw@weilnetz.de> References: <20220422070144.1043697-1-sw@weilnetz.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=37.120.169.71; envelope-from=stefan@weilnetz.de; helo=mail.v2201612906741603.powersrv.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Stefan Weil , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Raphael Norwitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1650611121199100001 Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Stefan Weil --- This patch was already sent to the list and got reviewed, but missed release 7.0.0. subprojects/libvhost-user/libvhost-user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subprojects/libvhost-user/libvhost-user.c b/subprojects/libvho= st-user/libvhost-user.c index 47d2efc60f..2d29140a8f 100644 --- a/subprojects/libvhost-user/libvhost-user.c +++ b/subprojects/libvhost-user/libvhost-user.c @@ -651,7 +651,7 @@ generate_faults(VuDev *dev) { =20 if (ioctl(dev->postcopy_ufd, UFFDIO_REGISTER, ®_struct)) { vu_panic(dev, "%s: Failed to userfault region %d " - "@%p + size:%zx offset: %zx: (ufd=3D%d)%s\n", + "@%" PRIx64 " + size:%zx offset: %zx: (ufd=3D%d)= %s\n", __func__, i, dev_region->mmap_addr, dev_region->size, dev_region->mmap_offset, --=20 2.30.2 From nobody Mon Feb 9 08:40:03 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1650611291848611.2920234522708; Fri, 22 Apr 2022 00:08:11 -0700 (PDT) Received: from localhost ([::1]:42518 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhnOj-0001p8-Bs for importer@patchew.org; Fri, 22 Apr 2022 03:08:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52986) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhnJ9-0003kS-HI for qemu-devel@nongnu.org; Fri, 22 Apr 2022 03:02:26 -0400 Received: from mail.weilnetz.de ([37.120.169.71]:50542 helo=mail.v2201612906741603.powersrv.de) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhnJ6-00005p-T4 for qemu-devel@nongnu.org; Fri, 22 Apr 2022 03:02:22 -0400 Received: from qemu.weilnetz.de (qemu.weilnetz.de [188.68.58.204]) by mail.v2201612906741603.powersrv.de (Postfix) with ESMTP id BEA4DDA192E; Fri, 22 Apr 2022 09:02:19 +0200 (CEST) Received: by qemu.weilnetz.de (Postfix, from userid 1000) id BC0A0462074; Fri, 22 Apr 2022 09:02:19 +0200 (CEST) From: Stefan Weil To: qemu-devel@nongnu.org Subject: [PATCH 2/3] libvhost-user: Fix format strings Date: Fri, 22 Apr 2022 09:01:43 +0200 Message-Id: <20220422070144.1043697-3-sw@weilnetz.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220422070144.1043697-1-sw@weilnetz.de> References: <20220422070144.1043697-1-sw@weilnetz.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=37.120.169.71; envelope-from=stefan@weilnetz.de; helo=mail.v2201612906741603.powersrv.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Stefan Weil , Raphael Norwitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1650611292442100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Stefan Weil Reviewed-by: Marc-Andr=C3=A9 Lureau --- subprojects/libvhost-user/libvhost-user.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subprojects/libvhost-user/libvhost-user.c b/subprojects/libvho= st-user/libvhost-user.c index 2d29140a8f..94645f9154 100644 --- a/subprojects/libvhost-user/libvhost-user.c +++ b/subprojects/libvhost-user/libvhost-user.c @@ -700,7 +700,7 @@ vu_add_mem_reg(VuDev *dev, VhostUserMsg *vmsg) { if (vmsg->size < VHOST_USER_MEM_REG_SIZE) { close(vmsg->fds[0]); vu_panic(dev, "VHOST_USER_ADD_MEM_REG requires a message size of a= t " - "least %d bytes and only %d bytes were received", + "least %zu bytes and only %d bytes were received", VHOST_USER_MEM_REG_SIZE, vmsg->size); return false; } @@ -833,7 +833,7 @@ vu_rem_mem_reg(VuDev *dev, VhostUserMsg *vmsg) { if (vmsg->size < VHOST_USER_MEM_REG_SIZE) { close(vmsg->fds[0]); vu_panic(dev, "VHOST_USER_REM_MEM_REG requires a message size of a= t " - "least %d bytes and only %d bytes were received", + "least %zu bytes and only %d bytes were received", VHOST_USER_MEM_REG_SIZE, vmsg->size); return false; } --=20 2.30.2 From nobody Mon Feb 9 08:40:03 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 165061129362796.34123294117171; Fri, 22 Apr 2022 00:08:13 -0700 (PDT) Received: from localhost ([::1]:42642 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhnOm-0001tv-H2 for importer@patchew.org; Fri, 22 Apr 2022 03:08:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53032) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhnJJ-0003oZ-7I for qemu-devel@nongnu.org; Fri, 22 Apr 2022 03:02:34 -0400 Received: from mail.weilnetz.de ([37.120.169.71]:50550 helo=mail.v2201612906741603.powersrv.de) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhnJH-00006h-NV for qemu-devel@nongnu.org; Fri, 22 Apr 2022 03:02:32 -0400 Received: from qemu.weilnetz.de (qemu.weilnetz.de [188.68.58.204]) by mail.v2201612906741603.powersrv.de (Postfix) with ESMTP id 9B9CDDA1932; Fri, 22 Apr 2022 09:02:30 +0200 (CEST) Received: by qemu.weilnetz.de (Postfix, from userid 1000) id 9915F462074; Fri, 22 Apr 2022 09:02:30 +0200 (CEST) From: Stefan Weil To: qemu-devel@nongnu.org Subject: [PATCH 3/3] libvhost-user: Add format attribute to local function vu_panic Date: Fri, 22 Apr 2022 09:01:44 +0200 Message-Id: <20220422070144.1043697-4-sw@weilnetz.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220422070144.1043697-1-sw@weilnetz.de> References: <20220422070144.1043697-1-sw@weilnetz.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=37.120.169.71; envelope-from=stefan@weilnetz.de; helo=mail.v2201612906741603.powersrv.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Stefan Weil , Raphael Norwitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1650611294467100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Stefan Weil Reviewed-by: Marc-Andr=C3=A9 Lureau --- It would be good to add format attributes to local functions, too (like it is done here) to avoid future format bugs. The changes here could be simplified by including a glib header, but from the comments I assumed that is unwanted here? subprojects/libvhost-user/libvhost-user.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/subprojects/libvhost-user/libvhost-user.c b/subprojects/libvho= st-user/libvhost-user.c index 94645f9154..29ab85fc9d 100644 --- a/subprojects/libvhost-user/libvhost-user.c +++ b/subprojects/libvhost-user/libvhost-user.c @@ -45,6 +45,17 @@ #include "libvhost-user.h" =20 /* usually provided by GLib */ +#if __GNUC__ > 2 || (__GNUC__ =3D=3D 2 && __GNUC_MINOR__ > 4) +#if !defined(__clang__) && (__GNUC__ =3D=3D 4 && __GNUC_MINOR__ =3D=3D 4) +#define G_GNUC_PRINTF(format_idx, arg_idx) \ + __attribute__((__format__(gnu_printf, format_idx, arg_idx))) +#else +#define G_GNUC_PRINTF(format_idx, arg_idx) \ + __attribute__((__format__(__printf__, format_idx, arg_idx))) +#endif +#else /* !__GNUC__ */ +#define G_GNUC_PRINTF(format_idx, arg_idx) +#endif /* !__GNUC__ */ #ifndef MIN #define MIN(x, y) ({ \ typeof(x) _min1 =3D (x); \ @@ -151,7 +162,7 @@ vu_request_to_string(unsigned int req) } } =20 -static void +static void G_GNUC_PRINTF(2, 3) vu_panic(VuDev *dev, const char *msg, ...) { char *buf =3D NULL; --=20 2.30.2