From nobody Sun May 5 22:16:16 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1671454987; cv=none; d=zohomail.com; s=zohoarc; b=G9fFAmQaFAVnXcwyuupb2BCVbN8wW87EX1klm1EGTArPX1sNGW+kpb5P7kNU9L3dzq9R53kRSRgG7vLsqX2uPneKuXXwPQGoNU/ceETKGwSgqYcFqpMvPW0e6DKef7x4uZk3B66qR7tZ9/WpQCW1BraHrWKqTGyBra3bNbNIjjE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671454987; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=lZcczZS+N+vA1eZ+A79wIe+fnTT7PirYzB1gzQ8wivc=; b=RCI5LUtWFcyIYQsWHjVlq/v2wlBGWIFqYMA6o6Yztu+Zxxk2F9jF/s7FlBMKqgAqkuoROtOWq+ppVaozvYk5fV2XbuBzq7vwsePaJUThhoyP/MRcuqjSQZS3cy0u5bvmTTE/XpALfCCEkdX6PkxHVJf8EvFC6RrEaU4FoFY9h1M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1671454987436923.5695197217718; Mon, 19 Dec 2022 05:03:07 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.466036.724898 (Exim 4.92) (envelope-from ) id 1p7Fmk-0007az-Nf; Mon, 19 Dec 2022 13:02:26 +0000 Received: by outflank-mailman (output) from mailman id 466036.724898; Mon, 19 Dec 2022 13:02:26 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1p7Fmk-0007aC-Iu; Mon, 19 Dec 2022 13:02:26 +0000 Received: by outflank-mailman (input) for mailman id 466036; Mon, 19 Dec 2022 13:02:24 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1p7Fmi-0006zl-Ja for xen-devel@lists.xenproject.org; Mon, 19 Dec 2022 13:02:24 +0000 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 60a35776-7f9d-11ed-91b6-6bf2151ebd3b; Mon, 19 Dec 2022 14:02:23 +0100 (CET) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-486-Nb6M1rL5PvikIs1MYPlhQQ-1; Mon, 19 Dec 2022 08:02:15 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A806780D0F2; Mon, 19 Dec 2022 13:02:07 +0000 (UTC) Received: from virtlab420.virt.lab.eng.bos.redhat.com (virtlab420.virt.lab.eng.bos.redhat.com [10.19.152.148]) by smtp.corp.redhat.com (Postfix) with ESMTP id 098F214171B7; Mon, 19 Dec 2022 13:02:07 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 60a35776-7f9d-11ed-91b6-6bf2151ebd3b DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1671454942; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lZcczZS+N+vA1eZ+A79wIe+fnTT7PirYzB1gzQ8wivc=; b=Mi9ed1GTOIKthNp6PzkK7FhrZdwNP9TAoxY82YOz/Bvn9dGJtWfR0/fEFVee+/8eg+686p sYjsDQXCnelJnMtqiqPXQaVd645nQLzVhvdzZJx7jdxuuWNd2umUl2JNukOzsOzdwnVrpE AEq4eFEOFA4lml4IZgXiCPDUBW6vGPg= X-MC-Unique: Nb6M1rL5PvikIs1MYPlhQQ-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: "Dr. David Alan Gilbert" , qemu-ppc@nongnu.org, xen-devel@lists.xenproject.org, Laurent Vivier , Markus Armbruster , Daniel Henrique Barboza , virtio-fs@redhat.com, Michael Roth , =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-block@nongnu.org, Peter Maydell , qemu-arm@nongnu.org, Paul Durrant , Anthony Perard , David Gibson , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , John Snow , Stefan Hajnoczi , Paolo Bonzini , Stefano Stabellini , Gerd Hoffmann , Greg Kurz , Thomas Huth , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 1/6] disas: add G_GNUC_PRINTF to gstring_printf Date: Mon, 19 Dec 2022 08:02:00 -0500 Message-Id: <20221219130205.687815-2-berrange@redhat.com> In-Reply-To: <20221219130205.687815-1-berrange@redhat.com> References: <20221219130205.687815-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1671454988810100001 Signed-off-by: Daniel P. Berrang=C3=A9 --- disas.c | 1 + 1 file changed, 1 insertion(+) diff --git a/disas.c b/disas.c index 94d3b45042..31df8f5b89 100644 --- a/disas.c +++ b/disas.c @@ -239,6 +239,7 @@ void target_disas(FILE *out, CPUState *cpu, target_ulon= g code, } } =20 +G_GNUC_PRINTF(2, 3) static int gstring_printf(FILE *stream, const char *fmt, ...) { /* We abuse the FILE parameter to pass a GString. */ --=20 2.38.1 From nobody Sun May 5 22:16:16 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1671454986; cv=none; d=zohomail.com; s=zohoarc; b=lI6wi3viPWDLcamN8eyrKECLeISPdaWFy3OIsW4mEqfNRBYlLl58sboXBo21C2fnVmK9ojjRcpmJALyiAlWQ4quSDxH4D6lMlg74Z22CTk0dDklr5TI9pm38UFn6cZ6YlsNfP7Sbh5cACCmbMNVe2O7jd3V71zsn6+3/RsSVEA0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671454986; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=4JFb6QDUDH0Iblrn1PZyR6v+EegDDw+5LlL9IfN5m+I=; b=mPcbr4bKbeJ1NkU/RR7GvUsYtQ05AzP/4QQ2/W3pVjKaZ0/i6F+6aV6x8ewG9rsnD6hxU3MCgrRyfOC71V6EIy4485JQxFNS4f2gjqU7/7Uxja/Rqu9owjo+9gwwloqpvFSEMlRRusjB+FEmL8bPjCLklVOQx6mrpgEN6yIPNhY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1671454986752751.83170912874; Mon, 19 Dec 2022 05:03:06 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.466033.724865 (Exim 4.92) (envelope-from ) id 1p7Fmg-0006nu-N0; Mon, 19 Dec 2022 13:02:22 +0000 Received: by outflank-mailman (output) from mailman id 466033.724865; Mon, 19 Dec 2022 13:02:22 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1p7Fmg-0006nm-KF; Mon, 19 Dec 2022 13:02:22 +0000 Received: by outflank-mailman (input) for mailman id 466033; Mon, 19 Dec 2022 13:02:22 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1p7Fmf-0006YQ-Vy for xen-devel@lists.xenproject.org; Mon, 19 Dec 2022 13:02:22 +0000 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 59d2a6ce-7f9d-11ed-8fd4-01056ac49cbb; Mon, 19 Dec 2022 14:02:12 +0100 (CET) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-481-EAFyuzouPl60pgDLpips4g-1; Mon, 19 Dec 2022 08:02:16 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5B72588742F; Mon, 19 Dec 2022 13:02:08 +0000 (UTC) Received: from virtlab420.virt.lab.eng.bos.redhat.com (virtlab420.virt.lab.eng.bos.redhat.com [10.19.152.148]) by smtp.corp.redhat.com (Postfix) with ESMTP id B2A8C14171C5; Mon, 19 Dec 2022 13:02:07 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 59d2a6ce-7f9d-11ed-8fd4-01056ac49cbb DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1671454940; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4JFb6QDUDH0Iblrn1PZyR6v+EegDDw+5LlL9IfN5m+I=; b=g07AC4bxBgWA4MylYKSc3U70lOg0oO/xIPEd+OKBtRNUFA1t7R1GBETeImK1dT0P1gBsXp Fr9CjIdC+rUi8RPyh3CSR+M8a7aABj4I/yhE83gXcrA/lNhblGn+kR0B9HM5XGNnT668/S bGKrseeDFGrd11x4Tn2au3RwNpexXkY= X-MC-Unique: EAFyuzouPl60pgDLpips4g-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: "Dr. David Alan Gilbert" , qemu-ppc@nongnu.org, xen-devel@lists.xenproject.org, Laurent Vivier , Markus Armbruster , Daniel Henrique Barboza , virtio-fs@redhat.com, Michael Roth , =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-block@nongnu.org, Peter Maydell , qemu-arm@nongnu.org, Paul Durrant , Anthony Perard , David Gibson , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , John Snow , Stefan Hajnoczi , Paolo Bonzini , Stefano Stabellini , Gerd Hoffmann , Greg Kurz , Thomas Huth , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 2/6] hw/xen: use G_GNUC_PRINTF/SCANF for various functions Date: Mon, 19 Dec 2022 08:02:01 -0500 Message-Id: <20221219130205.687815-3-berrange@redhat.com> In-Reply-To: <20221219130205.687815-1-berrange@redhat.com> References: <20221219130205.687815-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1671454988822100002 Signed-off-by: Daniel P. Berrang=C3=A9 Acked-by: Anthony PERARD --- hw/xen/xen-bus.c | 1 + hw/xen/xen_pvdev.c | 1 + include/hw/xen/xen-bus-helper.h | 6 ++++-- include/hw/xen/xen-bus.h | 3 ++- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/hw/xen/xen-bus.c b/hw/xen/xen-bus.c index 645a29a5a0..df3f6b9ae0 100644 --- a/hw/xen/xen-bus.c +++ b/hw/xen/xen-bus.c @@ -561,6 +561,7 @@ void xen_device_backend_printf(XenDevice *xendev, const= char *key, } } =20 +G_GNUC_SCANF(3, 4) static int xen_device_backend_scanf(XenDevice *xendev, const char *key, const char *fmt, ...) { diff --git a/hw/xen/xen_pvdev.c b/hw/xen/xen_pvdev.c index 037152f063..1a5177b354 100644 --- a/hw/xen/xen_pvdev.c +++ b/hw/xen/xen_pvdev.c @@ -196,6 +196,7 @@ const char *xenbus_strstate(enum xenbus_state state) * 2 =3D=3D noisy debug messages (logfile only). * 3 =3D=3D will flood your log (logfile only). */ +G_GNUC_PRINTF(3, 0) static void xen_pv_output_msg(struct XenLegacyDevice *xendev, FILE *f, const char *fmt, va_list args) { diff --git a/include/hw/xen/xen-bus-helper.h b/include/hw/xen/xen-bus-helpe= r.h index 629a904d1a..8782f30550 100644 --- a/include/hw/xen/xen-bus-helper.h +++ b/include/hw/xen/xen-bus-helper.h @@ -31,10 +31,12 @@ void xs_node_printf(struct xs_handle *xsh, xs_transact= ion_t tid, /* Read from node/key unless node is empty, in which case read from key */ int xs_node_vscanf(struct xs_handle *xsh, xs_transaction_t tid, const char *node, const char *key, Error **errp, - const char *fmt, va_list ap); + const char *fmt, va_list ap) + G_GNUC_SCANF(6, 0); int xs_node_scanf(struct xs_handle *xsh, xs_transaction_t tid, const char *node, const char *key, Error **errp, - const char *fmt, ...); + const char *fmt, ...) + G_GNUC_SCANF(6, 7); =20 /* Watch node/key unless node is empty, in which case watch key */ void xs_node_watch(struct xs_handle *xsh, const char *node, const char *ke= y, diff --git a/include/hw/xen/xen-bus.h b/include/hw/xen/xen-bus.h index 713e763348..4d966a2dbb 100644 --- a/include/hw/xen/xen-bus.h +++ b/include/hw/xen/xen-bus.h @@ -94,7 +94,8 @@ void xen_device_frontend_printf(XenDevice *xendev, const = char *key, G_GNUC_PRINTF(3, 4); =20 int xen_device_frontend_scanf(XenDevice *xendev, const char *key, - const char *fmt, ...); + const char *fmt, ...) + G_GNUC_SCANF(3, 4); =20 void xen_device_set_max_grant_refs(XenDevice *xendev, unsigned int nr_refs, Error **errp); --=20 2.38.1 From nobody Sun May 5 22:16:16 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1671454984; cv=none; d=zohomail.com; s=zohoarc; b=M0Ze6Wnrdu8KmCJnOWfHD9v7bVM3wHBjVq41rzNY8AANMrK31ggaiKN62essD4l++iawxYq/qUti1vxP4wkEoCW9g//xZxmM/cK+nPkMSgPrUvL2JIOiE6e5z0t67jo30vmuiFkFTRmhkUdCkCoUMNA3sN3kRv1rfv6/hH7+QcM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671454984; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=wzWaSBpVzZ+UszDBN2auCYULSVVrv+uDnPPKe4kNt7I=; b=bcDE8SKN9NmNGtWTEq+yoe92ofhyhJT+dFEhh2CfeUplTX9FPXeQ50Qx+hpwnsCOdo1OkmO2heAAcQuVHekF1DV10eBSCENhft74yf1b5quzFfKy0PojZuUY37fEnJWfFEsbsjd+gxOjECpnfuZIldKIrNyOLePt890dPLu9uyU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 167145498438266.82145940339262; Mon, 19 Dec 2022 05:03:04 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.466037.724910 (Exim 4.92) (envelope-from ) id 1p7Fmm-0007tE-11; Mon, 19 Dec 2022 13:02:28 +0000 Received: by outflank-mailman (output) from mailman id 466037.724910; Mon, 19 Dec 2022 13:02:27 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1p7Fml-0007sO-SS; Mon, 19 Dec 2022 13:02:27 +0000 Received: by outflank-mailman (input) for mailman id 466037; Mon, 19 Dec 2022 13:02:26 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1p7Fmk-0006zl-BU for xen-devel@lists.xenproject.org; Mon, 19 Dec 2022 13:02:26 +0000 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 61c21414-7f9d-11ed-91b6-6bf2151ebd3b; Mon, 19 Dec 2022 14:02:25 +0100 (CET) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-70-mFdMVFyuMJy-tJT1BG9NhQ-1; Mon, 19 Dec 2022 08:02:16 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 10B1F887434; Mon, 19 Dec 2022 13:02:09 +0000 (UTC) Received: from virtlab420.virt.lab.eng.bos.redhat.com (virtlab420.virt.lab.eng.bos.redhat.com [10.19.152.148]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6669D14171B6; Mon, 19 Dec 2022 13:02:08 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 61c21414-7f9d-11ed-91b6-6bf2151ebd3b DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1671454944; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wzWaSBpVzZ+UszDBN2auCYULSVVrv+uDnPPKe4kNt7I=; b=LF3xbbJ/SkQ7bH01PgPdnHP9M+kcB68fjgvj+y+6Ot2oKczoGGybNN2paO+uDRZPr60Arr GJ1ACsuOpm51af8IR86aZ1SDdBeiOq2VadV2WYc12xuX1a6FapaSZsD4J7v8rbsdo0r/c9 RN+fJVzLAg2LYBiLkYahp5z5cxWRzKo= X-MC-Unique: mFdMVFyuMJy-tJT1BG9NhQ-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: "Dr. David Alan Gilbert" , qemu-ppc@nongnu.org, xen-devel@lists.xenproject.org, Laurent Vivier , Markus Armbruster , Daniel Henrique Barboza , virtio-fs@redhat.com, Michael Roth , =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-block@nongnu.org, Peter Maydell , qemu-arm@nongnu.org, Paul Durrant , Anthony Perard , David Gibson , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , John Snow , Stefan Hajnoczi , Paolo Bonzini , Stefano Stabellini , Gerd Hoffmann , Greg Kurz , Thomas Huth , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 3/6] tools/virtiofsd: add G_GNUC_PRINTF for logging functions Date: Mon, 19 Dec 2022 08:02:02 -0500 Message-Id: <20221219130205.687815-4-berrange@redhat.com> In-Reply-To: <20221219130205.687815-1-berrange@redhat.com> References: <20221219130205.687815-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1671454984941100001 Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Dr. David Alan Gilbert --- tools/virtiofsd/fuse_log.c | 1 + tools/virtiofsd/fuse_log.h | 6 ++++-- tools/virtiofsd/passthrough_ll.c | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/virtiofsd/fuse_log.c b/tools/virtiofsd/fuse_log.c index 745d88cd2a..2de3f48ee7 100644 --- a/tools/virtiofsd/fuse_log.c +++ b/tools/virtiofsd/fuse_log.c @@ -12,6 +12,7 @@ #include "fuse_log.h" =20 =20 +G_GNUC_PRINTF(2, 0) static void default_log_func(__attribute__((unused)) enum fuse_log_level l= evel, const char *fmt, va_list ap) { diff --git a/tools/virtiofsd/fuse_log.h b/tools/virtiofsd/fuse_log.h index 8d7091bd4d..e5c2967ab9 100644 --- a/tools/virtiofsd/fuse_log.h +++ b/tools/virtiofsd/fuse_log.h @@ -45,7 +45,8 @@ enum fuse_log_level { * @param ap format string arguments */ typedef void (*fuse_log_func_t)(enum fuse_log_level level, const char *fmt, - va_list ap); + va_list ap) + G_GNUC_PRINTF(2, 0); =20 /** * Install a custom log handler function. @@ -68,6 +69,7 @@ void fuse_set_log_func(fuse_log_func_t func); * @param level severity level (FUSE_LOG_ERR, FUSE_LOG_DEBUG, etc) * @param fmt sprintf-style format string including newline */ -void fuse_log(enum fuse_log_level level, const char *fmt, ...); +void fuse_log(enum fuse_log_level level, const char *fmt, ...) + G_GNUC_PRINTF(2, 3); =20 #endif /* FUSE_LOG_H_ */ diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough= _ll.c index 20f0f41f99..40ea2ed27f 100644 --- a/tools/virtiofsd/passthrough_ll.c +++ b/tools/virtiofsd/passthrough_ll.c @@ -4182,6 +4182,7 @@ static void setup_nofile_rlimit(unsigned long rlimit_= nofile) } } =20 +G_GNUC_PRINTF(2, 0) static void log_func(enum fuse_log_level level, const char *fmt, va_list a= p) { g_autofree char *localfmt =3D NULL; --=20 2.38.1 From nobody Sun May 5 22:16:16 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1671454982; cv=none; d=zohomail.com; s=zohoarc; b=SNsS/G4gegZxbx4kjpuyAElmmnFkXi+RnSQ4rPsl/H6PLiCB7x2n72iWZYFUk3f8p5JFd1uJDFCMIjj78sYnhW2svU5cA1BlUkTq4MimdXXvGMbeJzjx+CGK4WP7cC6I0sOo+B2HH4S+w3DsCOjDegXt1hyt8og4eRX11zxMRb0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671454982; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=y/JPz/RYrixYpdTBpAkJB1EIwOzHLyPTKspd8A5hdhQ=; b=nJtdM4R56mKbvW3VpG8XzogRga4ZlIHV92rV+iPfBYH5VDQUUur4Wka59DPVtBMhSzz51T2gioK8ScczaExBURDrXEARt7o20Akrx8PoGSHXG1REB2JCVOUZQNg8MK7xcKcUV5mrQPS37hMrC/vtbO2I15Rj7BmvLkgOJ8RHs48= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1671454982882782.3449541389002; Mon, 19 Dec 2022 05:03:02 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.466035.724881 (Exim 4.92) (envelope-from ) id 1p7Fmj-00078J-DN; Mon, 19 Dec 2022 13:02:25 +0000 Received: by outflank-mailman (output) from mailman id 466035.724881; Mon, 19 Dec 2022 13:02:25 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1p7Fmj-00077T-9W; Mon, 19 Dec 2022 13:02:25 +0000 Received: by outflank-mailman (input) for mailman id 466035; Mon, 19 Dec 2022 13:02:24 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1p7Fmi-0006zl-59 for xen-devel@lists.xenproject.org; Mon, 19 Dec 2022 13:02:24 +0000 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 60177011-7f9d-11ed-91b6-6bf2151ebd3b; Mon, 19 Dec 2022 14:02:22 +0100 (CET) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-228-rbAz9N-rM3GgWBs_tCRJuw-1; Mon, 19 Dec 2022 08:02:17 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B973D88743B; Mon, 19 Dec 2022 13:02:09 +0000 (UTC) Received: from virtlab420.virt.lab.eng.bos.redhat.com (virtlab420.virt.lab.eng.bos.redhat.com [10.19.152.148]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1C57F14171BA; Mon, 19 Dec 2022 13:02:09 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 60177011-7f9d-11ed-91b6-6bf2151ebd3b DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1671454941; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=y/JPz/RYrixYpdTBpAkJB1EIwOzHLyPTKspd8A5hdhQ=; b=OIGzZZRUMOGxHlpk2/CfBdTi7o4wG8gHbniDrDEHu0o6y2YXcs4RJdH7Oih24haPN6mzRL qR7SbXrJjMOoLrmT8uKMEW8qLeLpNZtaGyblT+JDZ6v7rP9zq2UCg+kFk5Q5LXgWv08Gpr vVT9yLdUM3fExYbBbTu22+UhxAxg4/s= X-MC-Unique: rbAz9N-rM3GgWBs_tCRJuw-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: "Dr. David Alan Gilbert" , qemu-ppc@nongnu.org, xen-devel@lists.xenproject.org, Laurent Vivier , Markus Armbruster , Daniel Henrique Barboza , virtio-fs@redhat.com, Michael Roth , =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-block@nongnu.org, Peter Maydell , qemu-arm@nongnu.org, Paul Durrant , Anthony Perard , David Gibson , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , John Snow , Stefan Hajnoczi , Paolo Bonzini , Stefano Stabellini , Gerd Hoffmann , Greg Kurz , Thomas Huth , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 4/6] util/error: add G_GNUC_PRINTF for various functions Date: Mon, 19 Dec 2022 08:02:03 -0500 Message-Id: <20221219130205.687815-5-berrange@redhat.com> In-Reply-To: <20221219130205.687815-1-berrange@redhat.com> References: <20221219130205.687815-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1671454985003100003 Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth --- util/error-report.c | 1 + util/error.c | 1 + 2 files changed, 2 insertions(+) diff --git a/util/error-report.c b/util/error-report.c index 5edb2e6040..6e44a55732 100644 --- a/util/error-report.c +++ b/util/error-report.c @@ -193,6 +193,7 @@ real_time_iso8601(void) * a single phrase, with no newline or trailing punctuation. * Prepend the current location and append a newline. */ +G_GNUC_PRINTF(2, 0) static void vreport(report_type type, const char *fmt, va_list ap) { gchar *timestr; diff --git a/util/error.c b/util/error.c index b6c89d1412..1e7af665b8 100644 --- a/util/error.c +++ b/util/error.c @@ -45,6 +45,7 @@ static void error_handle_fatal(Error **errp, Error *err) } } =20 +G_GNUC_PRINTF(6, 0) static void error_setv(Error **errp, const char *src, int line, const char *func, ErrorClass err_class, const char *fmt, va_list ap, --=20 2.38.1 From nobody Sun May 5 22:16:16 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1671454989; cv=none; d=zohomail.com; s=zohoarc; b=NCZI+KtYfFSy2WUFvYWbyOqYAbozYuy4vxIMJEQvWW6xp1MSAYLiupLAKqO/Z5vfweWHcu5LL5TLKRJ/J1O09NEsrCBe//o/GB0HIg5jn2AsK+8KuQIaVi5kO8xUVdXSoF9iCYF56sfFQClPggXUGy7xwMGdvNGUKiS5PlcNp/Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671454989; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Xw+ckm/z8iJE0gLdoGtXCV/KPvsOLIutcQtOkVGM3AI=; b=EdIw+WE+Lrh6b1TQQCGPzCEGmcKBk1Prf2by4Bfj+PllnkbYcM6/riwsZz72xwb1bXAgDqHpUcg8zNOUu8kYIUba4fLgi+AKArfFQQ4hN5t3+9dBrdyUBUpZxDFWU5gzWyGHRXcklkiU4Gy5PRlULkX4uqZChYIy9biXt8Cog4c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1671454989045278.35770130993797; Mon, 19 Dec 2022 05:03:09 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.466038.724921 (Exim 4.92) (envelope-from ) id 1p7Fmq-0008IY-Br; Mon, 19 Dec 2022 13:02:32 +0000 Received: by outflank-mailman (output) from mailman id 466038.724921; Mon, 19 Dec 2022 13:02:32 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1p7Fmq-0008IJ-7y; Mon, 19 Dec 2022 13:02:32 +0000 Received: by outflank-mailman (input) for mailman id 466038; Mon, 19 Dec 2022 13:02:31 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1p7Fmo-0006zl-VO for xen-devel@lists.xenproject.org; Mon, 19 Dec 2022 13:02:31 +0000 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 643afc6b-7f9d-11ed-91b6-6bf2151ebd3b; Mon, 19 Dec 2022 14:02:29 +0100 (CET) Received: from mimecast-mx02.redhat.com (mx3-rdu2.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-549-_H72VPWrOC2TXqiPzts5tA-1; Mon, 19 Dec 2022 08:02:24 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6D95C2806078; Mon, 19 Dec 2022 13:02:10 +0000 (UTC) Received: from virtlab420.virt.lab.eng.bos.redhat.com (virtlab420.virt.lab.eng.bos.redhat.com [10.19.152.148]) by smtp.corp.redhat.com (Postfix) with ESMTP id C551E14171BA; Mon, 19 Dec 2022 13:02:09 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 643afc6b-7f9d-11ed-91b6-6bf2151ebd3b DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1671454948; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Xw+ckm/z8iJE0gLdoGtXCV/KPvsOLIutcQtOkVGM3AI=; b=KEqh1on4pcp0jLoyK9C0THlgm334upuxZMy0J8Vi/m4ayL0KxRlsg+isZpLk5y20rOSUWl mjyt0EajS7QFJyEdlU85/6sTq7P40BkcRNw05wTWW4yNMLw+3F23qqtN5flSw14sQU01Ly PqTrRS1SvYAGwiq2B2cLpbCLDmmx0vY= X-MC-Unique: _H72VPWrOC2TXqiPzts5tA-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: "Dr. David Alan Gilbert" , qemu-ppc@nongnu.org, xen-devel@lists.xenproject.org, Laurent Vivier , Markus Armbruster , Daniel Henrique Barboza , virtio-fs@redhat.com, Michael Roth , =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-block@nongnu.org, Peter Maydell , qemu-arm@nongnu.org, Paul Durrant , Anthony Perard , David Gibson , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , John Snow , Stefan Hajnoczi , Paolo Bonzini , Stefano Stabellini , Gerd Hoffmann , Greg Kurz , Thomas Huth , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 5/6] tests: add G_GNUC_PRINTF for various functions Date: Mon, 19 Dec 2022 08:02:04 -0500 Message-Id: <20221219130205.687815-6-berrange@redhat.com> In-Reply-To: <20221219130205.687815-1-berrange@redhat.com> References: <20221219130205.687815-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1671454990937100001 Signed-off-by: Daniel P. Berrang=C3=A9 --- tests/qtest/ahci-test.c | 3 +++ tests/qtest/arm-cpu-features.c | 1 + tests/qtest/erst-test.c | 2 +- tests/qtest/ide-test.c | 3 ++- tests/qtest/ivshmem-test.c | 4 ++-- tests/qtest/libqmp.c | 2 +- tests/qtest/libqos/libqos-pc.h | 6 ++++-- tests/qtest/libqos/libqos-spapr.h | 6 ++++-- tests/qtest/libqos/libqos.h | 6 ++++-- tests/qtest/libqos/virtio-9p.c | 1 + tests/qtest/migration-helpers.h | 1 + tests/qtest/rtas-test.c | 2 +- tests/qtest/usb-hcd-uhci-test.c | 4 ++-- tests/unit/test-qmp-cmds.c | 13 +++++++++---- 14 files changed, 36 insertions(+), 18 deletions(-) diff --git a/tests/qtest/ahci-test.c b/tests/qtest/ahci-test.c index 66652fed04..1967cd5898 100644 --- a/tests/qtest/ahci-test.c +++ b/tests/qtest/ahci-test.c @@ -154,6 +154,7 @@ static void ahci_migrate(AHCIQState *from, AHCIQState *= to, const char *uri) /** * Start a Q35 machine and bookmark a handle to the AHCI device. */ +G_GNUC_PRINTF(1, 0) static AHCIQState *ahci_vboot(const char *cli, va_list ap) { AHCIQState *s; @@ -171,6 +172,7 @@ static AHCIQState *ahci_vboot(const char *cli, va_list = ap) /** * Start a Q35 machine and bookmark a handle to the AHCI device. */ +G_GNUC_PRINTF(1, 2) static AHCIQState *ahci_boot(const char *cli, ...) { AHCIQState *s; @@ -209,6 +211,7 @@ static void ahci_shutdown(AHCIQState *ahci) * Boot and fully enable the HBA device. * @see ahci_boot, ahci_pci_enable and ahci_hba_enable. */ +G_GNUC_PRINTF(1, 2) static AHCIQState *ahci_boot_and_enable(const char *cli, ...) { AHCIQState *ahci; diff --git a/tests/qtest/arm-cpu-features.c b/tests/qtest/arm-cpu-features.c index 5a14527386..8691802950 100644 --- a/tests/qtest/arm-cpu-features.c +++ b/tests/qtest/arm-cpu-features.c @@ -32,6 +32,7 @@ static QDict *do_query_no_props(QTestState *qts, const ch= ar *cpu_type) QUERY_TAIL, cpu_type); } =20 +G_GNUC_PRINTF(3, 4) static QDict *do_query(QTestState *qts, const char *cpu_type, const char *fmt, ...) { diff --git a/tests/qtest/erst-test.c b/tests/qtest/erst-test.c index 974e8bcfe5..c45bee7f05 100644 --- a/tests/qtest/erst-test.c +++ b/tests/qtest/erst-test.c @@ -98,7 +98,7 @@ static void setup_vm_cmd(ERSTState *s, const char *cmd) const char *arch =3D qtest_get_arch(); =20 if (strcmp(arch, "i386") =3D=3D 0 || strcmp(arch, "x86_64") =3D=3D 0) { - s->qs =3D qtest_pc_boot(cmd); + s->qs =3D qtest_pc_boot("%s", cmd); } else { g_printerr("erst-test tests are only available on x86\n"); exit(EXIT_FAILURE); diff --git a/tests/qtest/ide-test.c b/tests/qtest/ide-test.c index dbe1563b23..dcb050bf9b 100644 --- a/tests/qtest/ide-test.c +++ b/tests/qtest/ide-test.c @@ -125,6 +125,7 @@ static QGuestAllocator guest_malloc; static char *tmp_path[2]; static char *debug_path; =20 +G_GNUC_PRINTF(1, 2) static QTestState *ide_test_start(const char *cmdline_fmt, ...) { QTestState *qts; @@ -788,7 +789,7 @@ static void test_flush_nodev(void) QPCIDevice *dev; QPCIBar bmdma_bar, ide_bar; =20 - qts =3D ide_test_start(""); + qts =3D ide_test_start("%s", ""); =20 dev =3D get_pci_device(qts, &bmdma_bar, &ide_bar); =20 diff --git a/tests/qtest/ivshmem-test.c b/tests/qtest/ivshmem-test.c index cd550c8935..9bf8e78df6 100644 --- a/tests/qtest/ivshmem-test.c +++ b/tests/qtest/ivshmem-test.c @@ -109,9 +109,9 @@ static void setup_vm_cmd(IVState *s, const char *cmd, b= ool msix) const char *arch =3D qtest_get_arch(); =20 if (strcmp(arch, "i386") =3D=3D 0 || strcmp(arch, "x86_64") =3D=3D 0) { - s->qs =3D qtest_pc_boot(cmd); + s->qs =3D qtest_pc_boot("%s", cmd); } else if (strcmp(arch, "ppc64") =3D=3D 0) { - s->qs =3D qtest_spapr_boot(cmd); + s->qs =3D qtest_spapr_boot("%s", cmd); } else { g_printerr("ivshmem-test tests are only available on x86 or ppc64\= n"); exit(EXIT_FAILURE); diff --git a/tests/qtest/libqmp.c b/tests/qtest/libqmp.c index 2b08382e5d..a89cab03c3 100644 --- a/tests/qtest/libqmp.c +++ b/tests/qtest/libqmp.c @@ -134,7 +134,7 @@ static void socket_send_fds(int socket_fd, int *fds, si= ze_t fds_num, * in the case that they choose to discard all replies up until * a particular EVENT is received. */ -static void +static G_GNUC_PRINTF(4, 0) void _qmp_fd_vsend_fds(int fd, int *fds, size_t fds_num, const char *fmt, va_list ap) { diff --git a/tests/qtest/libqos/libqos-pc.h b/tests/qtest/libqos/libqos-pc.h index 1a9923ead4..a2e4209a49 100644 --- a/tests/qtest/libqos/libqos-pc.h +++ b/tests/qtest/libqos/libqos-pc.h @@ -3,8 +3,10 @@ =20 #include "libqos.h" =20 -QOSState *qtest_pc_vboot(const char *cmdline_fmt, va_list ap); -QOSState *qtest_pc_boot(const char *cmdline_fmt, ...); +QOSState *qtest_pc_vboot(const char *cmdline_fmt, va_list ap) + G_GNUC_PRINTF(1, 0); +QOSState *qtest_pc_boot(const char *cmdline_fmt, ...) + G_GNUC_PRINTF(1, 2); void qtest_pc_shutdown(QOSState *qs); =20 #endif diff --git a/tests/qtest/libqos/libqos-spapr.h b/tests/qtest/libqos/libqos-= spapr.h index c61338917a..e4483c14f8 100644 --- a/tests/qtest/libqos/libqos-spapr.h +++ b/tests/qtest/libqos/libqos-spapr.h @@ -3,8 +3,10 @@ =20 #include "libqos.h" =20 -QOSState *qtest_spapr_vboot(const char *cmdline_fmt, va_list ap); -QOSState *qtest_spapr_boot(const char *cmdline_fmt, ...); +QOSState *qtest_spapr_vboot(const char *cmdline_fmt, va_list ap) + G_GNUC_PRINTF(1, 0); +QOSState *qtest_spapr_boot(const char *cmdline_fmt, ...) + G_GNUC_PRINTF(1, 2); void qtest_spapr_shutdown(QOSState *qs); =20 /* List of capabilities needed to silence warnings with TCG */ diff --git a/tests/qtest/libqos/libqos.h b/tests/qtest/libqos/libqos.h index 9b4dd509f0..12d05b2365 100644 --- a/tests/qtest/libqos/libqos.h +++ b/tests/qtest/libqos/libqos.h @@ -21,8 +21,10 @@ struct QOSState { QOSOps *ops; }; =20 -QOSState *qtest_vboot(QOSOps *ops, const char *cmdline_fmt, va_list ap); -QOSState *qtest_boot(QOSOps *ops, const char *cmdline_fmt, ...); +QOSState *qtest_vboot(QOSOps *ops, const char *cmdline_fmt, va_list ap) + G_GNUC_PRINTF(2, 0); +QOSState *qtest_boot(QOSOps *ops, const char *cmdline_fmt, ...) + G_GNUC_PRINTF(2, 3); void qtest_common_shutdown(QOSState *qs); void qtest_shutdown(QOSState *qs); bool have_qemu_img(void); diff --git a/tests/qtest/libqos/virtio-9p.c b/tests/qtest/libqos/virtio-9p.c index 7f21028256..186fcc1141 100644 --- a/tests/qtest/libqos/virtio-9p.c +++ b/tests/qtest/libqos/virtio-9p.c @@ -211,6 +211,7 @@ static void *virtio_9p_pci_create(void *pci_bus, QGuest= Allocator *t_alloc, * variable arguments of this function to this * replacement string */ +G_GNUC_PRINTF(3, 4) static void regex_replace(GString *haystack, const char *pattern, const char *replace_fmt, ...) { diff --git a/tests/qtest/migration-helpers.h b/tests/qtest/migration-helper= s.h index db0684de48..a188b62787 100644 --- a/tests/qtest/migration-helpers.h +++ b/tests/qtest/migration-helpers.h @@ -25,6 +25,7 @@ QDict *wait_command_fd(QTestState *who, int fd, const cha= r *command, ...); G_GNUC_PRINTF(2, 3) QDict *wait_command(QTestState *who, const char *command, ...); =20 +G_GNUC_PRINTF(2, 3) QDict *qmp_command(QTestState *who, const char *command, ...); =20 G_GNUC_PRINTF(3, 4) diff --git a/tests/qtest/rtas-test.c b/tests/qtest/rtas-test.c index 50df60e5b2..1ba42b37d2 100644 --- a/tests/qtest/rtas-test.c +++ b/tests/qtest/rtas-test.c @@ -13,7 +13,7 @@ static void run_test_rtas_get_time_of_day(const char *mac= hine) uint64_t ret; time_t t1, t2; =20 - qs =3D qtest_spapr_boot(machine); + qs =3D qtest_spapr_boot("%s", machine); =20 t1 =3D time(NULL); ret =3D qrtas_get_time_of_day(qs->qts, &qs->alloc, &tm, &ns); diff --git a/tests/qtest/usb-hcd-uhci-test.c b/tests/qtest/usb-hcd-uhci-tes= t.c index 7a117b64d9..f264d2bf73 100644 --- a/tests/qtest/usb-hcd-uhci-test.c +++ b/tests/qtest/usb-hcd-uhci-test.c @@ -72,9 +72,9 @@ int main(int argc, char **argv) qtest_add_func("/uhci/pci/hotplug/usb-storage", test_usb_storage_hotpl= ug); =20 if (strcmp(arch, "i386") =3D=3D 0 || strcmp(arch, "x86_64") =3D=3D 0) { - qs =3D qtest_pc_boot(cmd); + qs =3D qtest_pc_boot("%s", cmd); } else if (strcmp(arch, "ppc64") =3D=3D 0) { - qs =3D qtest_spapr_boot(cmd); + qs =3D qtest_spapr_boot("%s", cmd); } else { g_printerr("usb-hcd-uhci-test tests are only " "available on x86 or ppc64\n"); diff --git a/tests/unit/test-qmp-cmds.c b/tests/unit/test-qmp-cmds.c index 2373cd64cb..6d52b4e5d8 100644 --- a/tests/unit/test-qmp-cmds.c +++ b/tests/unit/test-qmp-cmds.c @@ -138,6 +138,7 @@ void qmp___org_qemu_x_command(__org_qemu_x_EnumList *a, } =20 =20 +G_GNUC_PRINTF(2, 3) static QObject *do_qmp_dispatch(bool allow_oob, const char *template, ...) { va_list ap; @@ -160,6 +161,7 @@ static QObject *do_qmp_dispatch(bool allow_oob, const c= har *template, ...) return ret; } =20 +G_GNUC_PRINTF(3, 4) static void do_qmp_dispatch_error(bool allow_oob, ErrorClass cls, const char *template, ...) { @@ -269,7 +271,7 @@ static void test_dispatch_cmd_io(void) =20 static void test_dispatch_cmd_deprecated(void) { - const char *cmd =3D "{ 'execute': 'test-command-features1' }"; + #define cmd "{ 'execute': 'test-command-features1' }" QDict *ret; =20 memset(&compat_policy, 0, sizeof(compat_policy)); @@ -287,12 +289,13 @@ static void test_dispatch_cmd_deprecated(void) =20 compat_policy.deprecated_input =3D COMPAT_POLICY_INPUT_REJECT; do_qmp_dispatch_error(false, ERROR_CLASS_COMMAND_NOT_FOUND, cmd); + #undef cmd } =20 static void test_dispatch_cmd_arg_deprecated(void) { - const char *cmd =3D "{ 'execute': 'test-features0'," - " 'arguments': { 'fs1': { 'foo': 42 } } }"; + #define cmd "{ 'execute': 'test-features0'," \ + " 'arguments': { 'fs1': { 'foo': 42 } } }" QDict *ret; =20 memset(&compat_policy, 0, sizeof(compat_policy)); @@ -310,11 +313,12 @@ static void test_dispatch_cmd_arg_deprecated(void) =20 compat_policy.deprecated_input =3D COMPAT_POLICY_INPUT_REJECT; do_qmp_dispatch_error(false, ERROR_CLASS_GENERIC_ERROR, cmd); + #undef cmd } =20 static void test_dispatch_cmd_ret_deprecated(void) { - const char *cmd =3D "{ 'execute': 'test-features0' }"; + #define cmd "{ 'execute': 'test-features0' }" QDict *ret; =20 memset(&compat_policy, 0, sizeof(compat_policy)); @@ -334,6 +338,7 @@ static void test_dispatch_cmd_ret_deprecated(void) ret =3D qobject_to(QDict, do_qmp_dispatch(false, cmd)); assert(ret && qdict_size(ret) =3D=3D 0); qobject_unref(ret); + #undef cmd } =20 /* test generated dealloc functions for generated types */ --=20 2.38.1 From nobody Sun May 5 22:16:16 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1671454984; cv=none; d=zohomail.com; s=zohoarc; b=hstAyksB/eHgzs6veK+81loava62cqHRFYzqz1sQYPe2pZKiVnsesvctXgMVIgqLnBfv6y1k6AZ+CuAgmpDZ/9egs450Oe5rUtGTaLod1ri96v/F3BIVazdrKWaFm1wsWXciuPU3pAVfVxMl+CTwfy4NFz6mXUzPHobeJ4v2MKk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671454984; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=3uNZWGWuQwUgGmH+7L3OtwPhlC39/K0HmCAU4bDa1hs=; b=m1m+XEXQL7yMKtXkSidjTQb1qLDPZjDyiTAgJOmrBgW5+RoPDWM824g+oA3Y+DI8Whcqgw75tgWLUs8qBjjSEfnhutq8ecXVKFbpynPMwjlB8Xnmf64YZZgSQrPY0R1+2pS8Gsq5y+yFjATMT8l57CMQGk4NjEIa/skQNHisd+s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1671454984205730.2771384505423; Mon, 19 Dec 2022 05:03:04 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.466034.724877 (Exim 4.92) (envelope-from ) id 1p7Fmj-00075U-4N; Mon, 19 Dec 2022 13:02:25 +0000 Received: by outflank-mailman (output) from mailman id 466034.724877; Mon, 19 Dec 2022 13:02:25 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1p7Fmj-00075I-0s; Mon, 19 Dec 2022 13:02:25 +0000 Received: by outflank-mailman (input) for mailman id 466034; Mon, 19 Dec 2022 13:02:24 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1p7Fmh-0006YQ-Vv for xen-devel@lists.xenproject.org; Mon, 19 Dec 2022 13:02:23 +0000 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 5afc1127-7f9d-11ed-8fd4-01056ac49cbb; Mon, 19 Dec 2022 14:02:14 +0100 (CET) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-511-DcjDLQb1Pqev8Hw37c1HFA-1; Mon, 19 Dec 2022 08:02:16 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 201E580D11E; Mon, 19 Dec 2022 13:02:11 +0000 (UTC) Received: from virtlab420.virt.lab.eng.bos.redhat.com (virtlab420.virt.lab.eng.bos.redhat.com [10.19.152.148]) by smtp.corp.redhat.com (Postfix) with ESMTP id 78B9B14171B8; Mon, 19 Dec 2022 13:02:10 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 5afc1127-7f9d-11ed-8fd4-01056ac49cbb DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1671454942; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3uNZWGWuQwUgGmH+7L3OtwPhlC39/K0HmCAU4bDa1hs=; b=TC6at/mOdITUr1hEjFaUJjrLP4FvMjYfYYhb8XaKv3IzC0HmSsA2I3of3HsPwRCshy28LV WIcnr9Iywkw6gactAmpptsehXylR51NdX1jJUBGM5CYM9Xx6ZnxGWtWyJiIt0+7f1oiLbx L5K0rdPphxM7DLKHNwrunH70+iiYCsw= X-MC-Unique: DcjDLQb1Pqev8Hw37c1HFA-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: "Dr. David Alan Gilbert" , qemu-ppc@nongnu.org, xen-devel@lists.xenproject.org, Laurent Vivier , Markus Armbruster , Daniel Henrique Barboza , virtio-fs@redhat.com, Michael Roth , =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-block@nongnu.org, Peter Maydell , qemu-arm@nongnu.org, Paul Durrant , Anthony Perard , David Gibson , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , John Snow , Stefan Hajnoczi , Paolo Bonzini , Stefano Stabellini , Gerd Hoffmann , Greg Kurz , Thomas Huth , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 6/6] enforce use of G_GNUC_PRINTF attributes Date: Mon, 19 Dec 2022 08:02:05 -0500 Message-Id: <20221219130205.687815-7-berrange@redhat.com> In-Reply-To: <20221219130205.687815-1-berrange@redhat.com> References: <20221219130205.687815-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1671454985105100005 We've been very gradually adding G_GNUC_PRINTF annotations to functions over years. This has been useful in detecting certain malformed printf strings, or cases where we pass user data as the printf format which is a potential security flaw. Given the inherant memory corruption danger in use of format strings vs mis-matched variadic arguments, it is worth applying G_GNUC_PRINTF to all functions using printf, even if we know they are safe. The compilers can reasonably reliably identify such places with the -Wsuggest-attribute=3Dformat / -Wmissing-format-attribute flags. Signed-off-by: Daniel P. Berrang=C3=A9 --- configure | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure b/configure index 26c7bc5154..b9abe19e16 100755 --- a/configure +++ b/configure @@ -1208,6 +1208,8 @@ add_to warn_flags -Wnested-externs add_to warn_flags -Wendif-labels add_to warn_flags -Wexpansion-to-defined add_to warn_flags -Wimplicit-fallthrough=3D2 +add_to warn_flags -Wsuggest-attribute=3Dformat +add_to warn_flags -Wmissing-format-attribute =20 nowarn_flags=3D add_to nowarn_flags -Wno-initializer-overrides --=20 2.38.1