From nobody Tue May 14 01:36:19 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1645560278021980.1286722052663; Tue, 22 Feb 2022 12:04:38 -0800 (PST) Received: from localhost ([::1]:33032 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nMbOl-0005rj-04 for importer@patchew.org; Tue, 22 Feb 2022 15:04:36 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47946) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nMb1W-0007kG-QV for qemu-devel@nongnu.org; Tue, 22 Feb 2022 14:40:34 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:27856) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nMb1T-00080U-1a for qemu-devel@nongnu.org; Tue, 22 Feb 2022 14:40:32 -0500 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-573-UFYesi1FMoev9DScqGBfQA-1; Tue, 22 Feb 2022 14:40:19 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6416D835DE2; Tue, 22 Feb 2022 19:40:18 +0000 (UTC) Received: from localhost (unknown [10.39.208.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id 34FD145D6F; Tue, 22 Feb 2022 19:40:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645558824; 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=wdr3m8vr2BowwNpdRup2QQhW01aM6PKIluZz9ta1GnY=; b=Auj7jKJLvPBSJ8O0dt9zBas1i9DbnAqyNMM3e2aVkIMtVoBgmuwhUocUXcJihd269Dcrm7 o4wPqukWSnIBdQwiwlKoA/udpAnovXv2GIQEEaktIYSMXOsoHdIxPjnUiqwevNWndUyXjc qse0gb4Mn1OcQkyRphz4vgBHP8U7SfA= X-MC-Unique: UFYesi1FMoev9DScqGBfQA-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PATCH 1/8] meson: fix generic location of vss headers Date: Tue, 22 Feb 2022 23:40:01 +0400 Message-Id: <20220222194008.610377-2-marcandre.lureau@redhat.com> In-Reply-To: <20220222194008.610377-1-marcandre.lureau@redhat.com> References: <20220222194008.610377-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=marcandre.lureau@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, 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: peter.maydell@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , pbonzini@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1645560280385100001 From: Marc-Andr=C3=A9 Lureau This is a left-over, despite requesting the change before the merge. Fixes: commit 8821a389 ("configure, meson: replace VSS SDK checks and optio= ns with --enable-vss-sdk") Signed-off-by: Marc-Andr=C3=A9 Lureau --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 8df40bfac4d7..b871098dbba0 100644 --- a/meson.build +++ b/meson.build @@ -1936,7 +1936,7 @@ have_vss =3D false if targetos =3D=3D 'windows' and link_language =3D=3D 'cpp' have_vss =3D cxx.compiles(''' #define __MIDL_user_allocate_free_DEFINED__ - #include + #include int main(void) { return VSS_CTX_BACKUP; }''') endif =20 --=20 2.35.1.273.ge6ebfd0e8cbb From nobody Tue May 14 01:36:19 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1645560291690802.8382635218469; Tue, 22 Feb 2022 12:04:51 -0800 (PST) Received: from localhost ([::1]:33306 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nMbP0-000633-IB for importer@patchew.org; Tue, 22 Feb 2022 15:04:50 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47970) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nMb1W-0007rp-W7 for qemu-devel@nongnu.org; Tue, 22 Feb 2022 14:40:35 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:55623) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nMb1T-00080a-1q for qemu-devel@nongnu.org; Tue, 22 Feb 2022 14:40:34 -0500 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-633-fCt7dkLfNPyIjdo5CJHVjg-1; Tue, 22 Feb 2022 14:40:24 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B00EC1854E32; Tue, 22 Feb 2022 19:40:22 +0000 (UTC) Received: from localhost (unknown [10.39.208.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id C6DCE5DB83; Tue, 22 Feb 2022 19:40:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645558825; 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=rSESw2B9YtkSPumdF/JVLh1UotaxwApvHyO+vHsYoXg=; b=GrDRxhzVAFofH7DEcFx0P3WKt4+tiFSntAsS5CcVg1VT2o+Y+4M0CWlOlHC1lQazAK34U2 QFfQ5pYNURlKA4+tV5goKYFJc/rNPG9CrCGtcdfOhLYOMSxr/qZpk/mWYDZ74rhifr+SDB NrfNfgvBKsZ7w01oummEfWxvYINdL6k= X-MC-Unique: fCt7dkLfNPyIjdo5CJHVjg-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PATCH 2/8] qga/vss-win32: check old VSS SDK headers Date: Tue, 22 Feb 2022 23:40:02 +0400 Message-Id: <20220222194008.610377-3-marcandre.lureau@redhat.com> In-Reply-To: <20220222194008.610377-1-marcandre.lureau@redhat.com> References: <20220222194008.610377-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=marcandre.lureau@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, 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: peter.maydell@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , pbonzini@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1645560294155100001 From: Marc-Andr=C3=A9 Lureau The VssCoordinator & VssAdmin interfaces have been moved to vsadmin.h in the Windows SDK. Signed-off-by: Marc-Andr=C3=A9 Lureau --- meson.build | 3 +++ qga/vss-win32/vss-common.h | 3 ++- qga/vss-win32/install.cpp | 4 ++++ qga/vss-win32/provider.cpp | 4 ++++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index b871098dbba0..101a3f2d31ee 100644 --- a/meson.build +++ b/meson.build @@ -1933,12 +1933,15 @@ config_host_data.set('CONFIG_AF_VSOCK', cc.compiles= (gnu_source_prefix + ''' }''')) =20 have_vss =3D false +have_vss_sdk =3D false # old xp/2003 SDK if targetos =3D=3D 'windows' and link_language =3D=3D 'cpp' have_vss =3D cxx.compiles(''' #define __MIDL_user_allocate_free_DEFINED__ #include int main(void) { return VSS_CTX_BACKUP; }''') + have_vss_sdk =3D cxx.has_header('vscoordint.h') endif +config_host_data.set('HAVE_VSS_SDK', have_vss_sdk) =20 have_ntddscsi =3D false if targetos =3D=3D 'windows' diff --git a/qga/vss-win32/vss-common.h b/qga/vss-win32/vss-common.h index 54f8de8c8851..0e67e7822ce6 100644 --- a/qga/vss-win32/vss-common.h +++ b/qga/vss-win32/vss-common.h @@ -64,12 +64,13 @@ const CLSID CLSID_QGAVSSProvider =3D { 0x6e6a3492, 0x8d= 4d, 0x440c, const TCHAR g_szClsid[] =3D TEXT("{6E6A3492-8D4D-440C-9619-5E5D0CC31CA8}"); const TCHAR g_szProgid[] =3D TEXT("QGAVSSProvider"); =20 +#ifdef HAVE_VSS_SDK /* Enums undefined in VSS SDK 7.2 but defined in newer Windows SDK */ enum __VSS_VOLUME_SNAPSHOT_ATTRIBUTES { VSS_VOLSNAP_ATTR_NO_AUTORECOVERY =3D 0x00000002, VSS_VOLSNAP_ATTR_TXF_RECOVERY =3D 0x02000000 }; - +#endif =20 /* COM pointer utility; call ->Release() when it goes out of scope */ template diff --git a/qga/vss-win32/install.cpp b/qga/vss-win32/install.cpp index efc5bb9909c0..8076efe3cbb5 100644 --- a/qga/vss-win32/install.cpp +++ b/qga/vss-win32/install.cpp @@ -13,7 +13,11 @@ #include "qemu/osdep.h" =20 #include "vss-common.h" +#ifdef HAVE_VSS_SDK #include +#else +#include +#endif #include "install.h" #include #include diff --git a/qga/vss-win32/provider.cpp b/qga/vss-win32/provider.cpp index fd187fb66f67..1b885e24ee17 100644 --- a/qga/vss-win32/provider.cpp +++ b/qga/vss-win32/provider.cpp @@ -12,7 +12,11 @@ =20 #include "qemu/osdep.h" #include "vss-common.h" +#ifdef HAVE_VSS_SDK #include +#else +#include +#endif #include =20 #define VSS_TIMEOUT_MSEC (60*1000) --=20 2.35.1.273.ge6ebfd0e8cbb From nobody Tue May 14 01:36:19 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1645560495013647.3140105591808; Tue, 22 Feb 2022 12:08:15 -0800 (PST) Received: from localhost ([::1]:39646 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nMbSH-000200-E3 for importer@patchew.org; Tue, 22 Feb 2022 15:08:13 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48014) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nMb1e-0008Fy-5z for qemu-devel@nongnu.org; Tue, 22 Feb 2022 14:40:42 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:37177) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nMb1c-00082K-1v for qemu-devel@nongnu.org; Tue, 22 Feb 2022 14:40:41 -0500 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-385-TwX-py8jNvqOeXP6moSHQQ-1; Tue, 22 Feb 2022 14:40:36 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4E4301091DA0; Tue, 22 Feb 2022 19:40:35 +0000 (UTC) Received: from localhost (unknown [10.39.208.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id C72C75F4E1; Tue, 22 Feb 2022 19:40:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645558839; 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=BDLpDgWFXIATN0OhWc55h0ZASnSriQOlym6oIVYm4Lw=; b=PlzPbUvgsWCqVLQw8W1D801n7Mq1KsYZVFKq99ewHYkpb8HpeJClyKS5RSBHZhbVbbpoRi 9Aaz5m7u2Xy+GF/dLmJ1MkqkftiD8j8mxaEYaR2/yIlg2CL33szt2cwhIe5fLaIFwYgav1 RYB2SXEgoSfbtWCpWvmJA6pQcKhtPpU= X-MC-Unique: TwX-py8jNvqOeXP6moSHQQ-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PATCH 3/8] qga/vss: update informative message about MinGW Date: Tue, 22 Feb 2022 23:40:03 +0400 Message-Id: <20220222194008.610377-4-marcandre.lureau@redhat.com> In-Reply-To: <20220222194008.610377-1-marcandre.lureau@redhat.com> References: <20220222194008.610377-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=marcandre.lureau@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, 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: peter.maydell@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , pbonzini@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1645560495663100001 From: Marc-Andr=C3=A9 Lureau The headers are now all available in MinGW master branch. (commit 13390dbbf885f and earlier) aiming for 10.0. Signed-off-by: Marc-Andr=C3=A9 Lureau --- qga/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qga/meson.build b/qga/meson.build index 54f2da5b0763..62472747f1bb 100644 --- a/qga/meson.build +++ b/qga/meson.build @@ -15,7 +15,7 @@ have_qga_vss =3D get_option('qga_vss') \ If your Visual Studio installation doesn't have the VSS headers, Please download and install Microsoft VSS SDK: http://www.microsoft.com/en-us/download/details.aspx?id=3D23490 - On POSIX-systems, MinGW doesn't yet provide working headers. + On POSIX-systems, MinGW should provide headers in >=3D10.0 releases. you can extract the SDK headers by: $ scripts/extract-vsssdk-headers setup.exe The headers are extracted in the directory 'inc/win2003'. --=20 2.35.1.273.ge6ebfd0e8cbb From nobody Tue May 14 01:36:19 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1645559556819183.7289808109673; Tue, 22 Feb 2022 11:52:36 -0800 (PST) Received: from localhost ([::1]:58700 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nMbD9-0001ub-L3 for importer@patchew.org; Tue, 22 Feb 2022 14:52:35 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48040) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nMb1k-0000Hl-1M for qemu-devel@nongnu.org; Tue, 22 Feb 2022 14:40:48 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:25160) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nMb1i-00084O-60 for qemu-devel@nongnu.org; Tue, 22 Feb 2022 14:40:47 -0500 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-183-Hk3VoSHSOR-gzmhyDyES1A-1; Tue, 22 Feb 2022 14:40:42 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 37CC31091DA2; Tue, 22 Feb 2022 19:40:41 +0000 (UTC) Received: from localhost (unknown [10.39.208.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id A351345D71; Tue, 22 Feb 2022 19:40:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645558845; 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=B0VBOMKwrp2WmWwIazOMoGHx8MdlvWtcmMVOmJtamyw=; b=LF0zgZ1y9fqOkXvf72ikvFpvR3IPFESieg+vkoBhnJx96CQKP7lql4U1iastzUrsYDVKxn weZjCGkUI1Mqe/CRJOXn32MABfxL2QwSEJky6816PM/tdPEklKHVg5iEML9h8GGHWp3uHR XegArB8RwUZRTIGcRFWsJ9RwgHWYSDE= X-MC-Unique: Hk3VoSHSOR-gzmhyDyES1A-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PATCH 4/8] meson: drop the .fa library suffix Date: Tue, 22 Feb 2022 23:40:04 +0400 Message-Id: <20220222194008.610377-5-marcandre.lureau@redhat.com> In-Reply-To: <20220222194008.610377-1-marcandre.lureau@redhat.com> References: <20220222194008.610377-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=marcandre.lureau@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, 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: peter.maydell@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , pbonzini@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1645559557698100001 From: Marc-Andr=C3=A9 Lureau The .fa suffix was a temporary hack introduced in commit 1f0a1d8a51 ("build-sys hack: link with whole .fa archives") when the build system was mixed between meson & makefiles. It is no longer needed. Signed-off-by: Marc-Andr=C3=A9 Lureau --- docs/devel/build-system.rst | 5 ----- meson.build | 18 +++--------------- tests/qtest/libqos/meson.build | 1 - 3 files changed, 3 insertions(+), 21 deletions(-) diff --git a/docs/devel/build-system.rst b/docs/devel/build-system.rst index 431caba7aa06..75c30b819799 100644 --- a/docs/devel/build-system.rst +++ b/docs/devel/build-system.rst @@ -154,15 +154,10 @@ Subsystem sourcesets: are then turned into static libraries as follows:: =20 libchardev =3D static_library('chardev', chardev_ss.sources(), - name_suffix: 'fa', build_by_default: false) =20 chardev =3D declare_dependency(link_whole: libchardev) =20 - As of Meson 0.55.1, the special ``.fa`` suffix should be used for everyt= hing - that is used with ``link_whole``, to ensure that the link flags are plac= ed - correctly in the command line. - Target-independent emulator sourcesets: Various general purpose helper code is compiled only once and the .o files are linked into all output binaries that need it. diff --git a/meson.build b/meson.build index 101a3f2d31ee..40abe86767e8 100644 --- a/meson.build +++ b/meson.build @@ -2940,15 +2940,13 @@ qemu_syms =3D custom_target('qemu.syms', output: 'q= emu.syms', =20 qom_ss =3D qom_ss.apply(config_host, strict: false) libqom =3D static_library('qom', qom_ss.sources() + genh, - dependencies: [qom_ss.dependencies()], - name_suffix: 'fa') + dependencies: [qom_ss.dependencies()]) =20 qom =3D declare_dependency(link_whole: libqom) =20 authz_ss =3D authz_ss.apply(config_host, strict: false) libauthz =3D static_library('authz', authz_ss.sources() + genh, dependencies: [authz_ss.dependencies()], - name_suffix: 'fa', build_by_default: false) =20 authz =3D declare_dependency(link_whole: libauthz, @@ -2957,7 +2955,6 @@ authz =3D declare_dependency(link_whole: libauthz, crypto_ss =3D crypto_ss.apply(config_host, strict: false) libcrypto =3D static_library('crypto', crypto_ss.sources() + genh, dependencies: [crypto_ss.dependencies()], - name_suffix: 'fa', build_by_default: false) =20 crypto =3D declare_dependency(link_whole: libcrypto, @@ -2967,13 +2964,11 @@ io_ss =3D io_ss.apply(config_host, strict: false) libio =3D static_library('io', io_ss.sources() + genh, dependencies: [io_ss.dependencies()], link_with: libqemuutil, - name_suffix: 'fa', build_by_default: false) =20 io =3D declare_dependency(link_whole: libio, dependencies: [crypto, qom]) =20 libmigration =3D static_library('migration', sources: migration_files + ge= nh, - name_suffix: 'fa', build_by_default: false) migration =3D declare_dependency(link_with: libmigration, dependencies: [zlib, qom, io]) @@ -2983,7 +2978,6 @@ block_ss =3D block_ss.apply(config_host, strict: fals= e) libblock =3D static_library('block', block_ss.sources() + genh, dependencies: block_ss.dependencies(), link_depends: block_syms, - name_suffix: 'fa', build_by_default: false) =20 block =3D declare_dependency(link_whole: [libblock], @@ -2993,7 +2987,6 @@ block =3D declare_dependency(link_whole: [libblock], blockdev_ss =3D blockdev_ss.apply(config_host, strict: false) libblockdev =3D static_library('blockdev', blockdev_ss.sources() + genh, dependencies: blockdev_ss.dependencies(), - name_suffix: 'fa', build_by_default: false) =20 blockdev =3D declare_dependency(link_whole: [libblockdev], @@ -3002,13 +2995,11 @@ blockdev =3D declare_dependency(link_whole: [libblo= ckdev], qmp_ss =3D qmp_ss.apply(config_host, strict: false) libqmp =3D static_library('qmp', qmp_ss.sources() + genh, dependencies: qmp_ss.dependencies(), - name_suffix: 'fa', build_by_default: false) =20 qmp =3D declare_dependency(link_whole: [libqmp]) =20 libchardev =3D static_library('chardev', chardev_ss.sources() + genh, - name_suffix: 'fa', dependencies: [gnutls], build_by_default: false) =20 @@ -3016,7 +3007,6 @@ chardev =3D declare_dependency(link_whole: libchardev) =20 hwcore_ss =3D hwcore_ss.apply(config_host, strict: false) libhwcore =3D static_library('hwcore', sources: hwcore_ss.sources() + genh, - name_suffix: 'fa', build_by_default: false) hwcore =3D declare_dependency(link_whole: libhwcore) common_ss.add(hwcore) @@ -3047,8 +3037,7 @@ common_all =3D static_library('common', sources: common_all.sources() + genh, include_directories: common_user_inc, implicit_include_directories: false, - dependencies: common_all.dependencies(), - name_suffix: 'fa') + dependencies: common_all.dependencies()) =20 feature_to_c =3D find_program('scripts/feature_to_c.sh') =20 @@ -3145,8 +3134,7 @@ foreach target : target_dirs objects: objects, include_directories: target_inc, c_args: c_args, - build_by_default: false, - name_suffix: 'fa') + build_by_default: false) =20 if target.endswith('-softmmu') execs =3D [{ diff --git a/tests/qtest/libqos/meson.build b/tests/qtest/libqos/meson.build index e988d1579172..c175c57768cd 100644 --- a/tests/qtest/libqos/meson.build +++ b/tests/qtest/libqos/meson.build @@ -57,7 +57,6 @@ libqos_srcs =3D files('../libqtest.c', ) =20 libqos =3D static_library('qos', libqos_srcs + genh, - name_suffix: 'fa', build_by_default: false) =20 qos =3D declare_dependency(link_whole: libqos) --=20 2.35.1.273.ge6ebfd0e8cbb From nobody Tue May 14 01:36:19 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1645560365809602.7117684938471; Tue, 22 Feb 2022 12:06:05 -0800 (PST) Received: from localhost ([::1]:35542 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nMbQC-0007Xm-Fa for importer@patchew.org; Tue, 22 Feb 2022 15:06:04 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48118) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nMb2D-0000dM-N6 for qemu-devel@nongnu.org; Tue, 22 Feb 2022 14:41:17 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:57985) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nMb26-00086U-GC for qemu-devel@nongnu.org; Tue, 22 Feb 2022 14:41:17 -0500 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-524-MnAHTrERNKmFo9bDsYUobg-1; Tue, 22 Feb 2022 14:41:02 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A64081091DA2; Tue, 22 Feb 2022 19:41:01 +0000 (UTC) Received: from localhost (unknown [10.39.208.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id C6CC31B480; Tue, 22 Feb 2022 19:40:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645558865; 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=FyCpQ4+4QKzEoMhErrEs7iTKvIuLLDSJuSl29qW5fR4=; b=CsXvntrTP9mVqCL//nR5gmgaMCYtrKq62Qrnv+hcIUvmtW3424PmS/1Yw6bi5ThfAcRvPe X0KwFOmt8meVJFCGFHUEsciU3BUQx9v0bn+KV5oHJL+t77b8xi4JACWpN6WmguIQoxN/MJ fR2O+08x1TbXFjkghoNK5gGwGiHFmAs= X-MC-Unique: MnAHTrERNKmFo9bDsYUobg-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PATCH 5/8] meson: use chardev_ss dependencies Date: Tue, 22 Feb 2022 23:40:05 +0400 Message-Id: <20220222194008.610377-6-marcandre.lureau@redhat.com> In-Reply-To: <20220222194008.610377-1-marcandre.lureau@redhat.com> References: <20220222194008.610377-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=marcandre.lureau@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, 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: peter.maydell@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , pbonzini@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1645560366622100001 From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 40abe86767e8..b1d2fcecbdcf 100644 --- a/meson.build +++ b/meson.build @@ -3000,7 +3000,7 @@ libqmp =3D static_library('qmp', qmp_ss.sources() + g= enh, qmp =3D declare_dependency(link_whole: [libqmp]) =20 libchardev =3D static_library('chardev', chardev_ss.sources() + genh, - dependencies: [gnutls], + dependencies: chardev_ss.dependencies(), build_by_default: false) =20 chardev =3D declare_dependency(link_whole: libchardev) --=20 2.35.1.273.ge6ebfd0e8cbb From nobody Tue May 14 01:36:19 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1645559789039108.43684922877901; Tue, 22 Feb 2022 11:56:29 -0800 (PST) Received: from localhost ([::1]:39020 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nMbGu-0007gQ-1H for importer@patchew.org; Tue, 22 Feb 2022 14:56:28 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48152) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nMb2E-0000eN-VE for qemu-devel@nongnu.org; Tue, 22 Feb 2022 14:41:19 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:56993) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nMb2C-00087z-4R for qemu-devel@nongnu.org; Tue, 22 Feb 2022 14:41:18 -0500 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-639-4VJ3ex0-PoqBGK9Hm-jDNA-1; Tue, 22 Feb 2022 14:41:08 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 41586501E0; Tue, 22 Feb 2022 19:41:07 +0000 (UTC) Received: from localhost (unknown [10.39.208.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id B26F045D71; Tue, 22 Feb 2022 19:41:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645558869; 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=cTfNeWPydV5g86yz9X2u2/n0vX4tO6eXuYRLrtLmj+M=; b=TWiaePvZX/icFbIzQP6FC+hFKWqpyu700ybJF+ASDw/ncQpfopeJkj3We2hJwwSVMnyU/n VN/wlVTC9RqEjIw+BcL5qjqYX6xuw8VMh72RRZQivrGrSVw65oVlO9DXeClvzA5fjrRvKh Ab+I4Jc4prJxj+++KvEKm+ms4NA3Tsk= X-MC-Unique: 4VJ3ex0-PoqBGK9Hm-jDNA-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PATCH 6/8] char: move qemu_openpty_raw from util/ to char/ Date: Tue, 22 Feb 2022 23:40:06 +0400 Message-Id: <20220222194008.610377-7-marcandre.lureau@redhat.com> In-Reply-To: <20220222194008.610377-1-marcandre.lureau@redhat.com> References: <20220222194008.610377-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=marcandre.lureau@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, 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: peter.maydell@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , pbonzini@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1645559790617100001 From: Marc-Andr=C3=A9 Lureau It is only needed by char-pty. Signed-off-by: Marc-Andr=C3=A9 Lureau --- include/qemu-common.h | 2 - chardev/char-pty.c | 104 +++++++++++++++++++++++++++++++ util/qemu-openpty.c | 139 ------------------------------------------ chardev/meson.build | 4 +- util/meson.build | 1 - 5 files changed, 106 insertions(+), 144 deletions(-) delete mode 100644 util/qemu-openpty.c diff --git a/include/qemu-common.h b/include/qemu-common.h index 68b2e3bc1091..0248a324cdcd 100644 --- a/include/qemu-common.h +++ b/include/qemu-common.h @@ -33,8 +33,6 @@ ssize_t qemu_write_full(int fd, const void *buf, size_t c= ount) =20 #ifndef _WIN32 int qemu_pipe(int pipefd[2]); -/* like openpty() but also makes it raw; return master fd */ -int qemu_openpty_raw(int *aslave, char *pty_name); #endif =20 #ifdef _WIN32 diff --git a/chardev/char-pty.c b/chardev/char-pty.c index a2d1e7c985bc..f28779bcc9d2 100644 --- a/chardev/char-pty.c +++ b/chardev/char-pty.c @@ -197,6 +197,110 @@ static void char_pty_finalize(Object *obj) qemu_chr_be_event(chr, CHR_EVENT_CLOSED); } =20 +#if defined HAVE_PTY_H +# include +#elif defined CONFIG_BSD +# include +# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__Drag= onFly__) +# include +# else +# include +# endif +#elif defined CONFIG_SOLARIS +# include +# include +#else +# include +#endif + +#ifdef __sun__ + +#if !defined(HAVE_OPENPTY) +/* Once illumos has openpty(), this is going to be removed. */ +static int openpty(int *amaster, int *aslave, char *name, + struct termios *termp, struct winsize *winp) +{ + const char *slave; + int mfd =3D -1, sfd =3D -1; + + *amaster =3D *aslave =3D -1; + + mfd =3D open("/dev/ptmx", O_RDWR | O_NOCTTY); + if (mfd < 0) + goto err; + + if (grantpt(mfd) =3D=3D -1 || unlockpt(mfd) =3D=3D -1) + goto err; + + if ((slave =3D ptsname(mfd)) =3D=3D NULL) + goto err; + + if ((sfd =3D open(slave, O_RDONLY | O_NOCTTY)) =3D=3D -1) + goto err; + + if (ioctl(sfd, I_PUSH, "ptem") =3D=3D -1 || + (termp !=3D NULL && tcgetattr(sfd, termp) < 0)) + goto err; + + *amaster =3D mfd; + *aslave =3D sfd; + + if (winp) + ioctl(sfd, TIOCSWINSZ, winp); + + return 0; + +err: + if (sfd !=3D -1) + close(sfd); + close(mfd); + return -1; +} +#endif + +static void cfmakeraw (struct termios *termios_p) +{ + termios_p->c_iflag &=3D + ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON); + termios_p->c_oflag &=3D ~OPOST; + termios_p->c_lflag &=3D ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN); + termios_p->c_cflag &=3D ~(CSIZE|PARENB); + termios_p->c_cflag |=3D CS8; + + termios_p->c_cc[VMIN] =3D 0; + termios_p->c_cc[VTIME] =3D 0; +} +#endif + +/* like openpty() but also makes it raw; return master fd */ +static int qemu_openpty_raw(int *aslave, char *pty_name) +{ + int amaster; + struct termios tty; +#if defined(__OpenBSD__) || defined(__DragonFly__) + char pty_buf[PATH_MAX]; +#define q_ptsname(x) pty_buf +#else + char *pty_buf =3D NULL; +#define q_ptsname(x) ptsname(x) +#endif + + if (openpty(&amaster, aslave, pty_buf, NULL, NULL) < 0) { + return -1; + } + + /* Set raw attributes on the pty. */ + tcgetattr(*aslave, &tty); + cfmakeraw(&tty); + tcsetattr(*aslave, TCSAFLUSH, &tty); + + if (pty_name) { + strcpy(pty_name, q_ptsname(amaster)); + } + + return amaster; +} + static void char_pty_open(Chardev *chr, ChardevBackend *backend, bool *be_opened, diff --git a/util/qemu-openpty.c b/util/qemu-openpty.c deleted file mode 100644 index 427f43a76973..000000000000 --- a/util/qemu-openpty.c +++ /dev/null @@ -1,139 +0,0 @@ -/* - * qemu-openpty.c - * - * Copyright (c) 2003-2008 Fabrice Bellard - * Copyright (c) 2010 Red Hat, Inc. - * - * Wrapper function qemu_openpty() implementation. - * - * Permission is hereby granted, free of charge, to any person obtaining a= copy - * of this software and associated documentation files (the "Software"), t= o deal - * in the Software without restriction, including without limitation the r= ights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or se= ll - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included= in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS= OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OT= HER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING= FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS = IN - * THE SOFTWARE. - */ - -/* - * This is not part of oslib-posix.c because this function - * uses openpty() which often in -lutil, and if we add this - * dependency to oslib-posix.o, every app will have to be - * linked with -lutil. - */ - -#include "qemu/osdep.h" -#include "qemu-common.h" - -#if defined HAVE_PTY_H -# include -#elif defined CONFIG_BSD -# include -# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__Drag= onFly__) -# include -# else -# include -# endif -#elif defined CONFIG_SOLARIS -# include -# include -#else -# include -#endif - -#ifdef __sun__ - -#if !defined(HAVE_OPENPTY) -/* Once illumos has openpty(), this is going to be removed. */ -static int openpty(int *amaster, int *aslave, char *name, - struct termios *termp, struct winsize *winp) -{ - const char *slave; - int mfd =3D -1, sfd =3D -1; - - *amaster =3D *aslave =3D -1; - - mfd =3D open("/dev/ptmx", O_RDWR | O_NOCTTY); - if (mfd < 0) - goto err; - - if (grantpt(mfd) =3D=3D -1 || unlockpt(mfd) =3D=3D -1) - goto err; - - if ((slave =3D ptsname(mfd)) =3D=3D NULL) - goto err; - - if ((sfd =3D open(slave, O_RDONLY | O_NOCTTY)) =3D=3D -1) - goto err; - - if (ioctl(sfd, I_PUSH, "ptem") =3D=3D -1 || - (termp !=3D NULL && tcgetattr(sfd, termp) < 0)) - goto err; - - *amaster =3D mfd; - *aslave =3D sfd; - - if (winp) - ioctl(sfd, TIOCSWINSZ, winp); - - return 0; - -err: - if (sfd !=3D -1) - close(sfd); - close(mfd); - return -1; -} -#endif - -static void cfmakeraw (struct termios *termios_p) -{ - termios_p->c_iflag &=3D - ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON); - termios_p->c_oflag &=3D ~OPOST; - termios_p->c_lflag &=3D ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN); - termios_p->c_cflag &=3D ~(CSIZE|PARENB); - termios_p->c_cflag |=3D CS8; - - termios_p->c_cc[VMIN] =3D 0; - termios_p->c_cc[VTIME] =3D 0; -} -#endif - -int qemu_openpty_raw(int *aslave, char *pty_name) -{ - int amaster; - struct termios tty; -#if defined(__OpenBSD__) || defined(__DragonFly__) - char pty_buf[PATH_MAX]; -#define q_ptsname(x) pty_buf -#else - char *pty_buf =3D NULL; -#define q_ptsname(x) ptsname(x) -#endif - - if (openpty(&amaster, aslave, pty_buf, NULL, NULL) < 0) { - return -1; - } - - /* Set raw attributes on the pty. */ - tcgetattr(*aslave, &tty); - cfmakeraw(&tty); - tcsetattr(*aslave, TCSAFLUSH, &tty); - - if (pty_name) { - strcpy(pty_name, q_ptsname(amaster)); - } - - return amaster; -} diff --git a/chardev/meson.build b/chardev/meson.build index 325ba2bdb97d..664f77b8879a 100644 --- a/chardev/meson.build +++ b/chardev/meson.build @@ -12,11 +12,11 @@ chardev_ss.add(files( 'char-udp.c', 'char.c', )) -chardev_ss.add(when: 'CONFIG_POSIX', if_true: files( +chardev_ss.add(when: 'CONFIG_POSIX', if_true: [files( 'char-fd.c', 'char-parallel.c', 'char-pty.c', -)) +), util]) chardev_ss.add(when: 'CONFIG_WIN32', if_true: files( 'char-console.c', 'char-win-stdio.c', diff --git a/util/meson.build b/util/meson.build index 3736988b9f6e..d6263ccc1b82 100644 --- a/util/meson.build +++ b/util/meson.build @@ -12,7 +12,6 @@ util_ss.add(when: 'CONFIG_POSIX', if_true: files('compatf= d.c')) util_ss.add(when: 'CONFIG_POSIX', if_true: files('event_notifier-posix.c')) util_ss.add(when: 'CONFIG_POSIX', if_true: files('mmap-alloc.c')) util_ss.add(when: 'CONFIG_POSIX', if_true: files('oslib-posix.c')) -util_ss.add(when: 'CONFIG_POSIX', if_true: [files('qemu-openpty.c'), util]) util_ss.add(when: 'CONFIG_POSIX', if_true: files('qemu-thread-posix.c')) util_ss.add(when: 'CONFIG_POSIX', if_true: files('memfd.c')) util_ss.add(when: 'CONFIG_WIN32', if_true: files('aio-win32.c')) --=20 2.35.1.273.ge6ebfd0e8cbb From nobody Tue May 14 01:36:19 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1645560655329612.3564906761762; Tue, 22 Feb 2022 12:10:55 -0800 (PST) Received: from localhost ([::1]:45408 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nMbUs-0005qa-1E for importer@patchew.org; Tue, 22 Feb 2022 15:10:54 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48172) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nMb2G-0000fM-W3 for qemu-devel@nongnu.org; Tue, 22 Feb 2022 14:41:21 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:30206) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nMb2E-00088W-CF for qemu-devel@nongnu.org; Tue, 22 Feb 2022 14:41:20 -0500 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-237-3hfed6vtMlWG1Zb_zr23bQ-1; Tue, 22 Feb 2022 14:41:14 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F3FDD501E0; Tue, 22 Feb 2022 19:41:12 +0000 (UTC) Received: from localhost (unknown [10.39.208.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id 30E4445D73; Tue, 22 Feb 2022 19:41:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645558877; 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=bElpxsctJW4MV1P9tw3DNZpMNGNY7DnMOc8tvF7APWg=; b=DC7frM7mjPTuy409nNtmjx+TjA8+X0pZAR05zBd3P4UeKuOFufIbGeEig5QL4Qcj2omL5g Se6gCHqaB/ny9oDpPIb4Rv9qa3fMVYoVWRYbSQCxdVlbwaI70dK/DzWFolg//AZsouN5+h H5YSJL8+fGn7SM8iQtc57+1jyS7nbhs= X-MC-Unique: 3hfed6vtMlWG1Zb_zr23bQ-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PATCH 7/8] Drop qemu_foo() socket API wrapper Date: Tue, 22 Feb 2022 23:40:07 +0400 Message-Id: <20220222194008.610377-8-marcandre.lureau@redhat.com> In-Reply-To: <20220222194008.610377-1-marcandre.lureau@redhat.com> References: <20220222194008.610377-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=marcandre.lureau@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, 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: peter.maydell@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , pbonzini@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1645560657287100001 From: Marc-Andr=C3=A9 Lureau The socket API wrappers were initially introduced in commit 00aa0040 ("Wrap recv to avoid warnings"), but made redundatant with commit a2d96af4 ("osdep: add wrappers for socket functions") which fixes the win32 declarations and thus removed the earlier warnings. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- include/qemu-common.h | 19 ------------------- crypto/cipher-afalg.c | 4 ++-- crypto/hash-afalg.c | 4 ++-- gdbstub.c | 2 +- io/channel-socket.c | 6 +++--- net/socket.c | 24 ++++++++++++------------ tests/qtest/e1000e-test.c | 4 ++-- tests/qtest/libqtest.c | 4 ++-- tests/qtest/npcm7xx_emc-test.c | 4 ++-- tests/qtest/test-filter-mirror.c | 4 ++-- tests/qtest/test-filter-redirector.c | 8 ++++---- tests/qtest/virtio-net-test.c | 10 +++++----- tests/unit/socket-helpers.c | 2 +- util/osdep.c | 4 ++-- util/qemu-sockets.c | 10 +++++----- 15 files changed, 45 insertions(+), 64 deletions(-) diff --git a/include/qemu-common.h b/include/qemu-common.h index 0248a324cdcd..6969f957b7c3 100644 --- a/include/qemu-common.h +++ b/include/qemu-common.h @@ -35,25 +35,6 @@ ssize_t qemu_write_full(int fd, const void *buf, size_t = count) int qemu_pipe(int pipefd[2]); #endif =20 -#ifdef _WIN32 -/* MinGW needs type casts for the 'buf' and 'optval' arguments. */ -#define qemu_getsockopt(sockfd, level, optname, optval, optlen) \ - getsockopt(sockfd, level, optname, (void *)optval, optlen) -#define qemu_setsockopt(sockfd, level, optname, optval, optlen) \ - setsockopt(sockfd, level, optname, (const void *)optval, optlen) -#define qemu_recv(sockfd, buf, len, flags) recv(sockfd, (void *)buf, len, = flags) -#define qemu_sendto(sockfd, buf, len, flags, destaddr, addrlen) \ - sendto(sockfd, (const void *)buf, len, flags, destaddr, addrlen) -#else -#define qemu_getsockopt(sockfd, level, optname, optval, optlen) \ - getsockopt(sockfd, level, optname, optval, optlen) -#define qemu_setsockopt(sockfd, level, optname, optval, optlen) \ - setsockopt(sockfd, level, optname, optval, optlen) -#define qemu_recv(sockfd, buf, len, flags) recv(sockfd, buf, len, flags) -#define qemu_sendto(sockfd, buf, len, flags, destaddr, addrlen) \ - sendto(sockfd, buf, len, flags, destaddr, addrlen) -#endif - void cpu_exec_init_all(void); void cpu_exec_step_atomic(CPUState *cpu); =20 diff --git a/crypto/cipher-afalg.c b/crypto/cipher-afalg.c index 052355a8a921..c55cd28bf01c 100644 --- a/crypto/cipher-afalg.c +++ b/crypto/cipher-afalg.c @@ -84,8 +84,8 @@ qcrypto_afalg_cipher_ctx_new(QCryptoCipherAlgorithm alg, g_free(name); =20 /* setkey */ - if (qemu_setsockopt(afalg->tfmfd, SOL_ALG, ALG_SET_KEY, key, - nkey) !=3D 0) { + if (setsockopt(afalg->tfmfd, SOL_ALG, ALG_SET_KEY, key, + nkey) !=3D 0) { error_setg_errno(errp, errno, "Set key failed"); qcrypto_afalg_comm_free(afalg); return NULL; diff --git a/crypto/hash-afalg.c b/crypto/hash-afalg.c index cf34c694af6f..4ac18c7c1db7 100644 --- a/crypto/hash-afalg.c +++ b/crypto/hash-afalg.c @@ -88,8 +88,8 @@ qcrypto_afalg_hash_hmac_ctx_new(QCryptoHashAlgorithm alg, =20 /* HMAC needs setkey */ if (is_hmac) { - if (qemu_setsockopt(afalg->tfmfd, SOL_ALG, ALG_SET_KEY, - key, nkey) !=3D 0) { + if (setsockopt(afalg->tfmfd, SOL_ALG, ALG_SET_KEY, + key, nkey) !=3D 0) { error_setg_errno(errp, errno, "Set hmac key failed"); qcrypto_afalg_comm_free(afalg); return NULL; diff --git a/gdbstub.c b/gdbstub.c index 3c14c6a03831..c8375e3c3ffe 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -426,7 +426,7 @@ static int get_char(void) int ret; =20 for(;;) { - ret =3D qemu_recv(gdbserver_state.fd, &ch, 1, 0); + ret =3D recv(gdbserver_state.fd, &ch, 1, 0); if (ret < 0) { if (errno =3D=3D ECONNRESET) gdbserver_state.fd =3D -1; diff --git a/io/channel-socket.c b/io/channel-socket.c index 459922c87480..7a8d9f69c92d 100644 --- a/io/channel-socket.c +++ b/io/channel-socket.c @@ -681,9 +681,9 @@ qio_channel_socket_set_delay(QIOChannel *ioc, QIOChannelSocket *sioc =3D QIO_CHANNEL_SOCKET(ioc); int v =3D enabled ? 0 : 1; =20 - qemu_setsockopt(sioc->fd, - IPPROTO_TCP, TCP_NODELAY, - &v, sizeof(v)); + setsockopt(sioc->fd, + IPPROTO_TCP, TCP_NODELAY, + &v, sizeof(v)); } =20 =20 diff --git a/net/socket.c b/net/socket.c index 15b410e8d825..c4b80e9228d7 100644 --- a/net/socket.c +++ b/net/socket.c @@ -120,9 +120,9 @@ static ssize_t net_socket_receive_dgram(NetClientState = *nc, const uint8_t *buf, =20 do { if (s->dgram_dst.sin_family !=3D AF_UNIX) { - ret =3D qemu_sendto(s->fd, buf, size, 0, - (struct sockaddr *)&s->dgram_dst, - sizeof(s->dgram_dst)); + ret =3D sendto(s->fd, buf, size, 0, + (struct sockaddr *)&s->dgram_dst, + sizeof(s->dgram_dst)); } else { ret =3D send(s->fd, buf, size, 0); } @@ -163,7 +163,7 @@ static void net_socket_send(void *opaque) uint8_t buf1[NET_BUFSIZE]; const uint8_t *buf; =20 - size =3D qemu_recv(s->fd, buf1, sizeof(buf1), 0); + size =3D recv(s->fd, buf1, sizeof(buf1), 0); if (size < 0) { if (errno !=3D EWOULDBLOCK) goto eoc; @@ -198,7 +198,7 @@ static void net_socket_send_dgram(void *opaque) NetSocketState *s =3D opaque; int size; =20 - size =3D qemu_recv(s->fd, s->rs.buf, sizeof(s->rs.buf), 0); + size =3D recv(s->fd, s->rs.buf, sizeof(s->rs.buf), 0); if (size < 0) return; if (size =3D=3D 0) { @@ -246,7 +246,7 @@ static int net_socket_mcast_create(struct sockaddr_in *= mcastaddr, * only on posix systems. */ val =3D 1; - ret =3D qemu_setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val= )); + ret =3D setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val)); if (ret < 0) { error_setg_errno(errp, errno, "can't set socket option SO_REUSEADDR"); @@ -268,8 +268,8 @@ static int net_socket_mcast_create(struct sockaddr_in *= mcastaddr, imr.imr_interface.s_addr =3D htonl(INADDR_ANY); } =20 - ret =3D qemu_setsockopt(fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, - &imr, sizeof(struct ip_mreq)); + ret =3D setsockopt(fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, + &imr, sizeof(struct ip_mreq)); if (ret < 0) { error_setg_errno(errp, errno, "can't add socket to multicast group %s", @@ -279,8 +279,8 @@ static int net_socket_mcast_create(struct sockaddr_in *= mcastaddr, =20 /* Force mcast msgs to loopback (eg. several QEMUs in same host */ loop =3D 1; - ret =3D qemu_setsockopt(fd, IPPROTO_IP, IP_MULTICAST_LOOP, - &loop, sizeof(loop)); + ret =3D setsockopt(fd, IPPROTO_IP, IP_MULTICAST_LOOP, + &loop, sizeof(loop)); if (ret < 0) { error_setg_errno(errp, errno, "can't force multicast message to loopback"); @@ -289,8 +289,8 @@ static int net_socket_mcast_create(struct sockaddr_in *= mcastaddr, =20 /* If a bind address is given, only send packets from that address */ if (localaddr !=3D NULL) { - ret =3D qemu_setsockopt(fd, IPPROTO_IP, IP_MULTICAST_IF, - localaddr, sizeof(*localaddr)); + ret =3D setsockopt(fd, IPPROTO_IP, IP_MULTICAST_IF, + localaddr, sizeof(*localaddr)); if (ret < 0) { error_setg_errno(errp, errno, "can't set the default network send interface= "); diff --git a/tests/qtest/e1000e-test.c b/tests/qtest/e1000e-test.c index 0273fe4c1566..e648fdd409cd 100644 --- a/tests/qtest/e1000e-test.c +++ b/tests/qtest/e1000e-test.c @@ -91,9 +91,9 @@ static void e1000e_send_verify(QE1000E *d, int *test_sock= ets, QGuestAllocator *a g_assert_cmphex(le32_to_cpu(descr.upper.data) & dsta_dd, =3D=3D, dsta_= dd); =20 /* Check data sent to the backend */ - ret =3D qemu_recv(test_sockets[0], &recv_len, sizeof(recv_len), 0); + ret =3D recv(test_sockets[0], &recv_len, sizeof(recv_len), 0); g_assert_cmpint(ret, =3D=3D , sizeof(recv_len)); - ret =3D qemu_recv(test_sockets[0], buffer, 64, 0); + ret =3D recv(test_sockets[0], buffer, 64, 0); g_assert_cmpint(ret, >=3D, 5); g_assert_cmpstr(buffer, =3D=3D , "TEST"); =20 diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c index 41f4da4e54fc..9dac018fcba0 100644 --- a/tests/qtest/libqtest.c +++ b/tests/qtest/libqtest.c @@ -94,8 +94,8 @@ static int socket_accept(int sock) struct timeval timeout =3D { .tv_sec =3D SOCKET_TIMEOUT, .tv_usec =3D 0 }; =20 - if (qemu_setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, - (void *)&timeout, sizeof(timeout))) { + if (setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, + (void *)&timeout, sizeof(timeout))) { fprintf(stderr, "%s failed to set SO_RCVTIMEO: %s\n", __func__, strerror(errno)); close(sock); diff --git a/tests/qtest/npcm7xx_emc-test.c b/tests/qtest/npcm7xx_emc-test.c index 9eec71d87c1f..7c435ac91576 100644 --- a/tests/qtest/npcm7xx_emc-test.c +++ b/tests/qtest/npcm7xx_emc-test.c @@ -521,12 +521,12 @@ static void emc_send_verify1(QTestState *qts, const E= MCModule *mod, int fd, =20 /* Check data sent to the backend. */ recv_len =3D ~0; - ret =3D qemu_recv(fd, &recv_len, sizeof(recv_len), MSG_DONTWAIT); + ret =3D recv(fd, &recv_len, sizeof(recv_len), MSG_DONTWAIT); g_assert_cmpint(ret, =3D=3D , sizeof(recv_len)); =20 g_assert(wait_socket_readable(fd)); memset(buffer, 0xff, sizeof(buffer)); - ret =3D qemu_recv(fd, buffer, test_size, MSG_DONTWAIT); + ret =3D recv(fd, buffer, test_size, MSG_DONTWAIT); g_assert_cmpmem(buffer, ret, test_data, test_size); } =20 diff --git a/tests/qtest/test-filter-mirror.c b/tests/qtest/test-filter-mir= ror.c index 95367d14d36d..da4f94de727a 100644 --- a/tests/qtest/test-filter-mirror.c +++ b/tests/qtest/test-filter-mirror.c @@ -58,13 +58,13 @@ static void test_mirror(void) g_assert_cmpint(ret, =3D=3D, sizeof(send_buf) + sizeof(size)); close(send_sock[0]); =20 - ret =3D qemu_recv(recv_sock[0], &len, sizeof(len), 0); + ret =3D recv(recv_sock[0], &len, sizeof(len), 0); g_assert_cmpint(ret, =3D=3D, sizeof(len)); len =3D ntohl(len); =20 g_assert_cmpint(len, =3D=3D, sizeof(send_buf)); recv_buf =3D g_malloc(len); - ret =3D qemu_recv(recv_sock[0], recv_buf, len, 0); + ret =3D recv(recv_sock[0], recv_buf, len, 0); g_assert_cmpstr(recv_buf, =3D=3D, send_buf); =20 g_free(recv_buf); diff --git a/tests/qtest/test-filter-redirector.c b/tests/qtest/test-filter= -redirector.c index 4f3f59cba865..fc16cf7e8d5f 100644 --- a/tests/qtest/test-filter-redirector.c +++ b/tests/qtest/test-filter-redirector.c @@ -115,13 +115,13 @@ static void test_redirector_tx(void) g_assert_cmpint(ret, =3D=3D, sizeof(send_buf) + sizeof(size)); close(backend_sock[0]); =20 - ret =3D qemu_recv(recv_sock, &len, sizeof(len), 0); + ret =3D recv(recv_sock, &len, sizeof(len), 0); g_assert_cmpint(ret, =3D=3D, sizeof(len)); len =3D ntohl(len); =20 g_assert_cmpint(len, =3D=3D, sizeof(send_buf)); recv_buf =3D g_malloc(len); - ret =3D qemu_recv(recv_sock, recv_buf, len, 0); + ret =3D recv(recv_sock, recv_buf, len, 0); g_assert_cmpstr(recv_buf, =3D=3D, send_buf); =20 g_free(recv_buf); @@ -182,13 +182,13 @@ static void test_redirector_rx(void) ret =3D iov_send(send_sock, iov, 2, 0, sizeof(size) + sizeof(send_buf)= ); g_assert_cmpint(ret, =3D=3D, sizeof(send_buf) + sizeof(size)); =20 - ret =3D qemu_recv(backend_sock[0], &len, sizeof(len), 0); + ret =3D recv(backend_sock[0], &len, sizeof(len), 0); g_assert_cmpint(ret, =3D=3D, sizeof(len)); len =3D ntohl(len); =20 g_assert_cmpint(len, =3D=3D, sizeof(send_buf)); recv_buf =3D g_malloc(len); - ret =3D qemu_recv(backend_sock[0], recv_buf, len, 0); + ret =3D recv(backend_sock[0], recv_buf, len, 0); g_assert_cmpstr(recv_buf, =3D=3D, send_buf); =20 close(send_sock); diff --git a/tests/qtest/virtio-net-test.c b/tests/qtest/virtio-net-test.c index 8bf74e516cce..a71395849f33 100644 --- a/tests/qtest/virtio-net-test.c +++ b/tests/qtest/virtio-net-test.c @@ -87,11 +87,11 @@ static void tx_test(QVirtioDevice *dev, QVIRTIO_NET_TIMEOUT_US); guest_free(alloc, req_addr); =20 - ret =3D qemu_recv(socket, &len, sizeof(len), 0); + ret =3D recv(socket, &len, sizeof(len), 0); g_assert_cmpint(ret, =3D=3D, sizeof(len)); len =3D ntohl(len); =20 - ret =3D qemu_recv(socket, buffer, len, 0); + ret =3D recv(socket, buffer, len, 0); g_assert_cmpstr(buffer, =3D=3D, "TEST"); } =20 @@ -202,11 +202,11 @@ static void announce_self(void *obj, void *data, QGue= stAllocator *t_alloc) qobject_unref(rsp); =20 /* Catch the first packet and make sure it's a RARP */ - ret =3D qemu_recv(sv[0], &len, sizeof(len), 0); + ret =3D recv(sv[0], &len, sizeof(len), 0); g_assert_cmpint(ret, =3D=3D, sizeof(len)); len =3D ntohl(len); =20 - ret =3D qemu_recv(sv[0], buffer, len, 0); + ret =3D recv(sv[0], buffer, len, 0); g_assert_cmpint(*proto, =3D=3D, htons(ETH_P_RARP)); =20 /* @@ -230,7 +230,7 @@ static void announce_self(void *obj, void *data, QGuest= Allocator *t_alloc) =20 while (true) { int saved_err; - ret =3D qemu_recv(sv[0], buffer, 60, MSG_DONTWAIT); + ret =3D recv(sv[0], buffer, 60, MSG_DONTWAIT); saved_err =3D errno; now =3D g_get_monotonic_time(); g_assert_cmpint(now, <, deadline); diff --git a/tests/unit/socket-helpers.c b/tests/unit/socket-helpers.c index f704fd1a69ce..ef31664d0224 100644 --- a/tests/unit/socket-helpers.c +++ b/tests/unit/socket-helpers.c @@ -105,7 +105,7 @@ static int socket_can_bind_connect(const char *hostname= , int family) } =20 if (check_soerr) { - if (qemu_getsockopt(cfd, SOL_SOCKET, SO_ERROR, &soerr, &soerrlen) = < 0) { + if (getsockopt(cfd, SOL_SOCKET, SO_ERROR, &soerr, &soerrlen) < 0) { goto cleanup; } if (soerr) { diff --git a/util/osdep.c b/util/osdep.c index 723cdcb004fe..f16846e17722 100644 --- a/util/osdep.c +++ b/util/osdep.c @@ -50,7 +50,7 @@ static const char *hw_version =3D QEMU_HW_VERSION; int socket_set_cork(int fd, int v) { #if defined(SOL_TCP) && defined(TCP_CORK) - return qemu_setsockopt(fd, SOL_TCP, TCP_CORK, &v, sizeof(v)); + return setsockopt(fd, SOL_TCP, TCP_CORK, &v, sizeof(v)); #else return 0; #endif @@ -59,7 +59,7 @@ int socket_set_cork(int fd, int v) int socket_set_nodelay(int fd) { int v =3D 1; - return qemu_setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &v, sizeof(v)); + return setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &v, sizeof(v)); } =20 int qemu_madvise(void *addr, size_t len, int advice) diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c index 0585e7a6298e..e8f45a7d30a5 100644 --- a/util/qemu-sockets.c +++ b/util/qemu-sockets.c @@ -97,7 +97,7 @@ bool fd_is_socket(int fd) { int optval; socklen_t optlen =3D sizeof(optval); - return !qemu_getsockopt(fd, SOL_SOCKET, SO_TYPE, &optval, &optlen); + return !getsockopt(fd, SOL_SOCKET, SO_TYPE, &optval, &optlen); } =20 =20 @@ -185,8 +185,8 @@ static int try_bind(int socket, InetSocketAddress *sadd= r, struct addrinfo *e) =20 rebind: if (e->ai_family =3D=3D PF_INET6) { - qemu_setsockopt(socket, IPPROTO_IPV6, IPV6_V6ONLY, &v6only, - sizeof(v6only)); + setsockopt(socket, IPPROTO_IPV6, IPV6_V6ONLY, &v6only, + sizeof(v6only)); } =20 stat =3D bind(socket, e->ai_addr, e->ai_addrlen); @@ -483,8 +483,8 @@ int inet_connect_saddr(InetSocketAddress *saddr, Error = **errp) =20 if (saddr->keep_alive) { int val =3D 1; - int ret =3D qemu_setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE, - &val, sizeof(val)); + int ret =3D setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE, + &val, sizeof(val)); =20 if (ret < 0) { error_setg_errno(errp, errno, "Unable to set KEEPALIVE"); --=20 2.35.1.273.ge6ebfd0e8cbb From nobody Tue May 14 01:36:19 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1645559947444655.4664113721828; Tue, 22 Feb 2022 11:59:07 -0800 (PST) Received: from localhost ([::1]:47732 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nMbJS-000531-2R for importer@patchew.org; Tue, 22 Feb 2022 14:59:06 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48196) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nMb2R-0000sq-CL for qemu-devel@nongnu.org; Tue, 22 Feb 2022 14:41:31 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:27666) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nMb2M-0008AQ-Jm for qemu-devel@nongnu.org; Tue, 22 Feb 2022 14:41:30 -0500 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-433-wWfEY_IUMNi7IpO68r-i5A-1; Tue, 22 Feb 2022 14:41:24 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4D8371854E26; Tue, 22 Feb 2022 19:41:23 +0000 (UTC) Received: from localhost (unknown [10.39.208.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4218C100690B; Tue, 22 Feb 2022 19:41:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645558886; 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=Ux9tQW7/UZY4CEaNCL65+AwyeXtE0bQ3BUomJhfmeGc=; b=FW4Px3SZM+NK7B0Nh+McQhGEoctnLZ38e3XwjR9aSIX/rBE9zobVH5pMa3iWK2xQQ5T5Om e/mqlUe4HrdvndWewbyefHiCSB/rUjx5IvJx0V39LGXsM5pPbRcCMkWAw8a6WnGvrJnl2B tRa+DhS3CmR2G+vFSyaIj74xM+ssJLM= X-MC-Unique: wWfEY_IUMNi7IpO68r-i5A-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PATCH 8/8] Replace GCC_FMT_ATTR with G_GNUC_PRINTF Date: Tue, 22 Feb 2022 23:40:08 +0400 Message-Id: <20220222194008.610377-9-marcandre.lureau@redhat.com> In-Reply-To: <20220222194008.610377-1-marcandre.lureau@redhat.com> References: <20220222194008.610377-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=marcandre.lureau@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, 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: peter.maydell@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , pbonzini@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1645559947867100003 From: Marc-Andr=C3=A9 Lureau One less qemu-specific macro. It also helps to make some headers/units only depend on glib, and thus moved in standalone projects eventually. Signed-off-by: Marc-Andr=C3=A9 Lureau --- audio/audio.h | 4 +-- block/qcow2.h | 2 +- bsd-user/qemu.h | 2 +- hw/display/qxl.h | 2 +- hw/net/rocker/rocker.h | 2 +- hw/xen/xen_pt.h | 2 +- include/chardev/char-fe.h | 2 +- include/disas/dis-asm.h | 2 +- include/hw/acpi/aml-build.h | 12 +++---- include/hw/core/cpu.h | 2 +- include/hw/hw.h | 2 +- include/hw/virtio/virtio.h | 2 +- include/hw/xen/xen-bus-helper.h | 4 +-- include/hw/xen/xen-bus.h | 4 +-- include/hw/xen/xen_common.h | 2 +- include/hw/xen/xen_pvdev.h | 2 +- include/monitor/monitor.h | 4 +-- include/qapi/error.h | 20 ++++++------ include/qapi/qmp/qjson.h | 8 ++--- include/qemu/buffer.h | 2 +- include/qemu/compiler.h | 11 ++----- include/qemu/error-report.h | 24 +++++++------- include/qemu/log-for-trace.h | 2 +- include/qemu/log.h | 2 +- include/qemu/qemu-print.h | 8 ++--- include/qemu/readline.h | 2 +- qga/guest-agent-core.h | 2 +- qga/vss-win32/requester.h | 2 +- scripts/cocci-macro-file.h | 2 +- tests/qtest/libqos/libqtest.h | 42 ++++++++++++------------- tests/qtest/libqtest-single.h | 2 +- tests/qtest/migration-helpers.h | 6 ++-- audio/alsaaudio.c | 4 +-- audio/coreaudio.c | 4 +-- audio/dsoundaudio.c | 4 +-- audio/ossaudio.c | 4 +-- audio/paaudio.c | 2 +- audio/sdlaudio.c | 2 +- block/blkverify.c | 2 +- block/ssh.c | 4 +-- fsdev/9p-marshal.c | 2 +- fsdev/virtfs-proxy-helper.c | 2 +- hw/9pfs/9p.c | 2 +- hw/acpi/aml-build.c | 4 +-- hw/mips/fuloong2e.c | 2 +- hw/mips/malta.c | 2 +- hw/net/rtl8139.c | 2 +- hw/virtio/virtio.c | 2 +- io/channel-websock.c | 2 +- monitor/hmp.c | 4 +-- nbd/server.c | 10 +++--- qemu-img.c | 4 +-- qemu-io.c | 2 +- qobject/json-parser.c | 2 +- softmmu/qtest.c | 4 +-- tests/qtest/libqtest.c | 2 +- tests/unit/test-qobject-input-visitor.c | 4 +-- scripts/checkpatch.pl | 2 +- 58 files changed, 130 insertions(+), 137 deletions(-) diff --git a/audio/audio.h b/audio/audio.h index c8bde536b5cd..cbb10f4816e5 100644 --- a/audio/audio.h +++ b/audio/audio.h @@ -91,8 +91,8 @@ typedef struct QEMUAudioTimeStamp { uint64_t old_ts; } QEMUAudioTimeStamp; =20 -void AUD_vlog (const char *cap, const char *fmt, va_list ap) GCC_FMT_ATTR(= 2, 0); -void AUD_log (const char *cap, const char *fmt, ...) GCC_FMT_ATTR(2, 3); +void AUD_vlog (const char *cap, const char *fmt, va_list ap) G_GNUC_PRINTF= (2, 0); +void AUD_log (const char *cap, const char *fmt, ...) G_GNUC_PRINTF(2, 3); =20 void AUD_register_card (const char *name, QEMUSoundCard *card); void AUD_remove_card (QEMUSoundCard *card); diff --git a/block/qcow2.h b/block/qcow2.h index fd48a89d452c..ba436a8d0d68 100644 --- a/block/qcow2.h +++ b/block/qcow2.h @@ -838,7 +838,7 @@ int qcow2_update_header(BlockDriverState *bs); =20 void qcow2_signal_corruption(BlockDriverState *bs, bool fatal, int64_t off= set, int64_t size, const char *message_format, ...) - GCC_FMT_ATTR(5, 6); + G_GNUC_PRINTF(5, 6); =20 int qcow2_validate_table(BlockDriverState *bs, uint64_t offset, uint64_t entries, size_t entry_len, diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h index 02921ac8b3b7..9c8237dbbce2 100644 --- a/bsd-user/qemu.h +++ b/bsd-user/qemu.h @@ -181,7 +181,7 @@ abi_long do_netbsd_syscall(void *cpu_env, int num, abi_= long arg1, abi_long do_openbsd_syscall(void *cpu_env, int num, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5, abi_long arg6); -void gemu_log(const char *fmt, ...) GCC_FMT_ATTR(1, 2); +void gemu_log(const char *fmt, ...) G_GNUC_PRINTF(1, 2); extern __thread CPUState *thread_cpu; void cpu_loop(CPUArchState *env); char *target_strerror(int err); diff --git a/hw/display/qxl.h b/hw/display/qxl.h index 30d21f4d0bdc..e74de9579df3 100644 --- a/hw/display/qxl.h +++ b/hw/display/qxl.h @@ -149,7 +149,7 @@ OBJECT_DECLARE_SIMPLE_TYPE(PCIQXLDevice, PCI_QXL) /* qxl.c */ void *qxl_phys2virt(PCIQXLDevice *qxl, QXLPHYSICAL phys, int group_id); void qxl_set_guest_bug(PCIQXLDevice *qxl, const char *msg, ...) - GCC_FMT_ATTR(2, 3); + G_GNUC_PRINTF(2, 3); =20 void qxl_spice_update_area(PCIQXLDevice *qxl, uint32_t surface_id, struct QXLRect *area, struct QXLRect *dirty_rec= ts, diff --git a/hw/net/rocker/rocker.h b/hw/net/rocker/rocker.h index 412fa44d0171..f85354d9d136 100644 --- a/hw/net/rocker/rocker.h +++ b/hw/net/rocker/rocker.h @@ -30,7 +30,7 @@ fprintf(stderr, "%s ROCKER: " fmt, nowstr, ## __VA_ARGS__);\ } while (0) #else -static inline GCC_FMT_ATTR(1, 2) int DPRINTF(const char *fmt, ...) +static inline G_GNUC_PRINTF(1, 2) int DPRINTF(const char *fmt, ...) { return 0; } diff --git a/hw/xen/xen_pt.h b/hw/xen/xen_pt.h index c74c4678f20d..6b8e13cdeed5 100644 --- a/hw/xen/xen_pt.h +++ b/hw/xen/xen_pt.h @@ -9,7 +9,7 @@ bool xen_igd_gfx_pt_enabled(void); void xen_igd_gfx_pt_set(bool value, Error **errp); =20 -void xen_pt_log(const PCIDevice *d, const char *f, ...) GCC_FMT_ATTR(2, 3); +void xen_pt_log(const PCIDevice *d, const char *f, ...) G_GNUC_PRINTF(2, 3= ); =20 #define XEN_PT_ERR(d, _f, _a...) xen_pt_log(d, "%s: Error: "_f, __func__, = ##_a) =20 diff --git a/include/chardev/char-fe.h b/include/chardev/char-fe.h index 867ef1b3b28a..8c420fa36e3c 100644 --- a/include/chardev/char-fe.h +++ b/include/chardev/char-fe.h @@ -172,7 +172,7 @@ void qemu_chr_fe_set_open(CharBackend *be, int fe_open); * Chardev. */ void qemu_chr_fe_printf(CharBackend *be, const char *fmt, ...) - GCC_FMT_ATTR(2, 3); + G_GNUC_PRINTF(2, 3); =20 =20 typedef gboolean (*FEWatchFunc)(void *do_not_use, GIOCondition condition, = void *data); diff --git a/include/disas/dis-asm.h b/include/disas/dis-asm.h index 102a1e7f504e..fadf6a65ef15 100644 --- a/include/disas/dis-asm.h +++ b/include/disas/dis-asm.h @@ -269,7 +269,7 @@ typedef struct symbol_cache_entry } asymbol; =20 typedef int (*fprintf_function)(FILE *f, const char *fmt, ...) - GCC_FMT_ATTR(2, 3); + G_GNUC_PRINTF(2, 3); =20 enum dis_insn_type { dis_noninsn, /* Not a valid instruction */ diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h index 8346003a224b..d1fb08514bfa 100644 --- a/include/hw/acpi/aml-build.h +++ b/include/hw/acpi/aml-build.h @@ -289,7 +289,7 @@ void free_aml_allocator(void); void aml_append(Aml *parent_ctx, Aml *child); =20 /* non block AML object primitives */ -Aml *aml_name(const char *name_format, ...) GCC_FMT_ATTR(1, 2); +Aml *aml_name(const char *name_format, ...) G_GNUC_PRINTF(1, 2); Aml *aml_name_decl(const char *name, Aml *val); Aml *aml_debug(void); Aml *aml_return(Aml *val); @@ -344,13 +344,13 @@ Aml *aml_irq_no_flags(uint8_t irq); Aml *aml_named_field(const char *name, unsigned length); Aml *aml_reserved_field(unsigned length); Aml *aml_local(int num); -Aml *aml_string(const char *name_format, ...) GCC_FMT_ATTR(1, 2); +Aml *aml_string(const char *name_format, ...) G_GNUC_PRINTF(1, 2); Aml *aml_lnot(Aml *arg); Aml *aml_equal(Aml *arg1, Aml *arg2); Aml *aml_lgreater(Aml *arg1, Aml *arg2); Aml *aml_lgreater_equal(Aml *arg1, Aml *arg2); Aml *aml_processor(uint8_t proc_id, uint32_t pblk_addr, uint8_t pblk_len, - const char *name_format, ...) GCC_FMT_ATTR(4, 5); + const char *name_format, ...) G_GNUC_PRINTF(4, 5); Aml *aml_eisaid(const char *str); Aml *aml_word_bus_number(AmlMinFixed min_fixed, AmlMaxFixed max_fixed, AmlDecode dec, uint16_t addr_gran, @@ -384,8 +384,8 @@ Aml *aml_sleep(uint64_t msec); Aml *aml_i2c_serial_bus_device(uint16_t address, const char *resource_sour= ce); =20 /* Block AML object primitives */ -Aml *aml_scope(const char *name_format, ...) GCC_FMT_ATTR(1, 2); -Aml *aml_device(const char *name_format, ...) GCC_FMT_ATTR(1, 2); +Aml *aml_scope(const char *name_format, ...) G_GNUC_PRINTF(1, 2); +Aml *aml_device(const char *name_format, ...) G_GNUC_PRINTF(1, 2); Aml *aml_method(const char *name, int arg_count, AmlSerializeFlag sflag); Aml *aml_if(Aml *predicate); Aml *aml_else(void); @@ -460,7 +460,7 @@ build_xsdt(GArray *table_data, BIOSLinker *linker, GArr= ay *table_offsets, =20 int build_append_named_dword(GArray *array, const char *name_format, ...) -GCC_FMT_ATTR(2, 3); +G_GNUC_PRINTF(2, 3); =20 void build_append_gas(GArray *table, AmlAddressSpace as, uint8_t bit_width, uint8_t bit_offset, diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 76ab3b851c87..fc1238f57708 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -1009,7 +1009,7 @@ int cpu_watchpoint_address_matches(CPUState *cpu, vad= dr addr, vaddr len); AddressSpace *cpu_get_address_space(CPUState *cpu, int asidx); =20 void QEMU_NORETURN cpu_abort(CPUState *cpu, const char *fmt, ...) - GCC_FMT_ATTR(2, 3); + G_GNUC_PRINTF(2, 3); =20 /* $(top_srcdir)/cpu.c */ void cpu_class_init_props(DeviceClass *dc); diff --git a/include/hw/hw.h b/include/hw/hw.h index fc5301f29372..34377f5309d3 100644 --- a/include/hw/hw.h +++ b/include/hw/hw.h @@ -5,6 +5,6 @@ #error Cannot include hw/hw.h from user emulation #endif =20 -void QEMU_NORETURN hw_error(const char *fmt, ...) GCC_FMT_ATTR(1, 2); +void QEMU_NORETURN hw_error(const char *fmt, ...) G_GNUC_PRINTF(1, 2); =20 #endif diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h index f095637058dc..b31c4507f5dd 100644 --- a/include/hw/virtio/virtio.h +++ b/include/hw/virtio/virtio.h @@ -169,7 +169,7 @@ void virtio_init(VirtIODevice *vdev, const char *name, uint16_t device_id, size_t config_size); void virtio_cleanup(VirtIODevice *vdev); =20 -void virtio_error(VirtIODevice *vdev, const char *fmt, ...) GCC_FMT_ATTR(2= , 3); +void virtio_error(VirtIODevice *vdev, const char *fmt, ...) G_GNUC_PRINTF(= 2, 3); =20 /* Set the child bus name. */ void virtio_device_set_child_bus_name(VirtIODevice *vdev, char *bus_name); diff --git a/include/hw/xen/xen-bus-helper.h b/include/hw/xen/xen-bus-helpe= r.h index 4c0f747445c2..629a904d1a86 100644 --- a/include/hw/xen/xen-bus-helper.h +++ b/include/hw/xen/xen-bus-helper.h @@ -22,11 +22,11 @@ void xs_node_destroy(struct xs_handle *xsh, xs_transac= tion_t tid, void xs_node_vprintf(struct xs_handle *xsh, xs_transaction_t tid, const char *node, const char *key, Error **errp, const char *fmt, va_list ap) - GCC_FMT_ATTR(6, 0); + G_GNUC_PRINTF(6, 0); void xs_node_printf(struct xs_handle *xsh, xs_transaction_t tid, const char *node, const char *key, Error **errp, const char *fmt, ...) - GCC_FMT_ATTR(6, 7); + G_GNUC_PRINTF(6, 7); =20 /* 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, diff --git a/include/hw/xen/xen-bus.h b/include/hw/xen/xen-bus.h index 6bdbf3ff8220..713e763348f4 100644 --- a/include/hw/xen/xen-bus.h +++ b/include/hw/xen/xen-bus.h @@ -88,10 +88,10 @@ enum xenbus_state xen_device_backend_get_state(XenDevic= e *xendev); =20 void xen_device_backend_printf(XenDevice *xendev, const char *key, const char *fmt, ...) - GCC_FMT_ATTR(3, 4); + G_GNUC_PRINTF(3, 4); void xen_device_frontend_printf(XenDevice *xendev, const char *key, const char *fmt, ...) - GCC_FMT_ATTR(3, 4); + G_GNUC_PRINTF(3, 4); =20 int xen_device_frontend_scanf(XenDevice *xendev, const char *key, const char *fmt, ...); diff --git a/include/hw/xen/xen_common.h b/include/hw/xen/xen_common.h index a8118b41acfb..179741ff791c 100644 --- a/include/hw/xen/xen_common.h +++ b/include/hw/xen/xen_common.h @@ -358,7 +358,7 @@ static inline int xen_restrict(domid_t domid) void destroy_hvm_domain(bool reboot); =20 /* shutdown/destroy current domain because of an error */ -void xen_shutdown_fatal_error(const char *fmt, ...) GCC_FMT_ATTR(1, 2); +void xen_shutdown_fatal_error(const char *fmt, ...) G_GNUC_PRINTF(1, 2); =20 #ifdef HVM_PARAM_VMPORT_REGS_PFN static inline int xen_get_vmport_regs_pfn(xc_interface *xc, domid_t dom, diff --git a/include/hw/xen/xen_pvdev.h b/include/hw/xen/xen_pvdev.h index 83e5174d9029..7cd4bc2b8284 100644 --- a/include/hw/xen/xen_pvdev.h +++ b/include/hw/xen/xen_pvdev.h @@ -76,6 +76,6 @@ void xen_pv_unbind_evtchn(struct XenLegacyDevice *xendev); int xen_pv_send_notify(struct XenLegacyDevice *xendev); =20 void xen_pv_printf(struct XenLegacyDevice *xendev, int msg_level, - const char *fmt, ...) GCC_FMT_ATTR(3, 4); + const char *fmt, ...) G_GNUC_PRINTF(3, 4); =20 #endif /* QEMU_HW_XEN_PVDEV_H */ diff --git a/include/monitor/monitor.h b/include/monitor/monitor.h index 12d395d62d6b..cc4cc6c6adcf 100644 --- a/include/monitor/monitor.h +++ b/include/monitor/monitor.h @@ -32,8 +32,8 @@ int monitor_get_fd(Monitor *mon, const char *fdname, Erro= r **errp); int monitor_fd_param(Monitor *mon, const char *fdname, Error **errp); =20 int monitor_vprintf(Monitor *mon, const char *fmt, va_list ap) - GCC_FMT_ATTR(2, 0); -int monitor_printf(Monitor *mon, const char *fmt, ...) GCC_FMT_ATTR(2, 3); + G_GNUC_PRINTF(2, 0); +int monitor_printf(Monitor *mon, const char *fmt, ...) G_GNUC_PRINTF(2, 3); void monitor_flush(Monitor *mon); int monitor_set_cpu(Monitor *mon, int cpu_index); int monitor_get_cpu_index(Monitor *mon); diff --git a/include/qapi/error.h b/include/qapi/error.h index 4a9260b0cc00..d798faeec3e9 100644 --- a/include/qapi/error.h +++ b/include/qapi/error.h @@ -320,7 +320,7 @@ ErrorClass error_get_class(const Error *err); void error_setg_internal(Error **errp, const char *src, int line, const char *func, const char *fmt, ...) - GCC_FMT_ATTR(5, 6); + G_GNUC_PRINTF(5, 6); =20 /* * Just like error_setg(), with @os_error info added to the message. @@ -336,7 +336,7 @@ void error_setg_internal(Error **errp, void error_setg_errno_internal(Error **errp, const char *fname, int line, const char *fu= nc, int os_error, const char *fmt, ...) - GCC_FMT_ATTR(6, 7); + G_GNUC_PRINTF(6, 7); =20 #ifdef _WIN32 /* @@ -350,7 +350,7 @@ void error_setg_errno_internal(Error **errp, void error_setg_win32_internal(Error **errp, const char *src, int line, const char *func, int win32_err, const char *fmt, ...) - GCC_FMT_ATTR(6, 7); + G_GNUC_PRINTF(6, 7); #endif =20 /* @@ -383,21 +383,21 @@ void error_propagate(Error **dst_errp, Error *local_e= rr); */ void error_propagate_prepend(Error **dst_errp, Error *local_err, const char *fmt, ...) - GCC_FMT_ATTR(3, 4); + G_GNUC_PRINTF(3, 4); =20 /* * Prepend some text to @errp's human-readable error message. * The text is made by formatting @fmt, @ap like vprintf(). */ void error_vprepend(Error *const *errp, const char *fmt, va_list ap) - GCC_FMT_ATTR(2, 0); + G_GNUC_PRINTF(2, 0); =20 /* * Prepend some text to @errp's human-readable error message. * The text is made by formatting @fmt, ... like printf(). */ void error_prepend(Error *const *errp, const char *fmt, ...) - GCC_FMT_ATTR(2, 3); + G_GNUC_PRINTF(2, 3); =20 /* * Append a printf-style human-readable explanation to an existing error. @@ -414,7 +414,7 @@ void error_prepend(Error *const *errp, const char *fmt,= ...) * newline. */ void error_append_hint(Error *const *errp, const char *fmt, ...) - GCC_FMT_ATTR(2, 3); + G_GNUC_PRINTF(2, 3); =20 /* * Convenience function to report open() failure. @@ -458,13 +458,13 @@ void error_report_err(Error *err); * Convenience function to error_prepend(), warn_report() and free @err. */ void warn_reportf_err(Error *err, const char *fmt, ...) - GCC_FMT_ATTR(2, 3); + G_GNUC_PRINTF(2, 3); =20 /* * Convenience function to error_prepend(), error_report() and free @err. */ void error_reportf_err(Error *err, const char *fmt, ...) - GCC_FMT_ATTR(2, 3); + G_GNUC_PRINTF(2, 3); =20 /* * Just like error_setg(), except you get to specify the error class. @@ -477,7 +477,7 @@ void error_reportf_err(Error *err, const char *fmt, ...) void error_set_internal(Error **errp, const char *src, int line, const char *func, ErrorClass err_class, const char *fmt, ...) - GCC_FMT_ATTR(6, 7); + G_GNUC_PRINTF(6, 7); =20 /* * Make @errp parameter easier to use regardless of argument value diff --git a/include/qapi/qmp/qjson.h b/include/qapi/qmp/qjson.h index 593b40b4e0a4..7bd8d2de1b33 100644 --- a/include/qapi/qmp/qjson.h +++ b/include/qapi/qmp/qjson.h @@ -17,13 +17,13 @@ QObject *qobject_from_json(const char *string, Error **errp); =20 QObject *qobject_from_vjsonf_nofail(const char *string, va_list ap) - GCC_FMT_ATTR(1, 0); + G_GNUC_PRINTF(1, 0); QObject *qobject_from_jsonf_nofail(const char *string, ...) - GCC_FMT_ATTR(1, 2); + G_GNUC_PRINTF(1, 2); QDict *qdict_from_vjsonf_nofail(const char *string, va_list ap) - GCC_FMT_ATTR(1, 0); + G_GNUC_PRINTF(1, 0); QDict *qdict_from_jsonf_nofail(const char *string, ...) - GCC_FMT_ATTR(1, 2); + G_GNUC_PRINTF(1, 2); =20 GString *qobject_to_json(const QObject *obj); GString *qobject_to_json_pretty(const QObject *obj, bool pretty); diff --git a/include/qemu/buffer.h b/include/qemu/buffer.h index d34d2c857ccc..e95dfd696ca8 100644 --- a/include/qemu/buffer.h +++ b/include/qemu/buffer.h @@ -49,7 +49,7 @@ struct Buffer { * to identify in debug traces. */ void buffer_init(Buffer *buffer, const char *name, ...) - GCC_FMT_ATTR(2, 3); + G_GNUC_PRINTF(2, 3); =20 /** * buffer_shrink: diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h index 3baa5e3790f7..f2bd050e3b9a 100644 --- a/include/qemu/compiler.h +++ b/include/qemu/compiler.h @@ -79,19 +79,12 @@ #define QEMU_BUILD_BUG_ON_ZERO(x) (sizeof(QEMU_BUILD_BUG_ON_STRUCT(x)) - \ sizeof(QEMU_BUILD_BUG_ON_STRUCT(x))) =20 -#if defined(__clang__) -/* clang doesn't support gnu_printf, so use printf. */ -# define GCC_FMT_ATTR(n, m) __attribute__((format(printf, n, m))) -#else -/* Use gnu_printf (qemu uses standard format strings). */ -# define GCC_FMT_ATTR(n, m) __attribute__((format(gnu_printf, n, m))) -# if defined(_WIN32) +#if !defined(__clang__) && defined(_WIN32) /* * Map __printf__ to __gnu_printf__ because we want standard format string= s even * when MinGW or GLib include files use __printf__. */ -# define __printf__ __gnu_printf__ -# endif +# define __printf__ __gnu_printf__ #endif =20 #ifndef __has_warning diff --git a/include/qemu/error-report.h b/include/qemu/error-report.h index 9d197daca387..33e662db44c6 100644 --- a/include/qemu/error-report.h +++ b/include/qemu/error-report.h @@ -30,23 +30,23 @@ void loc_set_none(void); void loc_set_cmdline(char **argv, int idx, int cnt); void loc_set_file(const char *fname, int lno); =20 -int error_vprintf(const char *fmt, va_list ap) GCC_FMT_ATTR(1, 0); -int error_printf(const char *fmt, ...) GCC_FMT_ATTR(1, 2); -int error_vprintf_unless_qmp(const char *fmt, va_list ap) GCC_FMT_ATTR(1, = 0); -int error_printf_unless_qmp(const char *fmt, ...) GCC_FMT_ATTR(1, 2); +int error_vprintf(const char *fmt, va_list ap) G_GNUC_PRINTF(1, 0); +int error_printf(const char *fmt, ...) G_GNUC_PRINTF(1, 2); +int error_vprintf_unless_qmp(const char *fmt, va_list ap) G_GNUC_PRINTF(1,= 0); +int error_printf_unless_qmp(const char *fmt, ...) G_GNUC_PRINTF(1, 2); =20 -void error_vreport(const char *fmt, va_list ap) GCC_FMT_ATTR(1, 0); -void warn_vreport(const char *fmt, va_list ap) GCC_FMT_ATTR(1, 0); -void info_vreport(const char *fmt, va_list ap) GCC_FMT_ATTR(1, 0); +void error_vreport(const char *fmt, va_list ap) G_GNUC_PRINTF(1, 0); +void warn_vreport(const char *fmt, va_list ap) G_GNUC_PRINTF(1, 0); +void info_vreport(const char *fmt, va_list ap) G_GNUC_PRINTF(1, 0); =20 -void error_report(const char *fmt, ...) GCC_FMT_ATTR(1, 2); -void warn_report(const char *fmt, ...) GCC_FMT_ATTR(1, 2); -void info_report(const char *fmt, ...) GCC_FMT_ATTR(1, 2); +void error_report(const char *fmt, ...) G_GNUC_PRINTF(1, 2); +void warn_report(const char *fmt, ...) G_GNUC_PRINTF(1, 2); +void info_report(const char *fmt, ...) G_GNUC_PRINTF(1, 2); =20 bool error_report_once_cond(bool *printed, const char *fmt, ...) - GCC_FMT_ATTR(2, 3); + G_GNUC_PRINTF(2, 3); bool warn_report_once_cond(bool *printed, const char *fmt, ...) - GCC_FMT_ATTR(2, 3); + G_GNUC_PRINTF(2, 3); =20 void error_init(const char *argv0); =20 diff --git a/include/qemu/log-for-trace.h b/include/qemu/log-for-trace.h index 2f0a5b080eab..5e415172278a 100644 --- a/include/qemu/log-for-trace.h +++ b/include/qemu/log-for-trace.h @@ -30,6 +30,6 @@ static inline bool qemu_loglevel_mask(int mask) } =20 /* main logging function */ -int GCC_FMT_ATTR(1, 2) qemu_log(const char *fmt, ...); +int G_GNUC_PRINTF(1, 2) qemu_log(const char *fmt, ...); =20 #endif diff --git a/include/qemu/log.h b/include/qemu/log.h index 9b8066020729..5739c7e6d819 100644 --- a/include/qemu/log.h +++ b/include/qemu/log.h @@ -96,7 +96,7 @@ static inline void qemu_log_unlock(FILE *fd) =20 /* vfprintf-like logging function */ -static inline void GCC_FMT_ATTR(1, 0) +static inline void G_GNUC_PRINTF(1, 0) qemu_log_vprintf(const char *fmt, va_list va) { QemuLogFile *logfile; diff --git a/include/qemu/qemu-print.h b/include/qemu/qemu-print.h index 40b596262fae..1b70920648b8 100644 --- a/include/qemu/qemu-print.h +++ b/include/qemu/qemu-print.h @@ -13,11 +13,11 @@ #ifndef QEMU_PRINT_H #define QEMU_PRINT_H =20 -int qemu_vprintf(const char *fmt, va_list ap) GCC_FMT_ATTR(1, 0); -int qemu_printf(const char *fmt, ...) GCC_FMT_ATTR(1, 2); +int qemu_vprintf(const char *fmt, va_list ap) G_GNUC_PRINTF(1, 0); +int qemu_printf(const char *fmt, ...) G_GNUC_PRINTF(1, 2); =20 int qemu_vfprintf(FILE *stream, const char *fmt, va_list ap) - GCC_FMT_ATTR(2, 0); -int qemu_fprintf(FILE *stream, const char *fmt, ...) GCC_FMT_ATTR(2, 3); + G_GNUC_PRINTF(2, 0); +int qemu_fprintf(FILE *stream, const char *fmt, ...) G_GNUC_PRINTF(2, 3); =20 #endif diff --git a/include/qemu/readline.h b/include/qemu/readline.h index e81258322be6..622aa4564f67 100644 --- a/include/qemu/readline.h +++ b/include/qemu/readline.h @@ -5,7 +5,7 @@ #define READLINE_MAX_CMDS 64 #define READLINE_MAX_COMPLETIONS 256 =20 -typedef void GCC_FMT_ATTR(2, 3) ReadLinePrintfFunc(void *opaque, +typedef void G_GNUC_PRINTF(2, 3) ReadLinePrintfFunc(void *opaque, const char *fmt, ...); typedef void ReadLineFlushFunc(void *opaque); typedef void ReadLineFunc(void *opaque, const char *str, diff --git a/qga/guest-agent-core.h b/qga/guest-agent-core.h index 9d01ea9c82ab..29cd50402fdb 100644 --- a/qga/guest-agent-core.h +++ b/qga/guest-agent-core.h @@ -36,7 +36,7 @@ void ga_command_state_free(GACommandState *cs); bool ga_logging_enabled(GAState *s); void ga_disable_logging(GAState *s); void ga_enable_logging(GAState *s); -void GCC_FMT_ATTR(1, 2) slog(const gchar *fmt, ...); +void G_GNUC_PRINTF(1, 2) slog(const gchar *fmt, ...); void ga_set_response_delimited(GAState *s); bool ga_is_frozen(GAState *s); void ga_set_frozen(GAState *s); diff --git a/qga/vss-win32/requester.h b/qga/vss-win32/requester.h index 5a8e8faf0cea..ecc5f2acb4fd 100644 --- a/qga/vss-win32/requester.h +++ b/qga/vss-win32/requester.h @@ -25,7 +25,7 @@ struct Error; typedef void (*ErrorSetFunc)(struct Error **errp, const char *src, int line, const char *func, int win32_err, const char *fmt, ...) - GCC_FMT_ATTR(6, 7); + G_GNUC_PRINTF(6, 7); typedef struct ErrorSet { ErrorSetFunc error_setg_win32_wrapper; struct Error **errp; /* restriction: must not be null */ diff --git a/scripts/cocci-macro-file.h b/scripts/cocci-macro-file.h index 20eea6b708f5..c2fcea8e77a2 100644 --- a/scripts/cocci-macro-file.h +++ b/scripts/cocci-macro-file.h @@ -34,7 +34,7 @@ #define QEMU_BUILD_BUG_ON(x) \ typedef char cat2(qemu_build_bug_on__,__LINE__)[(x)?-1:1] __attribute_= _((unused)); =20 -#define GCC_FMT_ATTR(n, m) __attribute__((format(gnu_printf, n, m))) +#define G_GNUC_PRINTF(n, m) __attribute__((format(gnu_printf, n, m))) =20 #define xglue(x, y) x ## y #define glue(x, y) xglue(x, y) diff --git a/tests/qtest/libqos/libqtest.h b/tests/qtest/libqos/libqtest.h index cf38d273f5c0..552667f17e37 100644 --- a/tests/qtest/libqos/libqtest.h +++ b/tests/qtest/libqos/libqtest.h @@ -31,7 +31,7 @@ typedef struct QTestState QTestState; * * Returns: #QTestState instance. */ -QTestState *qtest_initf(const char *fmt, ...) GCC_FMT_ATTR(1, 2); +QTestState *qtest_initf(const char *fmt, ...) G_GNUC_PRINTF(1, 2); =20 /** * qtest_vinitf: @@ -43,7 +43,7 @@ QTestState *qtest_initf(const char *fmt, ...) GCC_FMT_ATT= R(1, 2); * * Returns: #QTestState instance. */ -QTestState *qtest_vinitf(const char *fmt, va_list ap) GCC_FMT_ATTR(1, 0); +QTestState *qtest_vinitf(const char *fmt, va_list ap) G_GNUC_PRINTF(1, 0); =20 /** * qtest_init: @@ -106,7 +106,7 @@ void qtest_quit(QTestState *s); */ QDict *qtest_qmp_fds(QTestState *s, int *fds, size_t fds_num, const char *fmt, ...) - GCC_FMT_ATTR(4, 5); + G_GNUC_PRINTF(4, 5); =20 /** * qtest_qmp: @@ -118,7 +118,7 @@ QDict *qtest_qmp_fds(QTestState *s, int *fds, size_t fd= s_num, * Sends a QMP message to QEMU and returns the response. */ QDict *qtest_qmp(QTestState *s, const char *fmt, ...) - GCC_FMT_ATTR(2, 3); + G_GNUC_PRINTF(2, 3); =20 /** * qtest_qmp_send: @@ -130,7 +130,7 @@ QDict *qtest_qmp(QTestState *s, const char *fmt, ...) * Sends a QMP message to QEMU and leaves the response in the stream. */ void qtest_qmp_send(QTestState *s, const char *fmt, ...) - GCC_FMT_ATTR(2, 3); + G_GNUC_PRINTF(2, 3); =20 /** * qtest_qmp_send_raw: @@ -141,7 +141,7 @@ void qtest_qmp_send(QTestState *s, const char *fmt, ...) * this is useful for negative tests. */ void qtest_qmp_send_raw(QTestState *s, const char *fmt, ...) - GCC_FMT_ATTR(2, 3); + G_GNUC_PRINTF(2, 3); =20 /** * qtest_socket_server: @@ -165,7 +165,7 @@ int qtest_socket_server(const char *socket_path); */ QDict *qtest_vqmp_fds(QTestState *s, int *fds, size_t fds_num, const char *fmt, va_list ap) - GCC_FMT_ATTR(4, 0); + G_GNUC_PRINTF(4, 0); =20 /** * qtest_vqmp: @@ -178,7 +178,7 @@ QDict *qtest_vqmp_fds(QTestState *s, int *fds, size_t f= ds_num, * Sends a QMP message to QEMU and returns the response. */ QDict *qtest_vqmp(QTestState *s, const char *fmt, va_list ap) - GCC_FMT_ATTR(2, 0); + G_GNUC_PRINTF(2, 0); =20 /** * qtest_qmp_vsend_fds: @@ -194,7 +194,7 @@ QDict *qtest_vqmp(QTestState *s, const char *fmt, va_li= st ap) */ void qtest_qmp_vsend_fds(QTestState *s, int *fds, size_t fds_num, const char *fmt, va_list ap) - GCC_FMT_ATTR(4, 0); + G_GNUC_PRINTF(4, 0); =20 /** * qtest_qmp_vsend: @@ -207,7 +207,7 @@ void qtest_qmp_vsend_fds(QTestState *s, int *fds, size_= t fds_num, * Sends a QMP message to QEMU and leaves the response in the stream. */ void qtest_qmp_vsend(QTestState *s, const char *fmt, va_list ap) - GCC_FMT_ATTR(2, 0); + G_GNUC_PRINTF(2, 0); =20 /** * qtest_qmp_receive_dict: @@ -269,7 +269,7 @@ QDict *qtest_qmp_event_ref(QTestState *s, const char *e= vent); * * Returns: the command's output. The caller should g_free() it. */ -char *qtest_hmp(QTestState *s, const char *fmt, ...) GCC_FMT_ATTR(2, 3); +char *qtest_hmp(QTestState *s, const char *fmt, ...) G_GNUC_PRINTF(2, 3); =20 /** * qtest_hmpv: @@ -283,7 +283,7 @@ char *qtest_hmp(QTestState *s, const char *fmt, ...) GC= C_FMT_ATTR(2, 3); * Returns: the command's output. The caller should g_free() it. */ char *qtest_vhmp(QTestState *s, const char *fmt, va_list ap) - GCC_FMT_ATTR(2, 0); + G_GNUC_PRINTF(2, 0); =20 void qtest_module_load(QTestState *s, const char *prefix, const char *libn= ame); =20 @@ -688,17 +688,17 @@ void qtest_remove_abrt_handler(void *data); * the response. */ void qtest_qmp_assert_success(QTestState *qts, const char *fmt, ...) - GCC_FMT_ATTR(2, 3); + G_GNUC_PRINTF(2, 3); =20 QDict *qmp_fd_receive(int fd); void qmp_fd_vsend_fds(int fd, int *fds, size_t fds_num, - const char *fmt, va_list ap) GCC_FMT_ATTR(4, 0); -void qmp_fd_vsend(int fd, const char *fmt, va_list ap) GCC_FMT_ATTR(2, 0); -void qmp_fd_send(int fd, const char *fmt, ...) GCC_FMT_ATTR(2, 3); -void qmp_fd_send_raw(int fd, const char *fmt, ...) GCC_FMT_ATTR(2, 3); -void qmp_fd_vsend_raw(int fd, const char *fmt, va_list ap) GCC_FMT_ATTR(2,= 0); -QDict *qmp_fdv(int fd, const char *fmt, va_list ap) GCC_FMT_ATTR(2, 0); -QDict *qmp_fd(int fd, const char *fmt, ...) GCC_FMT_ATTR(2, 3); + const char *fmt, va_list ap) G_GNUC_PRINTF(4, 0); +void qmp_fd_vsend(int fd, const char *fmt, va_list ap) G_GNUC_PRINTF(2, 0); +void qmp_fd_send(int fd, const char *fmt, ...) G_GNUC_PRINTF(2, 3); +void qmp_fd_send_raw(int fd, const char *fmt, ...) G_GNUC_PRINTF(2, 3); +void qmp_fd_vsend_raw(int fd, const char *fmt, va_list ap) G_GNUC_PRINTF(2= , 0); +QDict *qmp_fdv(int fd, const char *fmt, va_list ap) G_GNUC_PRINTF(2, 0); +QDict *qmp_fd(int fd, const char *fmt, ...) G_GNUC_PRINTF(2, 3); =20 /** * qtest_cb_for_every_machine: @@ -750,7 +750,7 @@ void qtest_qmp_device_add_qdict(QTestState *qts, const = char *drv, * Generic hot-plugging test via the device_add QMP command. */ void qtest_qmp_device_add(QTestState *qts, const char *driver, const char = *id, - const char *fmt, ...) GCC_FMT_ATTR(4, 5); + const char *fmt, ...) G_GNUC_PRINTF(4, 5); =20 /** * qtest_qmp_add_client: diff --git a/tests/qtest/libqtest-single.h b/tests/qtest/libqtest-single.h index 0d7f568678e5..b0838b9e0e71 100644 --- a/tests/qtest/libqtest-single.h +++ b/tests/qtest/libqtest-single.h @@ -52,7 +52,7 @@ static inline void qtest_end(void) * * Sends a QMP message to QEMU and returns the response. */ -GCC_FMT_ATTR(1, 2) +G_GNUC_PRINTF(1, 2) static inline QDict *qmp(const char *fmt, ...) { va_list ap; diff --git a/tests/qtest/migration-helpers.h b/tests/qtest/migration-helper= s.h index d63bba9630f9..555adafce129 100644 --- a/tests/qtest/migration-helpers.h +++ b/tests/qtest/migration-helpers.h @@ -16,13 +16,13 @@ =20 extern bool got_stop; =20 -GCC_FMT_ATTR(3, 4) +G_GNUC_PRINTF(3, 4) QDict *wait_command_fd(QTestState *who, int fd, const char *command, ...); =20 -GCC_FMT_ATTR(2, 3) +G_GNUC_PRINTF(2, 3) QDict *wait_command(QTestState *who, const char *command, ...); =20 -GCC_FMT_ATTR(3, 4) +G_GNUC_PRINTF(3, 4) void migrate_qmp(QTestState *who, const char *uri, const char *fmt, ...); =20 QDict *migrate_query(QTestState *who); diff --git a/audio/alsaaudio.c b/audio/alsaaudio.c index 2b9789e64771..f1d12eb73ff0 100644 --- a/audio/alsaaudio.c +++ b/audio/alsaaudio.c @@ -72,7 +72,7 @@ struct alsa_params_obt { snd_pcm_uframes_t samples; }; =20 -static void GCC_FMT_ATTR (2, 3) alsa_logerr (int err, const char *fmt, ...) +static void G_GNUC_PRINTF (2, 3) alsa_logerr (int err, const char *fmt, ..= .) { va_list ap; =20 @@ -83,7 +83,7 @@ static void GCC_FMT_ATTR (2, 3) alsa_logerr (int err, con= st char *fmt, ...) AUD_log (AUDIO_CAP, "Reason: %s\n", snd_strerror (err)); } =20 -static void GCC_FMT_ATTR (3, 4) alsa_logerr2 ( +static void G_GNUC_PRINTF (3, 4) alsa_logerr2 ( int err, const char *typ, const char *fmt, diff --git a/audio/coreaudio.c b/audio/coreaudio.c index d8a21d3e5075..f324ea353c18 100644 --- a/audio/coreaudio.c +++ b/audio/coreaudio.c @@ -206,7 +206,7 @@ static void coreaudio_logstatus (OSStatus status) AUD_log (AUDIO_CAP, "Reason: %s\n", str); } =20 -static void GCC_FMT_ATTR (2, 3) coreaudio_logerr ( +static void G_GNUC_PRINTF (2, 3) coreaudio_logerr ( OSStatus status, const char *fmt, ... @@ -221,7 +221,7 @@ static void GCC_FMT_ATTR (2, 3) coreaudio_logerr ( coreaudio_logstatus (status); } =20 -static void GCC_FMT_ATTR (3, 4) coreaudio_logerr2 ( +static void G_GNUC_PRINTF (3, 4) coreaudio_logerr2 ( OSStatus status, const char *typ, const char *fmt, diff --git a/audio/dsoundaudio.c b/audio/dsoundaudio.c index 3dd2c4d4a60b..e9bd0a5fad21 100644 --- a/audio/dsoundaudio.c +++ b/audio/dsoundaudio.c @@ -222,7 +222,7 @@ static void dsound_log_hresult (HRESULT hr) AUD_log (AUDIO_CAP, "Reason: %s\n", str); } =20 -static void GCC_FMT_ATTR (2, 3) dsound_logerr ( +static void G_GNUC_PRINTF (2, 3) dsound_logerr ( HRESULT hr, const char *fmt, ... @@ -237,7 +237,7 @@ static void GCC_FMT_ATTR (2, 3) dsound_logerr ( dsound_log_hresult (hr); } =20 -static void GCC_FMT_ATTR (3, 4) dsound_logerr2 ( +static void G_GNUC_PRINTF (3, 4) dsound_logerr2 ( HRESULT hr, const char *typ, const char *fmt, diff --git a/audio/ossaudio.c b/audio/ossaudio.c index 60eff66424b9..0bd533ffe7d5 100644 --- a/audio/ossaudio.c +++ b/audio/ossaudio.c @@ -63,7 +63,7 @@ struct oss_params { int fragsize; }; =20 -static void GCC_FMT_ATTR (2, 3) oss_logerr (int err, const char *fmt, ...) +static void G_GNUC_PRINTF (2, 3) oss_logerr (int err, const char *fmt, ...) { va_list ap; =20 @@ -74,7 +74,7 @@ static void GCC_FMT_ATTR (2, 3) oss_logerr (int err, cons= t char *fmt, ...) AUD_log (AUDIO_CAP, "Reason: %s\n", strerror (err)); } =20 -static void GCC_FMT_ATTR (3, 4) oss_logerr2 ( +static void G_GNUC_PRINTF (3, 4) oss_logerr2 ( int err, const char *typ, const char *fmt, diff --git a/audio/paaudio.c b/audio/paaudio.c index 75401d53910a..c43b4477181c 100644 --- a/audio/paaudio.c +++ b/audio/paaudio.c @@ -43,7 +43,7 @@ typedef struct { =20 static void qpa_conn_fini(PAConnection *c); =20 -static void GCC_FMT_ATTR (2, 3) qpa_logerr (int err, const char *fmt, ...) +static void G_GNUC_PRINTF (2, 3) qpa_logerr (int err, const char *fmt, ...) { va_list ap; =20 diff --git a/audio/sdlaudio.c b/audio/sdlaudio.c index c68c62a3e4f1..24a4ce95b80c 100644 --- a/audio/sdlaudio.c +++ b/audio/sdlaudio.c @@ -55,7 +55,7 @@ typedef struct SDLVoiceIn { SDL_AudioDeviceID devid; } SDLVoiceIn; =20 -static void GCC_FMT_ATTR (1, 2) sdl_logerr (const char *fmt, ...) +static void G_GNUC_PRINTF (1, 2) sdl_logerr (const char *fmt, ...) { va_list ap; =20 diff --git a/block/blkverify.c b/block/blkverify.c index d1facf5ba90b..c63fb4127661 100644 --- a/block/blkverify.c +++ b/block/blkverify.c @@ -43,7 +43,7 @@ typedef struct BlkverifyRequest { QEMUIOVector *raw_qiov; /* cloned I/O vector for raw file */ } BlkverifyRequest; =20 -static void GCC_FMT_ATTR(2, 3) blkverify_err(BlkverifyRequest *r, +static void G_GNUC_PRINTF(2, 3) blkverify_err(BlkverifyRequest *r, const char *fmt, ...) { va_list ap; diff --git a/block/ssh.c b/block/ssh.c index 3b5bf34031d7..a808de49f72b 100644 --- a/block/ssh.c +++ b/block/ssh.c @@ -108,7 +108,7 @@ static void ssh_state_free(BDRVSSHState *s) } } =20 -static void GCC_FMT_ATTR(3, 4) +static void G_GNUC_PRINTF(3, 4) session_error_setg(Error **errp, BDRVSSHState *s, const char *fs, ...) { va_list args; @@ -133,7 +133,7 @@ session_error_setg(Error **errp, BDRVSSHState *s, const= char *fs, ...) g_free(msg); } =20 -static void GCC_FMT_ATTR(3, 4) +static void G_GNUC_PRINTF(3, 4) sftp_error_setg(Error **errp, BDRVSSHState *s, const char *fs, ...) { va_list args; diff --git a/fsdev/9p-marshal.c b/fsdev/9p-marshal.c index 51881fe22010..f9b0336cd59d 100644 --- a/fsdev/9p-marshal.c +++ b/fsdev/9p-marshal.c @@ -27,7 +27,7 @@ void v9fs_string_free(V9fsString *str) str->size =3D 0; } =20 -void GCC_FMT_ATTR(2, 3) +void G_GNUC_PRINTF(2, 3) v9fs_string_sprintf(V9fsString *str, const char *fmt, ...) { va_list ap; diff --git a/fsdev/virtfs-proxy-helper.c b/fsdev/virtfs-proxy-helper.c index 15c0e79b067b..d06a0f7b8326 100644 --- a/fsdev/virtfs-proxy-helper.c +++ b/fsdev/virtfs-proxy-helper.c @@ -57,7 +57,7 @@ static bool is_daemon; static bool get_version; /* IOC getversion IOCTL supported */ static char *prog_name; =20 -static void GCC_FMT_ATTR(2, 3) do_log(int loglevel, const char *format, ..= .) +static void G_GNUC_PRINTF(2, 3) do_log(int loglevel, const char *format, .= ..) { va_list ap; =20 diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index 15b3f4d3853d..9c2cd9aecd80 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -187,7 +187,7 @@ void v9fs_path_free(V9fsPath *path) } =20 =20 -void GCC_FMT_ATTR(2, 3) +void G_GNUC_PRINTF(2, 3) v9fs_path_sprintf(V9fsPath *path, const char *fmt, ...) { va_list ap; diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index 8966e1632042..741e5f050129 100644 --- a/hw/acpi/aml-build.c +++ b/hw/acpi/aml-build.c @@ -207,7 +207,7 @@ build_append_nameseg(GArray *array, const char *seg) g_array_append_vals(array, "____", ACPI_NAMESEG_LEN - len); } =20 -static void GCC_FMT_ATTR(2, 0) +static void G_GNUC_PRINTF(2, 0) build_append_namestringv(GArray *array, const char *format, va_list ap) { char *s; @@ -270,7 +270,7 @@ build_append_namestringv(GArray *array, const char *for= mat, va_list ap) g_strfreev(segs); } =20 -GCC_FMT_ATTR(2, 3) +G_GNUC_PRINTF(2, 3) static void build_append_namestring(GArray *array, const char *format, ...) { va_list ap; diff --git a/hw/mips/fuloong2e.c b/hw/mips/fuloong2e.c index c1b8066a13b0..c9f14e70a077 100644 --- a/hw/mips/fuloong2e.c +++ b/hw/mips/fuloong2e.c @@ -72,7 +72,7 @@ static struct _loaderparams { const char *initrd_filename; } loaderparams; =20 -static void GCC_FMT_ATTR(3, 4) prom_set(uint32_t *prom_buf, int index, +static void G_GNUC_PRINTF(3, 4) prom_set(uint32_t *prom_buf, int index, const char *string, ...) { va_list ap; diff --git a/hw/mips/malta.c b/hw/mips/malta.c index b770b8d36718..4ea79f713b82 100644 --- a/hw/mips/malta.c +++ b/hw/mips/malta.c @@ -996,7 +996,7 @@ static void write_bootloader(uint8_t *base, uint64_t ru= n_addr, =20 } =20 -static void GCC_FMT_ATTR(3, 4) prom_set(uint32_t *prom_buf, int index, +static void G_GNUC_PRINTF(3, 4) prom_set(uint32_t *prom_buf, int index, const char *string, ...) { va_list ap; diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c index 90b4fc63ce64..6b65823b4bf8 100644 --- a/hw/net/rtl8139.c +++ b/hw/net/rtl8139.c @@ -86,7 +86,7 @@ # define DPRINTF(fmt, ...) \ do { fprintf(stderr, "RTL8139: " fmt, ## __VA_ARGS__); } while (0) #else -static inline GCC_FMT_ATTR(1, 2) int DPRINTF(const char *fmt, ...) +static inline G_GNUC_PRINTF(1, 2) int DPRINTF(const char *fmt, ...) { return 0; } diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 9e8f51dfb03b..89c261da0208 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -3580,7 +3580,7 @@ void virtio_device_set_child_bus_name(VirtIODevice *v= dev, char *bus_name) vdev->bus_name =3D g_strdup(bus_name); } =20 -void GCC_FMT_ATTR(2, 3) virtio_error(VirtIODevice *vdev, const char *fmt, = ...) +void G_GNUC_PRINTF(2, 3) virtio_error(VirtIODevice *vdev, const char *fmt,= ...) { va_list ap; =20 diff --git a/io/channel-websock.c b/io/channel-websock.c index 70889bb54da5..55145a6a8c5d 100644 --- a/io/channel-websock.c +++ b/io/channel-websock.c @@ -157,7 +157,7 @@ enum { QIO_CHANNEL_WEBSOCK_OPCODE_PONG =3D 0xA }; =20 -static void GCC_FMT_ATTR(2, 3) +static void G_GNUC_PRINTF(2, 3) qio_channel_websock_handshake_send_res(QIOChannelWebsock *ioc, const char *resmsg, ...) diff --git a/monitor/hmp.c b/monitor/hmp.c index b20737e63c3b..35827a843ddd 100644 --- a/monitor/hmp.c +++ b/monitor/hmp.c @@ -308,7 +308,7 @@ void help_cmd(Monitor *mon, const char *name) static const char *pch; static sigjmp_buf expr_env; =20 -static void GCC_FMT_ATTR(2, 3) QEMU_NORETURN +static void G_GNUC_PRINTF(2, 3) QEMU_NORETURN expr_error(Monitor *mon, const char *fmt, ...) { va_list ap; @@ -1445,7 +1445,7 @@ static void monitor_event(void *opaque, QEMUChrEvent = event) * These functions just adapt the readline interface in a typesafe way. We * could cast function pointers but that discards compiler checks. */ -static void GCC_FMT_ATTR(2, 3) monitor_readline_printf(void *opaque, +static void G_GNUC_PRINTF(2, 3) monitor_readline_printf(void *opaque, const char *fmt, ..= .) { MonitorHMP *mon =3D opaque; diff --git a/nbd/server.c b/nbd/server.c index 9fb2f264023e..eb20ddf072d3 100644 --- a/nbd/server.c +++ b/nbd/server.c @@ -212,7 +212,7 @@ static int nbd_negotiate_send_rep(NBDClient *client, ui= nt32_t type, =20 /* Send an error reply. * Return -errno on error, 0 on success. */ -static int GCC_FMT_ATTR(4, 0) +static int G_GNUC_PRINTF(4, 0) nbd_negotiate_send_rep_verr(NBDClient *client, uint32_t type, Error **errp, const char *fmt, va_list va) { @@ -252,7 +252,7 @@ nbd_sanitize_name(const char *name) =20 /* Send an error reply. * Return -errno on error, 0 on success. */ -static int GCC_FMT_ATTR(4, 5) +static int G_GNUC_PRINTF(4, 5) nbd_negotiate_send_rep_err(NBDClient *client, uint32_t type, Error **errp, const char *fmt, ...) { @@ -268,7 +268,7 @@ nbd_negotiate_send_rep_err(NBDClient *client, uint32_t = type, /* Drop remainder of the current option, and send a reply with the * given error type and message. Return -errno on read or write * failure; or 0 if connection is still live. */ -static int GCC_FMT_ATTR(4, 0) +static int G_GNUC_PRINTF(4, 0) nbd_opt_vdrop(NBDClient *client, uint32_t type, Error **errp, const char *fmt, va_list va) { @@ -281,7 +281,7 @@ nbd_opt_vdrop(NBDClient *client, uint32_t type, Error *= *errp, return ret; } =20 -static int GCC_FMT_ATTR(4, 5) +static int G_GNUC_PRINTF(4, 5) nbd_opt_drop(NBDClient *client, uint32_t type, Error **errp, const char *fmt, ...) { @@ -295,7 +295,7 @@ nbd_opt_drop(NBDClient *client, uint32_t type, Error **= errp, return ret; } =20 -static int GCC_FMT_ATTR(3, 4) +static int G_GNUC_PRINTF(3, 4) nbd_opt_invalid(NBDClient *client, Error **errp, const char *fmt, ...) { int ret; diff --git a/qemu-img.c b/qemu-img.c index 6fe2466032f9..30850bcf4610 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -98,7 +98,7 @@ static void format_print(void *opaque, const char *name) printf(" %s", name); } =20 -static void QEMU_NORETURN GCC_FMT_ATTR(1, 2) error_exit(const char *fmt, .= ..) +static void QEMU_NORETURN G_GNUC_PRINTF(1, 2) error_exit(const char *fmt, = ...) { va_list ap; =20 @@ -283,7 +283,7 @@ static QemuOptsList qemu_source_opts =3D { }, }; =20 -static int GCC_FMT_ATTR(2, 3) qprintf(bool quiet, const char *fmt, ...) +static int G_GNUC_PRINTF(2, 3) qprintf(bool quiet, const char *fmt, ...) { int ret =3D 0; if (!quiet) { diff --git a/qemu-io.c b/qemu-io.c index 3924639b92bd..e45a15c41aac 100644 --- a/qemu-io.c +++ b/qemu-io.c @@ -329,7 +329,7 @@ static char *get_prompt(void) return prompt; } =20 -static void GCC_FMT_ATTR(2, 3) readline_printf_func(void *opaque, +static void G_GNUC_PRINTF(2, 3) readline_printf_func(void *opaque, const char *fmt, ...) { va_list ap; diff --git a/qobject/json-parser.c b/qobject/json-parser.c index 008b326fb81a..d498db6e7027 100644 --- a/qobject/json-parser.c +++ b/qobject/json-parser.c @@ -54,7 +54,7 @@ static QObject *parse_value(JSONParserContext *ctxt); /** * Error handler */ -static void GCC_FMT_ATTR(3, 4) parse_error(JSONParserContext *ctxt, +static void G_GNUC_PRINTF(3, 4) parse_error(JSONParserContext *ctxt, JSONToken *token, const char *m= sg, ...) { va_list ap; diff --git a/softmmu/qtest.c b/softmmu/qtest.c index 72751e1fd8cd..56b331d5417f 100644 --- a/softmmu/qtest.c +++ b/softmmu/qtest.c @@ -287,7 +287,7 @@ static void qtest_send_prefix(CharBackend *chr) (long) tv.tv_sec, (long) tv.tv_usec); } =20 -static void GCC_FMT_ATTR(1, 2) qtest_log_send(const char *fmt, ...) +static void G_GNUC_PRINTF(1, 2) qtest_log_send(const char *fmt, ...) { va_list ap; =20 @@ -317,7 +317,7 @@ static void qtest_send(CharBackend *chr, const char *st= r) qtest_server_send(qtest_server_send_opaque, str); } =20 -static void GCC_FMT_ATTR(2, 3) qtest_sendf(CharBackend *chr, +static void G_GNUC_PRINTF(2, 3) qtest_sendf(CharBackend *chr, const char *fmt, ...) { va_list ap; diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c index 9dac018fcba0..dc5566ccfd60 100644 --- a/tests/qtest/libqtest.c +++ b/tests/qtest/libqtest.c @@ -437,7 +437,7 @@ static void qtest_client_socket_send(QTestState *s, con= st char *buf) socket_send(s->fd, buf, strlen(buf)); } =20 -static void GCC_FMT_ATTR(2, 3) qtest_sendf(QTestState *s, const char *fmt,= ...) +static void G_GNUC_PRINTF(2, 3) qtest_sendf(QTestState *s, const char *fmt= , ...) { va_list ap; =20 diff --git a/tests/unit/test-qobject-input-visitor.c b/tests/unit/test-qobj= ect-input-visitor.c index 6f59a7f43249..22538f814099 100644 --- a/tests/unit/test-qobject-input-visitor.c +++ b/tests/unit/test-qobject-input-visitor.c @@ -64,7 +64,7 @@ static Visitor *test_init_internal(TestInputVisitorData *= data, bool keyval, return data->qiv; } =20 -static GCC_FMT_ATTR(3, 4) +static G_GNUC_PRINTF(3, 4) Visitor *visitor_input_test_init_full(TestInputVisitorData *data, bool keyval, const char *json_string, ...) @@ -79,7 +79,7 @@ Visitor *visitor_input_test_init_full(TestInputVisitorDat= a *data, return v; } =20 -static GCC_FMT_ATTR(2, 3) +static G_GNUC_PRINTF(2, 3) Visitor *visitor_input_test_init(TestInputVisitorData *data, const char *json_string, ...) { diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index ddd8148d87e5..a07f0effb540 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -227,7 +227,7 @@ our $Attribute =3D qr{ QEMU_WARN_UNUSED_RESULT| QEMU_SENTINEL| QEMU_PACKED| - GCC_FMT_ATTR + G_GNUC_PRINTF }x; our $Modifier; our $Inline =3D qr{inline}; --=20 2.35.1.273.ge6ebfd0e8cbb