From nobody Wed May 22 02:46:12 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 1650549159624766.5026993428139; Thu, 21 Apr 2022 06:52:39 -0700 (PDT) Received: from localhost ([::1]:55372 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhXEc-0005Zj-EL for importer@patchew.org; Thu, 21 Apr 2022 09:52:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36328) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXBy-0002DB-VZ for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:49:55 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:22734) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXBx-0005j7-AM for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:49:54 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-438-O9bRcGDgPI6mPjfOikyZ1Q-1; Thu, 21 Apr 2022 09:49:49 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DF79D85A5BC; Thu, 21 Apr 2022 13:49:48 +0000 (UTC) Received: from localhost (unknown [10.39.208.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id AE1AC404D2E8; Thu, 21 Apr 2022 13:49:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650548992; 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=dhY1MzP4io1LAZWQGQs2zOX3/h/zmBAP63HhiFv8UG4=; b=DV1/ctD6qb1kq/bwPVbQTADwV0QY1BD68+VrWEWWs0mMDwXcl+OiZLx3qPMV8bFv3pN3DA 6eMpkaB8GOQvuA8DlNje7IsIhFwpKNd1kF0ltXrbO928qLtxaPPxFAY+ne8q0ccZyAjeBd iTDcbmYmhUYYjZCh9B5ldrG7XJmM4ys= X-MC-Unique: O9bRcGDgPI6mPjfOikyZ1Q-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PULL 01/30] glib-compat: isolate g_date_time_format_iso8601 version-bypass Date: Thu, 21 Apr 2022 17:49:11 +0400 Message-Id: <20220421134940.2887768-2-marcandre.lureau@redhat.com> In-Reply-To: <20220421134940.2887768-1-marcandre.lureau@redhat.com> References: <20220421134940.2887768-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , richard.henderson@linaro.org 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: 1650549160542100001 From: Marc-Andr=C3=A9 Lureau The solution was discussed with Markus Armbruster during the review: https://patchew.org/QEMU/20220323155743.1585078-1-marcandre.lureau@redhat.c= om/20220323155743.1585078-14-marcandre.lureau@redhat.com/ Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Daniel P. Berrang=C3=A9 Message-Id: <20220420132624.2439741-3-marcandre.lureau@redhat.com> --- include/glib-compat.h | 10 ---------- util/error-report.c | 6 +++++- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/include/glib-compat.h b/include/glib-compat.h index dc14d3ec0d1e..3113a7d2af84 100644 --- a/include/glib-compat.h +++ b/include/glib-compat.h @@ -145,16 +145,6 @@ qemu_g_test_slow(void) #define g_test_thorough() qemu_g_test_slow() #define g_test_quick() (!qemu_g_test_slow()) =20 -#if GLIB_CHECK_VERSION(2,62,0) -static inline gchar * -g_date_time_format_iso8601_compat(GDateTime *datetime) -{ - return g_date_time_format_iso8601(datetime); -} - -#define g_date_time_format_iso8601 g_date_time_format_iso8601_compat -#endif - #pragma GCC diagnostic pop =20 #endif diff --git a/util/error-report.c b/util/error-report.c index d9d3ac30cfab..4ec7b30bcbcc 100644 --- a/util/error-report.c +++ b/util/error-report.c @@ -183,9 +183,13 @@ static void print_loc(void) static char * real_time_iso8601(void) { -#if GLIB_CHECK_VERSION(2, 62, 0) +#if GLIB_CHECK_VERSION(2,62,0) g_autoptr(GDateTime) dt =3D g_date_time_new_from_unix_utc(g_get_real_t= ime()); + /* ignore deprecation warning, since GLIB_VERSION_MAX_ALLOWED is 2.56 = */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" return g_date_time_format_iso8601(dt); +#pragma GCC diagnostic pop #else GTimeVal tv; g_get_current_time(&tv); --=20 2.36.0 From nobody Wed May 22 02:46:12 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 165054916293890.23708687921487; Thu, 21 Apr 2022 06:52:42 -0700 (PDT) Received: from localhost ([::1]:55672 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhXEf-0005lo-V0 for importer@patchew.org; Thu, 21 Apr 2022 09:52:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36344) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXC4-0002LR-GX for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:50:01 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:31230) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXC1-0005k2-Q2 for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:49:59 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-523-VpkqKad-MAi6camNET70Lg-1; Thu, 21 Apr 2022 09:49:53 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 976791C0E0E5; Thu, 21 Apr 2022 13:49:53 +0000 (UTC) Received: from localhost (unknown [10.39.208.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id 939D7145BA52; Thu, 21 Apr 2022 13:49:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650548997; 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=rc6IT/fXlRgD+JPRsqm1Q44yPKB5H1QzLG2ISYV77Z0=; b=M8ItE3B0YxBDIPXwceK8zMVH4FZe1xtj5Zf49fbxz2YB651s9vxNmHfBhVBYzIr7NtmC3L o0cm0mjyDofgOnSt/APAyN5mLDo7a5y0daYnxJ37GDtiVEFTDWFLmTUV03OMaDTNpDrJfU gFZhMjE5EjFNt5nQgqnJa6ZZh+EJiwI= X-MC-Unique: VpkqKad-MAi6camNET70Lg-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PULL 02/30] scripts/analyze-inclusions: drop qemu-common.h from analysis Date: Thu, 21 Apr 2022 17:49:12 +0400 Message-Id: <20220421134940.2887768-3-marcandre.lureau@redhat.com> In-Reply-To: <20220421134940.2887768-1-marcandre.lureau@redhat.com> References: <20220421134940.2887768-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , richard.henderson@linaro.org 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: 1650549164419100001 From: Marc-Andr=C3=A9 Lureau The header is no longer commonly included. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Daniel P. Berrang=C3=A9 Message-Id: <20220420132624.2439741-4-marcandre.lureau@redhat.com> --- scripts/analyze-inclusions | 4 ---- 1 file changed, 4 deletions(-) diff --git a/scripts/analyze-inclusions b/scripts/analyze-inclusions index 14806e18c6e1..45c821de32b3 100644 --- a/scripts/analyze-inclusions +++ b/scripts/analyze-inclusions @@ -46,7 +46,6 @@ grep_include() { } =20 echo Found $(find . -name "*.d" | wc -l) object files -echo $(grep_include -F 'include/qemu-common.h') files include qemu-common.h echo $(grep_include -F 'hw/hw.h') files include hw/hw.h echo $(grep_include 'target/[a-z0-9]*/cpu\.h') files include cpu.h echo $(grep_include -F 'qapi-types.h') files include qapi-types.h @@ -86,9 +85,6 @@ analyze() { echo osdep.h: analyze ../include/qemu/osdep.h =20 -echo qemu-common.h: -analyze -include ../include/qemu/osdep.h ../include/qemu-common.h - echo hw/hw.h: analyze -include ../include/qemu/osdep.h ../include/hw/hw.h =20 --=20 2.36.0 From nobody Wed May 22 02:46:12 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 1650549368944238.83271534449557; Thu, 21 Apr 2022 06:56:08 -0700 (PDT) Received: from localhost ([::1]:38660 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhXHz-0005Pr-T6 for importer@patchew.org; Thu, 21 Apr 2022 09:56:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36366) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXC5-0002M4-IR for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:50:02 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:20323) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXC3-0005kh-TX for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:50:01 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-663-xnJPbSxLOeOrQGXAIOquxg-1; Thu, 21 Apr 2022 09:49:58 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 93D6D1014A63; Thu, 21 Apr 2022 13:49:57 +0000 (UTC) Received: from localhost (unknown [10.39.208.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id C189357233C; Thu, 21 Apr 2022 13:49:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650548999; 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=6v6jDJ+XZxNcbHmeAT2FvQGZW2TxMf3PLFKAjVyAxGs=; b=ii1thkGISHeNHE3Rno1c0ldfqsZi8azSAlz25mCGNO1mhsKgIAnC8u+VsU5QaxA09KHJVw za+yPYS1wXkDpub1QFr986qZsxXT+YZKeKr6CjSDA7EsK28wVrc3Az+5HvEJJtSY4wzXDd I+pUID1zOF0V/lQw5ESOJjCtcKmsXQo= X-MC-Unique: xnJPbSxLOeOrQGXAIOquxg-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PULL 03/30] Simplify softmmu/main.c Date: Thu, 21 Apr 2022 17:49:13 +0400 Message-Id: <20220421134940.2887768-4-marcandre.lureau@redhat.com> In-Reply-To: <20220421134940.2887768-1-marcandre.lureau@redhat.com> References: <20220421134940.2887768-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 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, 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 , richard.henderson@linaro.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gerd Hoffmann , Akihiko Odaki , Paolo Bonzini , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= 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: 1650549370401100001 From: Marc-Andr=C3=A9 Lureau Move qemu_main() declaration to a new header. Simplify main.c since both cocoa & sdl cannot be enabled together. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Akihiko Odaki Reviewed-by: Daniel P. Berrang=C3=A9 Message-Id: <20220420132624.2439741-5-marcandre.lureau@redhat.com> --- include/qemu-common.h | 5 ----- include/qemu-main.h | 10 ++++++++++ softmmu/main.c | 25 +++++++++---------------- ui/cocoa.m | 1 + 4 files changed, 20 insertions(+), 21 deletions(-) create mode 100644 include/qemu-main.h diff --git a/include/qemu-common.h b/include/qemu-common.h index a923ed28d5bf..ba32cc8b1f39 100644 --- a/include/qemu-common.h +++ b/include/qemu-common.h @@ -10,9 +10,4 @@ "See for how to report bugs= .\n" \ "More information on the QEMU project at ." =20 -/* main function, renamed */ -#if defined(CONFIG_COCOA) -int qemu_main(int argc, char **argv, char **envp); -#endif - #endif diff --git a/include/qemu-main.h b/include/qemu-main.h new file mode 100644 index 000000000000..6a3e90d0ad59 --- /dev/null +++ b/include/qemu-main.h @@ -0,0 +1,10 @@ +/* + * This work is licensed under the terms of the GNU GPL, version 2 or late= r. + * See the COPYING file in the top-level directory. + */ +#ifndef QEMU_MAIN_H +#define QEMU_MAIN_H + +int qemu_main(int argc, char **argv, char **envp); + +#endif /* QEMU_MAIN_H */ diff --git a/softmmu/main.c b/softmmu/main.c index 639c67ff4893..c00432ff098e 100644 --- a/softmmu/main.c +++ b/softmmu/main.c @@ -23,28 +23,14 @@ */ =20 #include "qemu/osdep.h" -#include "qemu-common.h" +#include "qemu-main.h" #include "sysemu/sysemu.h" =20 #ifdef CONFIG_SDL -#if defined(__APPLE__) || defined(main) #include -static int qemu_main(int argc, char **argv, char **envp); -int main(int argc, char **argv) -{ - return qemu_main(argc, argv, NULL); -} -#undef main -#define main qemu_main #endif -#endif /* CONFIG_SDL */ - -#ifdef CONFIG_COCOA -#undef main -#define main qemu_main -#endif /* CONFIG_COCOA */ =20 -int main(int argc, char **argv, char **envp) +int qemu_main(int argc, char **argv, char **envp) { qemu_init(argc, argv, envp); qemu_main_loop(); @@ -52,3 +38,10 @@ int main(int argc, char **argv, char **envp) =20 return 0; } + +#ifndef CONFIG_COCOA +int main(int argc, char **argv) +{ + return qemu_main(argc, argv, NULL); +} +#endif diff --git a/ui/cocoa.m b/ui/cocoa.m index c4e5468f9e64..839ae4f58a69 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -28,6 +28,7 @@ #include =20 #include "qemu-common.h" +#include "qemu-main.h" #include "ui/clipboard.h" #include "ui/console.h" #include "ui/input.h" --=20 2.36.0 From nobody Wed May 22 02:46:12 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 1650549655939587.5314915467967; Thu, 21 Apr 2022 07:00:55 -0700 (PDT) Received: from localhost ([::1]:47044 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhXMY-0002uN-JN for importer@patchew.org; Thu, 21 Apr 2022 10:00:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36406) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXCB-0002PM-0g for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:50:11 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:43543) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXC8-0005wX-SP for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:50:06 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-501-CObsP1s7Oami68fOZTk-Hg-1; Thu, 21 Apr 2022 09:50:02 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 51B2A811E81; Thu, 21 Apr 2022 13:50:02 +0000 (UTC) Received: from localhost (unknown [10.39.208.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id 359C04C479E; Thu, 21 Apr 2022 13:50:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650549004; 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=1ME3s7K/U0I7+XGawuJeIabNvzoG3bczmNZKRgAQa0w=; b=Dn7o08oF5fxPbk71M+ICBQYLxYoV2p3KaNUuxrzKp3vHlVk+FF4CbJI0RzsWmGxz/jDLhR nKeiwdf7ux3B4vJ7OfNx3m++EQRN1DtoXwfP8IX6IYYz7FhfwIjKXCEU4bdC/tbCmvh7LD Ax8L4x3XP2agUK56/3uL6v4sSjHCdaw= X-MC-Unique: CObsP1s7Oami68fOZTk-Hg-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PULL 04/30] hw/hyperv: remove needless qemu-common.h include Date: Thu, 21 Apr 2022 17:49:14 +0400 Message-Id: <20220421134940.2887768-5-marcandre.lureau@redhat.com> In-Reply-To: <20220421134940.2887768-1-marcandre.lureau@redhat.com> References: <20220421134940.2887768-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , richard.henderson@linaro.org 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: 1650549658086100001 From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Daniel P. Berrang=C3=A9 Message-Id: <20220420132624.2439741-6-marcandre.lureau@redhat.com> --- hw/hyperv/syndbg.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/hyperv/syndbg.c b/hw/hyperv/syndbg.c index 89ae19b9aab6..ebb8a29f7838 100644 --- a/hw/hyperv/syndbg.c +++ b/hw/hyperv/syndbg.c @@ -10,7 +10,6 @@ #include "qemu/error-report.h" #include "qemu/main-loop.h" #include "qemu/sockets.h" -#include "qemu-common.h" #include "qapi/error.h" #include "migration/vmstate.h" #include "hw/qdev-properties.h" --=20 2.36.0 From nobody Wed May 22 02:46:12 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 1650549383908958.0731934045009; Thu, 21 Apr 2022 06:56:23 -0700 (PDT) Received: from localhost ([::1]:38876 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhXIE-0005Zl-5v for importer@patchew.org; Thu, 21 Apr 2022 09:56:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36462) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXCF-0002PU-LK for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:50:12 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:27952) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXCD-0005xZ-TN for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:50:11 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-475-Lf_mhocuOVK9wlAHKmYmcg-1; Thu, 21 Apr 2022 09:50:07 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DA174833968; Thu, 21 Apr 2022 13:50:06 +0000 (UTC) Received: from localhost (unknown [10.39.208.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7D28057233C; Thu, 21 Apr 2022 13:50:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650549009; 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=uz9rYuIbm2e/lL/JR324bAfTr/8Tj+ns6X88klfTiM4=; b=HnPcS7Ec3vZgcq6lpMhtOJJxUnvYZd60Ift/Zfzi4D5Jrw7tZr+Y1XlcDBi3yEae/Eg1mf ria8z7Bn9M9cMfdC2Ff4RS9cXdcbyaU79QbxFXoctGnEy8sDUBMbeiMZ1g+0JExhSgNwno DDFRlRr2V7weNht6SUoeT85tkQlJ3Kc= X-MC-Unique: Lf_mhocuOVK9wlAHKmYmcg-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PULL 05/30] include: rename qemu-common.h qemu/help-texts.h Date: Thu, 21 Apr 2022 17:49:15 +0400 Message-Id: <20220421134940.2887768-6-marcandre.lureau@redhat.com> In-Reply-To: <20220421134940.2887768-1-marcandre.lureau@redhat.com> References: <20220421134940.2887768-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 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, 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: Kevin Wolf , Fam Zheng , Vladimir Sementsov-Ogievskiy , Akihiko Odaki , "open list:Block layer core" , Peter Maydell , Kyle Evans , richard.henderson@linaro.org, Laurent Vivier , "Dr. David Alan Gilbert" , "open list:virtiofs" , Hanna Reitz , Paolo Bonzini , Gerd Hoffmann , Stefan Hajnoczi , Michael Roth , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Eric Blake , Warner Losh , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= 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: 1650549384681100001 From: Marc-Andr=C3=A9 Lureau Suggested-by: Peter Maydell Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Warner Losh Message-Id: <20220420132624.2439741-7-marcandre.lureau@redhat.com> --- include/{qemu-common.h =3D> qemu/help-texts.h} | 0 bsd-user/main.c | 2 +- linux-user/main.c | 2 +- qemu-img.c | 2 +- qemu-io.c | 2 +- qemu-nbd.c | 2 +- qga/main.c | 2 +- scsi/qemu-pr-helper.c | 2 +- softmmu/vl.c | 2 +- storage-daemon/qemu-storage-daemon.c | 2 +- tools/virtiofsd/passthrough_ll.c | 2 +- ui/cocoa.m | 2 +- 12 files changed, 11 insertions(+), 11 deletions(-) rename include/{qemu-common.h =3D> qemu/help-texts.h} (100%) diff --git a/include/qemu-common.h b/include/qemu/help-texts.h similarity index 100% rename from include/qemu-common.h rename to include/qemu/help-texts.h diff --git a/bsd-user/main.c b/bsd-user/main.c index 74f2d35a5497..6f09180d6541 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -24,7 +24,7 @@ #include =20 #include "qemu/osdep.h" -#include "qemu-common.h" +#include "qemu/help-texts.h" #include "qemu/units.h" #include "qemu/accel.h" #include "qemu-version.h" diff --git a/linux-user/main.c b/linux-user/main.c index 5fb6ecac3f86..7ca48664e447 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -18,7 +18,7 @@ */ =20 #include "qemu/osdep.h" -#include "qemu-common.h" +#include "qemu/help-texts.h" #include "qemu/units.h" #include "qemu/accel.h" #include "qemu-version.h" diff --git a/qemu-img.c b/qemu-img.c index ef3224a9d4a8..6337a63b3b80 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -25,7 +25,7 @@ #include "qemu/osdep.h" #include =20 -#include "qemu-common.h" +#include "qemu/help-texts.h" #include "qemu/qemu-progress.h" #include "qemu-version.h" #include "qapi/error.h" diff --git a/qemu-io.c b/qemu-io.c index 38321a27a301..d70d3dd4fde5 100644 --- a/qemu-io.c +++ b/qemu-io.c @@ -15,7 +15,7 @@ #include #endif =20 -#include "qemu-common.h" +#include "qemu/help-texts.h" #include "qapi/error.h" #include "qemu-io.h" #include "qemu/error-report.h" diff --git a/qemu-nbd.c b/qemu-nbd.c index bf9c5fedceba..397ffa64d768 100644 --- a/qemu-nbd.c +++ b/qemu-nbd.c @@ -21,7 +21,7 @@ #include #include =20 -#include "qemu-common.h" +#include "qemu/help-texts.h" #include "qapi/error.h" #include "qemu/cutils.h" #include "sysemu/block-backend.h" diff --git a/qga/main.c b/qga/main.c index 1deb0ee2fbfe..e4b22df01dcd 100644 --- a/qga/main.c +++ b/qga/main.c @@ -18,7 +18,7 @@ #include #include #endif -#include "qemu-common.h" +#include "qemu/help-texts.h" #include "qapi/qmp/json-parser.h" #include "qapi/qmp/qdict.h" #include "qapi/qmp/qjson.h" diff --git a/scsi/qemu-pr-helper.c b/scsi/qemu-pr-helper.c index 1f2a84c53454..df493e2a503e 100644 --- a/scsi/qemu-pr-helper.c +++ b/scsi/qemu-pr-helper.c @@ -36,7 +36,7 @@ #include #endif =20 -#include "qemu-common.h" +#include "qemu/help-texts.h" #include "qapi/error.h" #include "qemu/cutils.h" #include "qemu/main-loop.h" diff --git a/softmmu/vl.c b/softmmu/vl.c index f679d48d7415..2a38ebe5fbb4 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -23,7 +23,7 @@ */ =20 #include "qemu/osdep.h" -#include "qemu-common.h" +#include "qemu/help-texts.h" #include "qemu/datadir.h" #include "qemu/units.h" #include "exec/cpu-common.h" diff --git a/storage-daemon/qemu-storage-daemon.c b/storage-daemon/qemu-sto= rage-daemon.c index 1398f0443d76..9b8b17f52e48 100644 --- a/storage-daemon/qemu-storage-daemon.c +++ b/storage-daemon/qemu-storage-daemon.c @@ -42,7 +42,7 @@ #include "qapi/qmp/qstring.h" #include "qapi/qobject-input-visitor.h" =20 -#include "qemu-common.h" +#include "qemu/help-texts.h" #include "qemu-version.h" #include "qemu/config-file.h" #include "qemu/error-report.h" diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough= _ll.c index 028dacdd8f5a..b15c631ca512 100644 --- a/tools/virtiofsd/passthrough_ll.c +++ b/tools/virtiofsd/passthrough_ll.c @@ -38,7 +38,7 @@ #include "qemu/osdep.h" #include "qemu/timer.h" #include "qemu-version.h" -#include "qemu-common.h" +#include "qemu/help-texts.h" #include "fuse_virtio.h" #include "fuse_log.h" #include "fuse_lowlevel.h" diff --git a/ui/cocoa.m b/ui/cocoa.m index 839ae4f58a69..68bff4ff3796 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -27,7 +27,7 @@ #import #include =20 -#include "qemu-common.h" +#include "qemu/help-texts.h" #include "qemu-main.h" #include "ui/clipboard.h" #include "ui/console.h" --=20 2.36.0 From nobody Wed May 22 02:46:12 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 1650549866982408.8244644782045; Thu, 21 Apr 2022 07:04:26 -0700 (PDT) Received: from localhost ([::1]:55776 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhXQ0-0000Wy-GM for importer@patchew.org; Thu, 21 Apr 2022 10:04:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36530) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXCP-0002av-I8 for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:50:22 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:49190) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXCM-0005yV-2z for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:50:21 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-302-ZHMaiUMbNoCJ8AQuZ2WRWg-1; Thu, 21 Apr 2022 09:50:11 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 52758185A7A4; Thu, 21 Apr 2022 13:50:11 +0000 (UTC) Received: from localhost (unknown [10.39.208.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id 725364C479E; Thu, 21 Apr 2022 13:50:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650549017; 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=1Jd4/acIDpinD0Wv7bbyD561EBTadwiPne+twrLLQ8A=; b=KIx+Av5jX/qD1EipbAUcZ7xoDq3bQ/4AXH90cI9gP2Wnd0R5OpDP6eTeWjknAYucR489oG 5DE85SiaXT0RrEDzpFpgM5KD+ykSfVYpH8d0/IqAHmSNaIUk/1YR1XZrYbXqEuPzoxMU0G /inDHilAxq698tEE+Had5XNyBkVlURI= X-MC-Unique: ZHMaiUMbNoCJ8AQuZ2WRWg-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PULL 06/30] qga: replace usleep() with g_usleep() Date: Thu, 21 Apr 2022 17:49:16 +0400 Message-Id: <20220421134940.2887768-7-marcandre.lureau@redhat.com> In-Reply-To: <20220421134940.2887768-1-marcandre.lureau@redhat.com> References: <20220421134940.2887768-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , richard.henderson@linaro.org, Michael Roth 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: 1650549868921100001 From: Marc-Andr=C3=A9 Lureau The latter simply requires glib.h, while the former is not in the Windows API (but provided by mingw header & CRT) Also simplify the expression for 1/10s. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Daniel P. Berrang=C3=A9 Message-Id: <20220420132624.2439741-12-marcandre.lureau@redhat.com> --- qga/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qga/main.c b/qga/main.c index e4b22df01dcd..aa00ad8fabdf 100644 --- a/qga/main.c +++ b/qga/main.c @@ -610,7 +610,7 @@ static gboolean channel_event_cb(GIOCondition condition= , gpointer data) * host-side chardev. sleep a bit to mitigate this */ if (s->virtio) { - usleep(100 * 1000); + g_usleep(G_USEC_PER_SEC / 10); } return true; default: --=20 2.36.0 From nobody Wed May 22 02:46:12 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 16505493442931001.5794993212264; Thu, 21 Apr 2022 06:55:44 -0700 (PDT) Received: from localhost ([::1]:36916 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhXHb-00046G-5b for importer@patchew.org; Thu, 21 Apr 2022 09:55:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36570) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXCR-0002cS-Sw for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:50:24 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:28479) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXCQ-0005zD-Da for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:50:23 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-440-yWALMDOoO_O4Gro_P73oMw-1; Thu, 21 Apr 2022 09:50:15 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4E5C1811E76; Thu, 21 Apr 2022 13:50:15 +0000 (UTC) Received: from localhost (unknown [10.39.208.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id 77BC8C28129; Thu, 21 Apr 2022 13:50:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650549021; 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=Z967ZwNDJEOuSN6Ver2MUmx5cBNheGAbnJa3zQtevWg=; b=IUgBefbQp3ZsmKe8qVnjX6K9nYAYn7SkV0bDYoyI0Rdf5qQNfghrTECyGjPsL6lGtGEdyt /SeEhLIYUKMiKmWLKR7rdkAAnENpuoU38eNQJkRibrQarwQ7L08mBZIIyh8ReIM1quy1At 4FDAIyCz8b/a0loWU5MoRuGDSfu52ic= X-MC-Unique: yWALMDOoO_O4Gro_P73oMw-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PULL 07/30] docs: trace-events-all is installed without renaming Date: Thu, 21 Apr 2022 17:49:17 +0400 Message-Id: <20220421134940.2887768-8-marcandre.lureau@redhat.com> In-Reply-To: <20220421134940.2887768-1-marcandre.lureau@redhat.com> References: <20220421134940.2887768-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , richard.henderson@linaro.org, Stefan Hajnoczi 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: 1650549346268100001 From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Daniel P. Berrang=C3=A9 Message-Id: <20220420132624.2439741-13-marcandre.lureau@redhat.com> --- docs/devel/tracing.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/devel/tracing.rst b/docs/devel/tracing.rst index ec9a687cfdc9..d288480db11f 100644 --- a/docs/devel/tracing.rst +++ b/docs/devel/tracing.rst @@ -48,7 +48,7 @@ file. During build, the "trace-events" file in each liste= d subdirectory will be processed by the "tracetool" script to generate code for the trace events. =20 The individual "trace-events" files are merged into a "trace-events-all" f= ile, -which is also installed into "/usr/share/qemu" with the name "trace-events= ". +which is also installed into "/usr/share/qemu". This merged file is to be used by the "simpletrace.py" script to later ana= lyse traces in the simpletrace data format. =20 --=20 2.36.0 From nobody Wed May 22 02:46:12 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 1650550098737350.2344858202955; Thu, 21 Apr 2022 07:08:18 -0700 (PDT) Received: from localhost ([::1]:35998 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhXTl-0006Sn-J5 for importer@patchew.org; Thu, 21 Apr 2022 10:08:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36566) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXCR-0002cR-OE for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:50:24 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:23766) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXCQ-0005z9-AH for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:50:23 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-150-cGjG5ng8NPe1Ngabq8iQhw-1; Thu, 21 Apr 2022 09:50:20 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CC26C85A5BE; Thu, 21 Apr 2022 13:50:19 +0000 (UTC) Received: from localhost (unknown [10.39.208.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0126A145B99C; Thu, 21 Apr 2022 13:50:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650549021; 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=dRsFK91bi/ARhkoGWMMbjS3alRaIXl3VJNiCxhocyjE=; b=i2qM0O75e1JNKrVokvkVDuG70Lt2NSy6XpDpQT98cFHiB5EKT5B6Umu6NZc/LVdRgaBRqQ oMBt1HYpahC9IaNOlolNBmasOA/w5GYhEOO5F3KjUNfEwx5vY73A578wEfr8wqIwcgEVba 9mUgoMGvVysIeLdDiqvELUejCDqJ4sE= X-MC-Unique: cGjG5ng8NPe1Ngabq8iQhw-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PULL 08/30] arm/digic: replace snprintf() with g_strdup_printf() Date: Thu, 21 Apr 2022 17:49:18 +0400 Message-Id: <20220421134940.2887768-9-marcandre.lureau@redhat.com> In-Reply-To: <20220421134940.2887768-1-marcandre.lureau@redhat.com> References: <20220421134940.2887768-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , "open list:Canon DIGIC" , richard.henderson@linaro.org, Antony Pavlov , Peter Maydell 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: 1650550100287100001 From: Marc-Andr=C3=A9 Lureau Also fixes a GCC 12.0.1 false-positive: ../hw/arm/digic.c: In function =E2=80=98digic_init=E2=80=99: ../hw/arm/digic.c:45:54: error: =E2=80=98%d=E2=80=99 directive output may b= e truncated writing between 1 and 11 bytes into a region of size 5 [-Werror= =3Dformat-truncation=3D] 45 | snprintf(name, DIGIC_TIMER_NAME_MLEN, "timer[%d]", i); | ^~ Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Peter Maydell Reviewed-by: Daniel P. Berrang=C3=A9 Message-Id: <20220420132624.2439741-14-marcandre.lureau@redhat.com> --- hw/arm/digic.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/hw/arm/digic.c b/hw/arm/digic.c index 614232165cdc..6df554797734 100644 --- a/hw/arm/digic.c +++ b/hw/arm/digic.c @@ -39,10 +39,7 @@ static void digic_init(Object *obj) object_initialize_child(obj, "cpu", &s->cpu, ARM_CPU_TYPE_NAME("arm946= ")); =20 for (i =3D 0; i < DIGIC4_NB_TIMERS; i++) { -#define DIGIC_TIMER_NAME_MLEN 11 - char name[DIGIC_TIMER_NAME_MLEN]; - - snprintf(name, DIGIC_TIMER_NAME_MLEN, "timer[%d]", i); + g_autofree char *name =3D g_strdup_printf("timer[%d]", i); object_initialize_child(obj, name, &s->timer[i], TYPE_DIGIC_TIMER); } =20 --=20 2.36.0 From nobody Wed May 22 02:46:12 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 1650549173918894.0830142934219; Thu, 21 Apr 2022 06:52:53 -0700 (PDT) Received: from localhost ([::1]:56586 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhXEq-0006OU-PC for importer@patchew.org; Thu, 21 Apr 2022 09:52:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36684) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXCi-00032D-8s for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:50:40 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:29980) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXCf-00066V-PQ for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:50:40 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-245-y7SOFaFjM2CuDBBgo4ikDQ-1; Thu, 21 Apr 2022 09:50:33 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 711613C37F24; Thu, 21 Apr 2022 13:50:33 +0000 (UTC) Received: from localhost (unknown [10.39.208.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id F28F09D46; Thu, 21 Apr 2022 13:50:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650549037; 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=VW2WuG4lnR4Kxa/wGkb3wXczkUMY9GdPr7caoZt/VsY=; b=cbrvKaVHYXqJZlma3xcYTLKn+E+bq20d5R6bQNMMGxMzyhzgWnJ57dUlyDukVwNy2hziA4 /f0Dn4awgYf5SyANkO68GJDK8APKKAL5bFF/zBmked4CIfwxrUKsmx2E9fXw4YRdXb8CLE O2qwUkLmbF9lYdLlLkuo/mcwBv1eJ18= X-MC-Unique: y7SOFaFjM2CuDBBgo4ikDQ-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PULL 09/30] arm/allwinner-a10: replace snprintf() with g_strdup_printf() Date: Thu, 21 Apr 2022 17:49:19 +0400 Message-Id: <20220421134940.2887768-10-marcandre.lureau@redhat.com> In-Reply-To: <20220421134940.2887768-1-marcandre.lureau@redhat.com> References: <20220421134940.2887768-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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: Beniamino Galvani , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , "open list:Allwinner-a10" , richard.henderson@linaro.org, Peter Maydell 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: 1650549174580100001 From: Marc-Andr=C3=A9 Lureau Also fixes a GCC 12.0.1 false-positive: ../hw/arm/allwinner-a10.c: In function =E2=80=98aw_a10_realize=E2=80=99: ../hw/arm/allwinner-a10.c:135:35: error: =E2=80=98%d=E2=80=99 directive wri= ting between 1 and 11 bytes into a region of size 8 [-Werror=3Dformat-overf= low=3D] 135 | sprintf(bus, "usb-bus.%d", i); | ^~ Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Peter Maydell Reviewed-by: Daniel P. Berrang=C3=A9 Message-Id: <20220420132624.2439741-15-marcandre.lureau@redhat.com> --- hw/arm/allwinner-a10.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/arm/allwinner-a10.c b/hw/arm/allwinner-a10.c index 05e84728cb34..79082289ea5b 100644 --- a/hw/arm/allwinner-a10.c +++ b/hw/arm/allwinner-a10.c @@ -130,9 +130,7 @@ static void aw_a10_realize(DeviceState *dev, Error **er= rp) int i; =20 for (i =3D 0; i < AW_A10_NUM_USB; i++) { - char bus[16]; - - sprintf(bus, "usb-bus.%d", i); + g_autofree char *bus =3D g_strdup_printf("usb-bus.%d", i); =20 object_property_set_bool(OBJECT(&s->ehci[i]), "companion-enabl= e", true, &error_fatal); --=20 2.36.0 From nobody Wed May 22 02:46:12 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 1650549662444102.99349189113173; Thu, 21 Apr 2022 07:01:02 -0700 (PDT) Received: from localhost ([::1]:47470 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhXMj-0003C4-1T for importer@patchew.org; Thu, 21 Apr 2022 10:01:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36728) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXCm-0003EJ-II for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:50:44 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:26873) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXCk-00067d-GX for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:50:44 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-416-GvQBTdeZMniUSolwQgP6PA-1; Thu, 21 Apr 2022 09:50:38 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B716E80159B; Thu, 21 Apr 2022 13:50:37 +0000 (UTC) Received: from localhost (unknown [10.39.208.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id D034D145B99C; Thu, 21 Apr 2022 13:50:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650549041; 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=tG6e3wxrRfYTP/3XF750OQ7rTUwvynv/Ev+Pj/rZzLA=; b=JsH5ZkZspWRSMK1PRho1LhLk+s+3rm8lQXVD7UBfwfNmBHFmkDt4cStnAHqPDbCn3aHJdR vFggEcd4QyCQ3KQLcESsUPtKhihSqncCkc+cGOi9RBM0p+Vv1TPkFiVGTk+F7MzEFzmhPP Qd/r/sZWSsnTVLF+kaygeuRipfAy7Uk= X-MC-Unique: GvQBTdeZMniUSolwQgP6PA-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PULL 10/30] intc/exynos4210_gic: replace snprintf() with g_strdup_printf() Date: Thu, 21 Apr 2022 17:49:20 +0400 Message-Id: <20220421134940.2887768-11-marcandre.lureau@redhat.com> In-Reply-To: <20220421134940.2887768-1-marcandre.lureau@redhat.com> References: <20220421134940.2887768-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 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, 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: Igor Mitsyanko , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , "open list:Exynos" , richard.henderson@linaro.org, Peter Maydell 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: 1650549664074100001 From: Marc-Andr=C3=A9 Lureau While at it, replace '%x' with '%u' as suggested by Philippe Mathieu-Daud= =C3=A9. Also fixes a GCC 12.0.1 -Wformat-overflow false-positive. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Peter Maydell Reviewed-by: Daniel P. Berrang=C3=A9 Message-Id: <20220420132624.2439741-16-marcandre.lureau@redhat.com> --- hw/intc/exynos4210_gic.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/hw/intc/exynos4210_gic.c b/hw/intc/exynos4210_gic.c index bc73d1f11524..f8dd719caa1e 100644 --- a/hw/intc/exynos4210_gic.c +++ b/hw/intc/exynos4210_gic.c @@ -289,10 +289,6 @@ static void exynos4210_gic_realize(DeviceState *dev, E= rror **errp) Object *obj =3D OBJECT(dev); Exynos4210GicState *s =3D EXYNOS4210_GIC(obj); SysBusDevice *sbd =3D SYS_BUS_DEVICE(obj); - const char cpu_prefix[] =3D "exynos4210-gic-alias_cpu"; - const char dist_prefix[] =3D "exynos4210-gic-alias_dist"; - char cpu_alias_name[sizeof(cpu_prefix) + 3]; - char dist_alias_name[sizeof(cpu_prefix) + 3]; SysBusDevice *gicbusdev; uint32_t n =3D s->num_cpu; uint32_t i; @@ -322,8 +318,10 @@ static void exynos4210_gic_realize(DeviceState *dev, E= rror **errp) */ assert(n <=3D EXYNOS4210_NCPUS); for (i =3D 0; i < n; i++) { + g_autofree char *cpu_alias_name =3D g_strdup_printf("exynos4210-gi= c-alias_cpu%u", i); + g_autofree char *dist_alias_name =3D g_strdup_printf("exynos4210-g= ic-alias_dist%u", i); + /* Map CPU interface per SMP Core */ - sprintf(cpu_alias_name, "%s%x", cpu_prefix, i); memory_region_init_alias(&s->cpu_alias[i], obj, cpu_alias_name, sysbus_mmio_get_region(gicbusdev, 1), @@ -333,7 +331,6 @@ static void exynos4210_gic_realize(DeviceState *dev, Er= ror **errp) EXYNOS4210_EXT_GIC_CPU_GET_OFFSET(i), &s->cpu_alias[i]); =20 /* Map Distributor per SMP Core */ - sprintf(dist_alias_name, "%s%x", dist_prefix, i); memory_region_init_alias(&s->dist_alias[i], obj, dist_alias_name, sysbus_mmio_get_region(gicbusdev, 0), --=20 2.36.0 From nobody Wed May 22 02:46:12 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 1650550310454789.3971184939168; Thu, 21 Apr 2022 07:11:50 -0700 (PDT) Received: from localhost ([::1]:44780 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhXXB-0004K5-Et for importer@patchew.org; Thu, 21 Apr 2022 10:11:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36752) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXCq-0003OU-IV for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:50:48 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:51382) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXCm-00067x-Ea for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:50:48 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-383-PoWSiODlM-GNL7LBun30-w-1; Thu, 21 Apr 2022 09:50:42 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 40A01800B28; Thu, 21 Apr 2022 13:50:42 +0000 (UTC) Received: from localhost (unknown [10.39.208.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6C99040C1438; Thu, 21 Apr 2022 13:50:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650549043; 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=t0zoJv+PiWjE/Irw2HqIN9ZMQJrGOq4C5YqVc9ZLJT4=; b=ChZLjjSY5HFzyLX0ifKdtiAjCzVm0uypgxDFEzElCJaHVDxrCwxBmGWzNvnk2ndGdV9f+R ZgQeSc17QdKYR/WuIvXOHbe69mA3oEGAgWLdA8hveRr+jg3m5kUA4F2D4BiCWJQLgEgV3O fj+M54ToSsgdUZGzxml1NDurx3PC8ZY= X-MC-Unique: PoWSiODlM-GNL7LBun30-w-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PULL 11/30] doc/style: CLang -> Clang Date: Thu, 21 Apr 2022 17:49:21 +0400 Message-Id: <20220421134940.2887768-12-marcandre.lureau@redhat.com> In-Reply-To: <20220421134940.2887768-1-marcandre.lureau@redhat.com> References: <20220421134940.2887768-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , richard.henderson@linaro.org 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: 1650550310840100001 From: Marc-Andr=C3=A9 Lureau It's not the way it is usually written (see https://clang.llvm.org/). Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Damien Hedde Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Daniel P. Berrang=C3=A9 Message-Id: <20220420132624.2439741-17-marcandre.lureau@redhat.com> --- docs/devel/style.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/devel/style.rst b/docs/devel/style.rst index 9e66d133e15b..7ddd42b6c2c8 100644 --- a/docs/devel/style.rst +++ b/docs/devel/style.rst @@ -522,7 +522,7 @@ documented in the GNU Compiler Collection manual starti= ng at version 4.0. Automatic memory deallocation =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D =20 -QEMU has a mandatory dependency either the GCC or CLang compiler. As +QEMU has a mandatory dependency on either the GCC or the Clang compiler. As such it has the freedom to make use of a C language extension for automatically running a cleanup function when a stack variable goes out of scope. This can be used to simplify function cleanup paths, --=20 2.36.0 From nobody Wed May 22 02:46:12 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 1650549687926949.4535563575662; Thu, 21 Apr 2022 07:01:27 -0700 (PDT) Received: from localhost ([::1]:47776 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhXN7-0003PM-8k for importer@patchew.org; Thu, 21 Apr 2022 10:01:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36766) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXCu-0003Vk-Mu for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:50:52 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:43016) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXCs-00068O-7z for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:50:52 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-582-wRxDRIYkMAabMPWseCNlnQ-1; Thu, 21 Apr 2022 09:50:46 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E397583396A; Thu, 21 Apr 2022 13:50:45 +0000 (UTC) Received: from localhost (unknown [10.39.208.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1D38840C1438; Thu, 21 Apr 2022 13:50:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650549049; 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=Q1axO1VEjYNC6DMkddrlCDlXenaHgfxLrHwLvn2ubuA=; b=SjdFoF8NI0W8yMMo1Wg5b34dp2R14RMvS7Gs+hxmHD28fHqMPf9tkU5RbM3cwrzIDo3nPP stUlGKlwIxnifh01KRrEMrdAZSml3RIrPMGFkdAkHdQwZAuhZ3ciPUQQhIYiVhY13NX/8y Pg7vuCFd4QMr/C/zM5Gxq9fAbwPahBw= X-MC-Unique: wRxDRIYkMAabMPWseCNlnQ-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PULL 12/30] osdep.h: move qemu_build_not_reached() Date: Thu, 21 Apr 2022 17:49:22 +0400 Message-Id: <20220421134940.2887768-13-marcandre.lureau@redhat.com> In-Reply-To: <20220421134940.2887768-1-marcandre.lureau@redhat.com> References: <20220421134940.2887768-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , richard.henderson@linaro.org 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: 1650549688384100001 From: Marc-Andr=C3=A9 Lureau Move the macro and declaration so it can use glib in the following patch (it already depends on glib anyway for !optimize) Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Daniel P. Berrang=C3=A9 Message-Id: <20220420132624.2439741-19-marcandre.lureau@redhat.com> --- include/qemu/compiler.h | 16 ---------------- include/qemu/osdep.h | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h index d9359859d435..c13bc8b58652 100644 --- a/include/qemu/compiler.h +++ b/include/qemu/compiler.h @@ -156,22 +156,6 @@ #define QEMU_ALWAYS_INLINE #endif =20 -/** - * qemu_build_not_reached() - * - * The compiler, during optimization, is expected to prove that a call - * to this function cannot be reached and remove it. If the compiler - * supports QEMU_ERROR, this will be reported at compile time; otherwise - * this will be reported at link time due to the missing symbol. - */ -extern void QEMU_NORETURN QEMU_ERROR("code path is reachable") - qemu_build_not_reached_always(void); -#if defined(__OPTIMIZE__) && !defined(__NO_INLINE__) -#define qemu_build_not_reached() qemu_build_not_reached_always() -#else -#define qemu_build_not_reached() g_assert_not_reached() -#endif - /** * In most cases, normal "fallthrough" comments are good enough for * switch-case statements, but sometimes the compiler has problems diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index a7332947107a..848916f5165c 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -169,6 +169,22 @@ extern "C" { #define assert(x) g_assert(x) #endif =20 +/** + * qemu_build_not_reached() + * + * The compiler, during optimization, is expected to prove that a call + * to this function cannot be reached and remove it. If the compiler + * supports QEMU_ERROR, this will be reported at compile time; otherwise + * this will be reported at link time due to the missing symbol. + */ +extern void QEMU_NORETURN QEMU_ERROR("code path is reachable") + qemu_build_not_reached_always(void); +#if defined(__OPTIMIZE__) && !defined(__NO_INLINE__) +#define qemu_build_not_reached() qemu_build_not_reached_always() +#else +#define qemu_build_not_reached() g_assert_not_reached() +#endif + /* * According to waitpid man page: * WCOREDUMP --=20 2.36.0 From nobody Wed May 22 02:46:12 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 1650549936683242.1819518557769; Thu, 21 Apr 2022 07:05:36 -0700 (PDT) Received: from localhost ([::1]:57716 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhXR9-0001rH-DL for importer@patchew.org; Thu, 21 Apr 2022 10:05:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36900) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXD8-00042W-Vk for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:51:07 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:20446) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXD4-0006AK-Pf for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:51:06 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-390-STx53ihcPpa3FigxKPe5zQ-1; Thu, 21 Apr 2022 09:50:54 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1A512185A7B2; Thu, 21 Apr 2022 13:50:53 +0000 (UTC) Received: from localhost (unknown [10.39.208.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id B0B374C479E; Thu, 21 Apr 2022 13:50:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650549062; 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=T3K4GmId+Doim+QWAElkZsbzMbAgMf+O9X87JRRrQ8U=; b=XTDYUCguY2aZut5pvpEDfEu+SZ7N+nxsMicXI9uvh/S8RtoEhC6lygCE/LGgCACuxwBFYG zdsT8lNiLwNxeP8c9VoR0p4a7xjCVAHocytNLETBiDUMr3P8mFT68XZSvA0ESG8GPEzu5I cn6B3ha/cqa9jRLj8zcg3aZ541Z8fm0= X-MC-Unique: STx53ihcPpa3FigxKPe5zQ-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PULL 13/30] compiler.h: replace QEMU_NORETURN with G_NORETURN Date: Thu, 21 Apr 2022 17:49:23 +0400 Message-Id: <20220421134940.2887768-14-marcandre.lureau@redhat.com> In-Reply-To: <20220421134940.2887768-1-marcandre.lureau@redhat.com> References: <20220421134940.2887768-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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 , Cornelia Huck , David Hildenbrand , Bin Meng , Mark Cave-Ayland , Thomas Huth , Laurent Vivier , Yanan Wang , Max Filippov , Taylor Simpson , Alistair Francis , "Edgar E. Iglesias" , Warner Losh , Marek Vasut , Yoshinori Sato , Daniel Henrique Barboza , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Artyom Tarasenko , Kevin Wolf , Aleksandar Rikalo , Kyle Evans , richard.henderson@linaro.org, "Dr. David Alan Gilbert" , Greg Kurz , "open list:S390 TCG CPUs" , "open list:ARM TCG CPUs" , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , "open list:PowerPC TCG CPUs" , Stafford Horne , =?UTF-8?q?Alex=20Benn=C3=A9e?= , David Gibson , Eduardo Habkost , "open list:RISC-V TCG CPUs" , "open list:Block layer core" , Bastian Koppelmann , Chris Wulff , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Hanna Reitz , Palmer Dabbelt , Paolo Bonzini , Aurelien Jarno 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: 1650549937930100001 From: Marc-Andr=C3=A9 Lureau G_NORETURN was introduced in glib 2.68, fallback to G_GNUC_NORETURN in glib-compat. Note that this attribute must be placed before the function declaration (bringing a bit of consistency in qemu codebase usage). Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Warner Losh Message-Id: <20220420132624.2439741-20-marcandre.lureau@redhat.com> --- accel/tcg/internal.h | 3 +-- include/exec/exec-all.h | 20 +++++++++--------- include/exec/helper-head.h | 2 +- include/glib-compat.h | 4 ++++ include/hw/core/cpu.h | 2 +- include/hw/core/tcg-cpu-ops.h | 6 +++--- include/hw/hw.h | 2 +- include/qemu/compiler.h | 2 -- include/qemu/osdep.h | 3 ++- include/qemu/thread.h | 2 +- include/tcg/tcg-ldst.h | 4 ++-- include/tcg/tcg.h | 2 +- linux-user/user-internals.h | 2 +- scripts/cocci-macro-file.h | 2 +- target/alpha/cpu.h | 10 ++++----- target/arm/internals.h | 12 +++++------ target/hppa/cpu.h | 2 +- target/i386/tcg/helper-tcg.h | 24 ++++++++++----------- target/microblaze/cpu.h | 6 +++--- target/mips/tcg/tcg-internal.h | 17 ++++++++------- target/nios2/cpu.h | 6 +++--- target/openrisc/exception.h | 2 +- target/ppc/cpu.h | 14 ++++++------- target/ppc/internal.h | 6 +++--- target/riscv/cpu.h | 10 ++++----- target/s390x/s390x-internal.h | 6 +++--- target/s390x/tcg/tcg_s390x.h | 12 +++++------ target/sh4/cpu.h | 6 +++--- target/sparc/cpu.h | 10 ++++----- target/xtensa/cpu.h | 6 +++--- accel/stubs/tcg-stub.c | 4 ++-- bsd-user/signal.c | 3 ++- hw/misc/mips_itu.c | 3 ++- linux-user/signal.c | 3 ++- monitor/hmp.c | 4 ++-- qemu-img.c | 12 +++++++---- target/alpha/helper.c | 10 ++++----- target/arm/pauth_helper.c | 4 ++-- target/arm/tlb_helper.c | 7 ++++--- target/hexagon/op_helper.c | 9 ++++---- target/hppa/cpu.c | 8 +++---- target/hppa/op_helper.c | 4 ++-- target/i386/tcg/bpt_helper.c | 2 +- target/i386/tcg/excp_helper.c | 31 ++++++++++++++-------------- target/i386/tcg/misc_helper.c | 6 +++--- target/i386/tcg/sysemu/misc_helper.c | 7 ++++--- target/openrisc/exception.c | 2 +- target/openrisc/exception_helper.c | 3 ++- target/riscv/op_helper.c | 4 ++-- target/rx/op_helper.c | 22 +++++++++++--------- target/s390x/tcg/excp_helper.c | 22 +++++++++++--------- target/sh4/op_helper.c | 5 +++-- target/sparc/mmu_helper.c | 8 +++---- target/tricore/op_helper.c | 6 +++--- tcg/tcg.c | 3 ++- tests/fp/fp-bench.c | 3 ++- tests/fp/fp-test.c | 3 ++- scripts/checkpatch.pl | 2 +- 58 files changed, 214 insertions(+), 191 deletions(-) diff --git a/accel/tcg/internal.h b/accel/tcg/internal.h index 881bc1ede0b1..3092bfa96430 100644 --- a/accel/tcg/internal.h +++ b/accel/tcg/internal.h @@ -14,8 +14,7 @@ TranslationBlock *tb_gen_code(CPUState *cpu, target_ulong pc, target_ulong cs_base, uint32_t flags, int cflags); - -void QEMU_NORETURN cpu_io_recompile(CPUState *cpu, uintptr_t retaddr); +G_NORETURN void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr); void page_init(void); void tb_htable_init(void); =20 diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index d2cb0981f405..311e5fb422a3 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -58,10 +58,10 @@ void restore_state_to_opc(CPUArchState *env, Translatio= nBlock *tb, */ bool cpu_restore_state(CPUState *cpu, uintptr_t searched_pc, bool will_exi= t); =20 -void QEMU_NORETURN cpu_loop_exit_noexc(CPUState *cpu); -void QEMU_NORETURN cpu_loop_exit(CPUState *cpu); -void QEMU_NORETURN cpu_loop_exit_restore(CPUState *cpu, uintptr_t pc); -void QEMU_NORETURN cpu_loop_exit_atomic(CPUState *cpu, uintptr_t pc); +G_NORETURN void cpu_loop_exit_noexc(CPUState *cpu); +G_NORETURN void cpu_loop_exit(CPUState *cpu); +G_NORETURN void cpu_loop_exit_restore(CPUState *cpu, uintptr_t pc); +G_NORETURN void cpu_loop_exit_atomic(CPUState *cpu, uintptr_t pc); =20 /** * cpu_loop_exit_requested: @@ -669,9 +669,9 @@ bool handle_sigsegv_accerr_write(CPUState *cpu, sigset_= t *old_set, * Use the TCGCPUOps hook to record cpu state, do guest operating system * specific things to raise SIGSEGV, and jump to the main cpu loop. */ -void QEMU_NORETURN cpu_loop_exit_sigsegv(CPUState *cpu, target_ulong addr, - MMUAccessType access_type, - bool maperr, uintptr_t ra); +G_NORETURN void cpu_loop_exit_sigsegv(CPUState *cpu, target_ulong addr, + MMUAccessType access_type, + bool maperr, uintptr_t ra); =20 /** * cpu_loop_exit_sigbus: @@ -683,9 +683,9 @@ void QEMU_NORETURN cpu_loop_exit_sigsegv(CPUState *cpu,= target_ulong addr, * Use the TCGCPUOps hook to record cpu state, do guest operating system * specific things to raise SIGBUS, and jump to the main cpu loop. */ -void QEMU_NORETURN cpu_loop_exit_sigbus(CPUState *cpu, target_ulong addr, - MMUAccessType access_type, - uintptr_t ra); +G_NORETURN void cpu_loop_exit_sigbus(CPUState *cpu, target_ulong addr, + MMUAccessType access_type, + uintptr_t ra); =20 #else static inline void mmap_lock(void) {} diff --git a/include/exec/helper-head.h b/include/exec/helper-head.h index 734af067fee6..e242fed46e0c 100644 --- a/include/exec/helper-head.h +++ b/include/exec/helper-head.h @@ -46,7 +46,7 @@ #define dh_ctype_ptr void * #define dh_ctype_cptr const void * #define dh_ctype_void void -#define dh_ctype_noreturn void QEMU_NORETURN +#define dh_ctype_noreturn G_NORETURN void #define dh_ctype(t) dh_ctype_##t =20 #ifdef NEED_CPU_H diff --git a/include/glib-compat.h b/include/glib-compat.h index 3113a7d2af84..43a562974d80 100644 --- a/include/glib-compat.h +++ b/include/glib-compat.h @@ -147,4 +147,8 @@ qemu_g_test_slow(void) =20 #pragma GCC diagnostic pop =20 +#ifndef G_NORETURN +#define G_NORETURN G_GNUC_NORETURN +#endif + #endif diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 466bed604727..996f94059f7c 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -1015,7 +1015,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, ...) +G_NORETURN void cpu_abort(CPUState *cpu, const char *fmt, ...) G_GNUC_PRINTF(2, 3); =20 /* $(top_srcdir)/cpu.c */ diff --git a/include/hw/core/tcg-cpu-ops.h b/include/hw/core/tcg-cpu-ops.h index e13898553aff..fbe6b76764cf 100644 --- a/include/hw/core/tcg-cpu-ops.h +++ b/include/hw/core/tcg-cpu-ops.h @@ -78,9 +78,9 @@ struct TCGCPUOps { * @do_unaligned_access: Callback for unaligned access handling * The callback must exit via raising an exception. */ - void (*do_unaligned_access)(CPUState *cpu, vaddr addr, - MMUAccessType access_type, - int mmu_idx, uintptr_t retaddr) QEMU_NORET= URN; + G_NORETURN void (*do_unaligned_access)(CPUState *cpu, vaddr addr, + MMUAccessType access_type, + int mmu_idx, uintptr_t retaddr); =20 /** * @adjust_watchpoint_address: hack for cpu_check_watchpoint used by A= RM diff --git a/include/hw/hw.h b/include/hw/hw.h index 34377f5309d3..045c1c8b09b3 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, ...) G_GNUC_PRINTF(1, 2); +G_NORETURN void hw_error(const char *fmt, ...) G_GNUC_PRINTF(1, 2); =20 #endif diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h index c13bc8b58652..f12c0fb581ec 100644 --- a/include/qemu/compiler.h +++ b/include/qemu/compiler.h @@ -22,8 +22,6 @@ #define QEMU_EXTERN_C extern #endif =20 -#define QEMU_NORETURN __attribute__ ((__noreturn__)) - #if defined(_WIN32) && (defined(__x86_64__) || defined(__i386__)) # define QEMU_PACKED __attribute__((gcc_struct, packed)) #else diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 848916f5165c..14b6b65a5fa9 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -177,7 +177,8 @@ extern "C" { * supports QEMU_ERROR, this will be reported at compile time; otherwise * this will be reported at link time due to the missing symbol. */ -extern void QEMU_NORETURN QEMU_ERROR("code path is reachable") +extern G_NORETURN +void QEMU_ERROR("code path is reachable") qemu_build_not_reached_always(void); #if defined(__OPTIMIZE__) && !defined(__NO_INLINE__) #define qemu_build_not_reached() qemu_build_not_reached_always() diff --git a/include/qemu/thread.h b/include/qemu/thread.h index 460568d67d53..af19f2b3fc7d 100644 --- a/include/qemu/thread.h +++ b/include/qemu/thread.h @@ -188,7 +188,7 @@ void qemu_thread_create(QemuThread *thread, const char = *name, void *qemu_thread_join(QemuThread *thread); void qemu_thread_get_self(QemuThread *thread); bool qemu_thread_is_self(QemuThread *thread); -void qemu_thread_exit(void *retval) QEMU_NORETURN; +G_NORETURN void qemu_thread_exit(void *retval); void qemu_thread_naming(bool enable); =20 struct Notifier; diff --git a/include/tcg/tcg-ldst.h b/include/tcg/tcg-ldst.h index bf40942de4ab..121a156933a5 100644 --- a/include/tcg/tcg-ldst.h +++ b/include/tcg/tcg-ldst.h @@ -72,8 +72,8 @@ void helper_be_stq_mmu(CPUArchState *env, target_ulong ad= dr, uint64_t val, =20 #else =20 -void QEMU_NORETURN helper_unaligned_ld(CPUArchState *env, target_ulong add= r); -void QEMU_NORETURN helper_unaligned_st(CPUArchState *env, target_ulong add= r); +G_NORETURN void helper_unaligned_ld(CPUArchState *env, target_ulong addr); +G_NORETURN void helper_unaligned_st(CPUArchState *env, target_ulong addr); =20 #endif /* CONFIG_SOFTMMU */ #endif /* TCG_LDST_H */ diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index 61505d20ed89..26a70526f1d2 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -398,7 +398,7 @@ typedef TCGv_ptr TCGv_env; #define TCG_CALL_NO_WRITE_GLOBALS 0x0002 /* Helper can be safely suppressed if the return value is not used. */ #define TCG_CALL_NO_SIDE_EFFECTS 0x0004 -/* Helper is QEMU_NORETURN. */ +/* Helper is G_NORETURN. */ #define TCG_CALL_NO_RETURN 0x0008 =20 /* convenience version of most used call flags */ diff --git a/linux-user/user-internals.h b/linux-user/user-internals.h index 2a80bc83ae8f..ddc260e465dc 100644 --- a/linux-user/user-internals.h +++ b/linux-user/user-internals.h @@ -64,7 +64,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, abi_long arg5, abi_long arg6, abi_long arg7, abi_long arg8); extern __thread CPUState *thread_cpu; -void QEMU_NORETURN cpu_loop(CPUArchState *env); +G_NORETURN void cpu_loop(CPUArchState *env); const char *target_strerror(int err); int get_osversion(void); void init_qemu_uname_release(void); diff --git a/scripts/cocci-macro-file.h b/scripts/cocci-macro-file.h index 3d1e9b50919a..d247a5086e91 100644 --- a/scripts/cocci-macro-file.h +++ b/scripts/cocci-macro-file.h @@ -19,7 +19,7 @@ */ =20 /* From qemu/compiler.h */ -#define QEMU_NORETURN __attribute__ ((__noreturn__)) +#define G_NORETURN __attribute__ ((__noreturn__)) #define G_GNUC_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) #define G_GNUC_NULL_TERMINATED __attribute__((sentinel)) =20 diff --git a/target/alpha/cpu.h b/target/alpha/cpu.h index 994a018b910d..d0abc949a8d0 100644 --- a/target/alpha/cpu.h +++ b/target/alpha/cpu.h @@ -434,8 +434,8 @@ void alpha_translate_init(void); #define CPU_RESOLVING_TYPE TYPE_ALPHA_CPU =20 void alpha_cpu_list(void); -void QEMU_NORETURN dynamic_excp(CPUAlphaState *, uintptr_t, int, int); -void QEMU_NORETURN arith_excp(CPUAlphaState *, uintptr_t, int, uint64_t); +G_NORETURN void dynamic_excp(CPUAlphaState *, uintptr_t, int, int); +G_NORETURN void arith_excp(CPUAlphaState *, uintptr_t, int, uint64_t); =20 uint64_t cpu_alpha_load_fpcr (CPUAlphaState *env); void cpu_alpha_store_fpcr (CPUAlphaState *env, uint64_t val); @@ -452,9 +452,9 @@ void alpha_cpu_record_sigbus(CPUState *cs, vaddr addres= s, bool alpha_cpu_tlb_fill(CPUState *cs, vaddr address, int size, MMUAccessType access_type, int mmu_idx, bool probe, uintptr_t retaddr); -void alpha_cpu_do_unaligned_access(CPUState *cpu, vaddr addr, - MMUAccessType access_type, int mmu_idx, - uintptr_t retaddr) QEMU_NORETURN; +G_NORETURN void alpha_cpu_do_unaligned_access(CPUState *cpu, vaddr addr, + MMUAccessType access_type, i= nt mmu_idx, + uintptr_t retaddr); void alpha_cpu_do_transaction_failed(CPUState *cs, hwaddr physaddr, vaddr addr, unsigned size, MMUAccessType access_type, diff --git a/target/arm/internals.h b/target/arm/internals.h index 7f696cd36a8c..9556e3b29e49 100644 --- a/target/arm/internals.h +++ b/target/arm/internals.h @@ -102,13 +102,13 @@ FIELD(V7M_EXCRET, RES1, 7, 25) /* including the must-= be-1 prefix */ * and target exception level. This should be called from helper functions, * and never returns because we will longjump back up to the CPU main loop. */ -void QEMU_NORETURN raise_exception(CPUARMState *env, uint32_t excp, - uint32_t syndrome, uint32_t target_el); +G_NORETURN void raise_exception(CPUARMState *env, uint32_t excp, + uint32_t syndrome, uint32_t target_el); =20 /* * Similarly, but also use unwinding to restore cpu state. */ -void QEMU_NORETURN raise_exception_ra(CPUARMState *env, uint32_t excp, +G_NORETURN void raise_exception_ra(CPUARMState *env, uint32_t excp, uint32_t syndrome, uint32_t target_e= l, uintptr_t ra); =20 @@ -606,9 +606,9 @@ ARMMMUIdx arm_v7m_mmu_idx_for_secstate(CPUARMState *env= , bool secstate); bool arm_s1_regime_using_lpae_format(CPUARMState *env, ARMMMUIdx mmu_idx); =20 /* Raise a data fault alignment exception for the specified virtual addres= s */ -void arm_cpu_do_unaligned_access(CPUState *cs, vaddr vaddr, - MMUAccessType access_type, - int mmu_idx, uintptr_t retaddr) QEMU_NORE= TURN; +G_NORETURN void arm_cpu_do_unaligned_access(CPUState *cs, vaddr vaddr, + MMUAccessType access_type, + int mmu_idx, uintptr_t retaddr= ); =20 /* arm_cpu_do_transaction_failed: handle a memory system error response * (eg "no device/memory present at address") by raising an external abort diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index c43b93a68f14..6f3b6beecf40 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -339,6 +339,6 @@ extern const VMStateDescription vmstate_hppa_cpu; void hppa_cpu_alarm_timer(void *); int hppa_artype_for_page(CPUHPPAState *env, target_ulong vaddr); #endif -void QEMU_NORETURN hppa_dynamic_excp(CPUHPPAState *env, int excp, uintptr_= t ra); +G_NORETURN void hppa_dynamic_excp(CPUHPPAState *env, int excp, uintptr_t r= a); =20 #endif /* HPPA_CPU_H */ diff --git a/target/i386/tcg/helper-tcg.h b/target/i386/tcg/helper-tcg.h index 0a4401e917f9..34167e2e29ca 100644 --- a/target/i386/tcg/helper-tcg.h +++ b/target/i386/tcg/helper-tcg.h @@ -69,27 +69,27 @@ static inline target_long lshift(target_long x, int n) void tcg_x86_init(void); =20 /* excp_helper.c */ -void QEMU_NORETURN raise_exception(CPUX86State *env, int exception_index); -void QEMU_NORETURN raise_exception_ra(CPUX86State *env, int exception_inde= x, - uintptr_t retaddr); -void QEMU_NORETURN raise_exception_err(CPUX86State *env, int exception_ind= ex, - int error_code); -void QEMU_NORETURN raise_exception_err_ra(CPUX86State *env, int exception_= index, - int error_code, uintptr_t retadd= r); -void QEMU_NORETURN raise_interrupt(CPUX86State *nenv, int intno, int is_in= t, - int error_code, int next_eip_addend); +G_NORETURN void raise_exception(CPUX86State *env, int exception_index); +G_NORETURN void raise_exception_ra(CPUX86State *env, int exception_index, + uintptr_t retaddr); +G_NORETURN void raise_exception_err(CPUX86State *env, int exception_index, + int error_code); +G_NORETURN void raise_exception_err_ra(CPUX86State *env, int exception_ind= ex, + int error_code, uintptr_t retaddr); +G_NORETURN void raise_interrupt(CPUX86State *nenv, int intno, int is_int, + int error_code, int next_eip_addend); =20 /* cc_helper.c */ extern const uint8_t parity_table[256]; =20 /* misc_helper.c */ void cpu_load_eflags(CPUX86State *env, int eflags, int update_mask); -void do_pause(CPUX86State *env) QEMU_NORETURN; +G_NORETURN void do_pause(CPUX86State *env); =20 /* sysemu/svm_helper.c */ #ifndef CONFIG_USER_ONLY -void QEMU_NORETURN cpu_vmexit(CPUX86State *nenv, uint32_t exit_code, - uint64_t exit_info_1, uintptr_t retaddr); +G_NORETURN void cpu_vmexit(CPUX86State *nenv, uint32_t exit_code, + uint64_t exit_info_1, uintptr_t retaddr); void do_vmexit(CPUX86State *env); #endif =20 diff --git a/target/microblaze/cpu.h b/target/microblaze/cpu.h index 67aa88b8db5b..1e84dd8f47bb 100644 --- a/target/microblaze/cpu.h +++ b/target/microblaze/cpu.h @@ -359,9 +359,9 @@ struct ArchCPU { void mb_cpu_do_interrupt(CPUState *cs); bool mb_cpu_exec_interrupt(CPUState *cs, int int_req); #endif /* !CONFIG_USER_ONLY */ -void mb_cpu_do_unaligned_access(CPUState *cs, vaddr vaddr, - MMUAccessType access_type, - int mmu_idx, uintptr_t retaddr) QEMU_NORET= URN; +G_NORETURN void mb_cpu_do_unaligned_access(CPUState *cs, vaddr vaddr, + MMUAccessType access_type, + int mmu_idx, uintptr_t retaddr); void mb_cpu_dump_state(CPUState *cpu, FILE *f, int flags); hwaddr mb_cpu_get_phys_page_attrs_debug(CPUState *cpu, vaddr addr, MemTxAttrs *attrs); diff --git a/target/mips/tcg/tcg-internal.h b/target/mips/tcg/tcg-internal.h index 466768aec487..993720b00c3f 100644 --- a/target/mips/tcg/tcg-internal.h +++ b/target/mips/tcg/tcg-internal.h @@ -18,18 +18,19 @@ void mips_tcg_init(void); =20 void mips_cpu_synchronize_from_tb(CPUState *cs, const TranslationBlock *tb= ); -void mips_cpu_do_unaligned_access(CPUState *cpu, vaddr addr, - MMUAccessType access_type, int mmu_idx, - uintptr_t retaddr) QEMU_NORETURN; +G_NORETURN void mips_cpu_do_unaligned_access(CPUState *cpu, vaddr addr, + MMUAccessType access_type, in= t mmu_idx, + uintptr_t retaddr); =20 const char *mips_exception_name(int32_t exception); =20 -void QEMU_NORETURN do_raise_exception_err(CPUMIPSState *env, uint32_t exce= ption, - int error_code, uintptr_t pc); +G_NORETURN void do_raise_exception_err(CPUMIPSState *env, uint32_t excepti= on, + int error_code, uintptr_t pc); =20 -static inline void QEMU_NORETURN do_raise_exception(CPUMIPSState *env, - uint32_t exception, - uintptr_t pc) +static inline G_NORETURN +void do_raise_exception(CPUMIPSState *env, + uint32_t exception, + uintptr_t pc) { do_raise_exception_err(env, exception, 0, pc); } diff --git a/target/nios2/cpu.h b/target/nios2/cpu.h index ca0f3420cd1b..1bab805bb0b6 100644 --- a/target/nios2/cpu.h +++ b/target/nios2/cpu.h @@ -194,9 +194,9 @@ void nios2_cpu_do_interrupt(CPUState *cs); void dump_mmu(CPUNios2State *env); void nios2_cpu_dump_state(CPUState *cpu, FILE *f, int flags); hwaddr nios2_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); -void nios2_cpu_do_unaligned_access(CPUState *cpu, vaddr addr, - MMUAccessType access_type, int mmu_idx, - uintptr_t retaddr) QEMU_NORETURN; +G_NORETURN void nios2_cpu_do_unaligned_access(CPUState *cpu, vaddr addr, + MMUAccessType access_type, i= nt mmu_idx, + uintptr_t retaddr); =20 void do_nios2_semihosting(CPUNios2State *env); =20 diff --git a/target/openrisc/exception.h b/target/openrisc/exception.h index 333bf846388d..f62fc314c1f4 100644 --- a/target/openrisc/exception.h +++ b/target/openrisc/exception.h @@ -22,6 +22,6 @@ =20 #include "cpu.h" =20 -void QEMU_NORETURN raise_exception(OpenRISCCPU *cpu, uint32_t excp); +G_NORETURN void raise_exception(OpenRISCCPU *cpu, uint32_t excp); =20 #endif /* TARGET_OPENRISC_EXCEPTION_H */ diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index 473436a49eb5..c2b6c987c047 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -2492,13 +2492,13 @@ static inline void cpu_get_tb_cpu_state(CPUPPCState= *env, target_ulong *pc, } #endif =20 -void QEMU_NORETURN raise_exception(CPUPPCState *env, uint32_t exception); -void QEMU_NORETURN raise_exception_ra(CPUPPCState *env, uint32_t exception, - uintptr_t raddr); -void QEMU_NORETURN raise_exception_err(CPUPPCState *env, uint32_t exceptio= n, - uint32_t error_code); -void QEMU_NORETURN raise_exception_err_ra(CPUPPCState *env, uint32_t excep= tion, - uint32_t error_code, uintptr_t r= addr); +G_NORETURN void raise_exception(CPUPPCState *env, uint32_t exception); +G_NORETURN void raise_exception_ra(CPUPPCState *env, uint32_t exception, + uintptr_t raddr); +G_NORETURN void raise_exception_err(CPUPPCState *env, uint32_t exception, + uint32_t error_code); +G_NORETURN void raise_exception_err_ra(CPUPPCState *env, uint32_t exceptio= n, + uint32_t error_code, uintptr_t radd= r); =20 /* PERFM EBB helper*/ #if defined(TARGET_PPC64) && !defined(CONFIG_USER_ONLY) diff --git a/target/ppc/internal.h b/target/ppc/internal.h index 6aa9484f34a5..8094e0b03371 100644 --- a/target/ppc/internal.h +++ b/target/ppc/internal.h @@ -286,9 +286,9 @@ void ppc_cpu_record_sigsegv(CPUState *cs, vaddr addr, bool ppc_cpu_tlb_fill(CPUState *cs, vaddr address, int size, MMUAccessType access_type, int mmu_idx, bool probe, uintptr_t retaddr); -void ppc_cpu_do_unaligned_access(CPUState *cs, vaddr addr, - MMUAccessType access_type, int mmu_idx, - uintptr_t retaddr) QEMU_NORETURN; +G_NORETURN void ppc_cpu_do_unaligned_access(CPUState *cs, vaddr addr, + MMUAccessType access_type, int= mmu_idx, + uintptr_t retaddr); #endif =20 #endif /* PPC_INTERNAL_H */ diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index e1d976bdef06..72f1c9451e93 100644 --- a/target/riscv/cpu.h +++ b/target/riscv/cpu.h @@ -451,9 +451,9 @@ void riscv_cpu_set_virt_enabled(CPURISCVState *env, boo= l enable); bool riscv_cpu_two_stage_lookup(int mmu_idx); int riscv_cpu_mmu_index(CPURISCVState *env, bool ifetch); hwaddr riscv_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); -void riscv_cpu_do_unaligned_access(CPUState *cs, vaddr addr, - MMUAccessType access_type, int mmu_idx, - uintptr_t retaddr) QEMU_NORETURN; +G_NORETURN void riscv_cpu_do_unaligned_access(CPUState *cs, vaddr addr, + MMUAccessType access_type, = int mmu_idx, + uintptr_t retaddr); bool riscv_cpu_tlb_fill(CPUState *cs, vaddr address, int size, MMUAccessType access_type, int mmu_idx, bool probe, uintptr_t retaddr); @@ -487,8 +487,8 @@ void riscv_cpu_set_aia_ireg_rmw_fn(CPURISCVState *env, = uint32_t priv, void riscv_cpu_set_mode(CPURISCVState *env, target_ulong newpriv); =20 void riscv_translate_init(void); -void QEMU_NORETURN riscv_raise_exception(CPURISCVState *env, - uint32_t exception, uintptr_t pc); +G_NORETURN void riscv_raise_exception(CPURISCVState *env, + uint32_t exception, uintptr_t pc); =20 target_ulong riscv_cpu_get_fflags(CPURISCVState *env); void riscv_cpu_set_fflags(CPURISCVState *env, target_ulong); diff --git a/target/s390x/s390x-internal.h b/target/s390x/s390x-internal.h index 6fc8cad2d586..6aba7fd0ca8a 100644 --- a/target/s390x/s390x-internal.h +++ b/target/s390x/s390x-internal.h @@ -280,9 +280,9 @@ void s390_cpu_record_sigbus(CPUState *cs, vaddr address, bool s390_cpu_tlb_fill(CPUState *cs, vaddr address, int size, MMUAccessType access_type, int mmu_idx, bool probe, uintptr_t retaddr); -void s390x_cpu_do_unaligned_access(CPUState *cs, vaddr addr, - MMUAccessType access_type, int mmu_idx, - uintptr_t retaddr) QEMU_NORETURN; +G_NORETURN void s390x_cpu_do_unaligned_access(CPUState *cs, vaddr addr, + MMUAccessType access_type, i= nt mmu_idx, + uintptr_t retaddr); #endif =20 =20 diff --git a/target/s390x/tcg/tcg_s390x.h b/target/s390x/tcg/tcg_s390x.h index 2f54ccb02745..78558912f99f 100644 --- a/target/s390x/tcg/tcg_s390x.h +++ b/target/s390x/tcg/tcg_s390x.h @@ -14,11 +14,11 @@ #define TCG_S390X_H =20 void tcg_s390_tod_updated(CPUState *cs, run_on_cpu_data opaque); -void QEMU_NORETURN tcg_s390_program_interrupt(CPUS390XState *env, - uint32_t code, uintptr_t ra); -void QEMU_NORETURN tcg_s390_data_exception(CPUS390XState *env, uint32_t dx= c, - uintptr_t ra); -void QEMU_NORETURN tcg_s390_vector_exception(CPUS390XState *env, uint32_t = vxc, - uintptr_t ra); +G_NORETURN void tcg_s390_program_interrupt(CPUS390XState *env, + uint32_t code, uintptr_t ra); +G_NORETURN void tcg_s390_data_exception(CPUS390XState *env, uint32_t dxc, + uintptr_t ra); +G_NORETURN void tcg_s390_vector_exception(CPUS390XState *env, uint32_t vxc, + uintptr_t ra); =20 #endif /* TCG_S390X_H */ diff --git a/target/sh4/cpu.h b/target/sh4/cpu.h index 14d490ac4705..9f15ef913caa 100644 --- a/target/sh4/cpu.h +++ b/target/sh4/cpu.h @@ -210,9 +210,9 @@ void superh_cpu_dump_state(CPUState *cpu, FILE *f, int = flags); hwaddr superh_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); int superh_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); int superh_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); -void superh_cpu_do_unaligned_access(CPUState *cpu, vaddr addr, - MMUAccessType access_type, int mmu_idx, - uintptr_t retaddr) QEMU_NORETURN; +G_NORETURN void superh_cpu_do_unaligned_access(CPUState *cpu, vaddr addr, + MMUAccessType access_type, = int mmu_idx, + uintptr_t retaddr); =20 void sh4_translate_init(void); void sh4_cpu_list(void); diff --git a/target/sparc/cpu.h b/target/sparc/cpu.h index dd9e2f5cdb6a..f80ea2e8cf2a 100644 --- a/target/sparc/cpu.h +++ b/target/sparc/cpu.h @@ -575,11 +575,11 @@ void sparc_cpu_do_interrupt(CPUState *cpu); hwaddr sparc_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); int sparc_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); int sparc_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); -void QEMU_NORETURN sparc_cpu_do_unaligned_access(CPUState *cpu, vaddr addr, - MMUAccessType access_type, - int mmu_idx, - uintptr_t retaddr); -void cpu_raise_exception_ra(CPUSPARCState *, int, uintptr_t) QEMU_NORETURN; +G_NORETURN void sparc_cpu_do_unaligned_access(CPUState *cpu, vaddr addr, + MMUAccessType access_type, + int mmu_idx, + uintptr_t retaddr); +G_NORETURN void cpu_raise_exception_ra(CPUSPARCState *, int, uintptr_t); =20 #ifndef NO_CPU_IO_DEFS /* cpu_init.c */ diff --git a/target/xtensa/cpu.h b/target/xtensa/cpu.h index 71142ea8f453..d4b8268146cb 100644 --- a/target/xtensa/cpu.h +++ b/target/xtensa/cpu.h @@ -581,9 +581,9 @@ void xtensa_count_regs(const XtensaConfig *config, unsigned *n_regs, unsigned *n_core_regs); int xtensa_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); int xtensa_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); -void xtensa_cpu_do_unaligned_access(CPUState *cpu, vaddr addr, - MMUAccessType access_type, int mmu_idx, - uintptr_t retaddr) QEMU_NORETURN; +G_NORETURN void xtensa_cpu_do_unaligned_access(CPUState *cpu, vaddr addr, + MMUAccessType access_type, = int mmu_idx, + uintptr_t retaddr); =20 #define cpu_list xtensa_cpu_list =20 diff --git a/accel/stubs/tcg-stub.c b/accel/stubs/tcg-stub.c index d8162673ae8d..ea4a0dd2fbcc 100644 --- a/accel/stubs/tcg-stub.c +++ b/accel/stubs/tcg-stub.c @@ -28,12 +28,12 @@ void *probe_access(CPUArchState *env, target_ulong addr= , int size, g_assert_not_reached(); } =20 -void QEMU_NORETURN cpu_loop_exit(CPUState *cpu) +G_NORETURN void cpu_loop_exit(CPUState *cpu) { g_assert_not_reached(); } =20 -void QEMU_NORETURN cpu_loop_exit_restore(CPUState *cpu, uintptr_t pc) +G_NORETURN void cpu_loop_exit_restore(CPUState *cpu, uintptr_t pc) { g_assert_not_reached(); } diff --git a/bsd-user/signal.c b/bsd-user/signal.c index 8a36b696d82b..58a53863957a 100644 --- a/bsd-user/signal.c +++ b/bsd-user/signal.c @@ -347,7 +347,8 @@ static int core_dump_signal(int sig) } =20 /* Abort execution with signal. */ -static void QEMU_NORETURN dump_core_and_abort(int target_sig) +static G_NORETURN +void dump_core_and_abort(int target_sig) { CPUArchState *env =3D thread_cpu->env_ptr; CPUState *cpu =3D env_cpu(env); diff --git a/hw/misc/mips_itu.c b/hw/misc/mips_itu.c index 80683fed318b..badef5c214af 100644 --- a/hw/misc/mips_itu.c +++ b/hw/misc/mips_itu.c @@ -189,7 +189,8 @@ static void wake_blocked_threads(ITCStorageCell *c) c->blocked_threads =3D 0; } =20 -static void QEMU_NORETURN block_thread_and_exit(ITCStorageCell *c) +static G_NORETURN +void block_thread_and_exit(ITCStorageCell *c) { c->blocked_threads |=3D 1ULL << current_cpu->cpu_index; current_cpu->halted =3D 1; diff --git a/linux-user/signal.c b/linux-user/signal.c index 092e70b80c6f..8d29bfaa6b5c 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -725,7 +725,8 @@ void cpu_loop_exit_sigbus(CPUState *cpu, target_ulong a= ddr, } =20 /* abort execution with signal */ -static void QEMU_NORETURN dump_core_and_abort(int target_sig) +static G_NORETURN +void dump_core_and_abort(int target_sig) { CPUState *cpu =3D thread_cpu; CPUArchState *env =3D cpu->env_ptr; diff --git a/monitor/hmp.c b/monitor/hmp.c index 24fd2e5f34bf..15ca04735cd3 100644 --- a/monitor/hmp.c +++ b/monitor/hmp.c @@ -308,8 +308,8 @@ void help_cmd(Monitor *mon, const char *name) static const char *pch; static sigjmp_buf expr_env; =20 -static void G_GNUC_PRINTF(2, 3) QEMU_NORETURN -expr_error(Monitor *mon, const char *fmt, ...) +static G_NORETURN G_GNUC_PRINTF(2, 3) +void expr_error(Monitor *mon, const char *fmt, ...) { va_list ap; va_start(ap, fmt); diff --git a/qemu-img.c b/qemu-img.c index 6337a63b3b80..4c84134a1e64 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -100,7 +100,8 @@ static void format_print(void *opaque, const char *name) printf(" %s", name); } =20 -static void QEMU_NORETURN G_GNUC_PRINTF(1, 2) error_exit(const char *fmt, = ...) +static G_NORETURN G_GNUC_PRINTF(1, 2) +void error_exit(const char *fmt, ...) { va_list ap; =20 @@ -112,18 +113,21 @@ static void QEMU_NORETURN G_GNUC_PRINTF(1, 2) error_e= xit(const char *fmt, ...) exit(EXIT_FAILURE); } =20 -static void QEMU_NORETURN missing_argument(const char *option) +static G_NORETURN +void missing_argument(const char *option) { error_exit("missing argument for option '%s'", option); } =20 -static void QEMU_NORETURN unrecognized_option(const char *option) +static G_NORETURN +void unrecognized_option(const char *option) { error_exit("unrecognized option '%s'", option); } =20 /* Please keep in synch with docs/tools/qemu-img.rst */ -static void QEMU_NORETURN help(void) +static G_NORETURN +void help(void) { const char *help_msg =3D QEMU_IMG_VERSION diff --git a/target/alpha/helper.c b/target/alpha/helper.c index dcaa2d03adb3..a5a389b5a321 100644 --- a/target/alpha/helper.c +++ b/target/alpha/helper.c @@ -514,7 +514,7 @@ void alpha_cpu_dump_state(CPUState *cs, FILE *f, int fl= ags) =20 /* This should only be called from translate, via gen_excp. We expect that ENV->PC has already been updated. */ -void QEMU_NORETURN helper_excp(CPUAlphaState *env, int excp, int error) +G_NORETURN void helper_excp(CPUAlphaState *env, int excp, int error) { CPUState *cs =3D env_cpu(env); =20 @@ -524,8 +524,8 @@ void QEMU_NORETURN helper_excp(CPUAlphaState *env, int = excp, int error) } =20 /* This may be called from any of the helpers to set up EXCEPTION_INDEX. = */ -void QEMU_NORETURN dynamic_excp(CPUAlphaState *env, uintptr_t retaddr, - int excp, int error) +G_NORETURN void dynamic_excp(CPUAlphaState *env, uintptr_t retaddr, + int excp, int error) { CPUState *cs =3D env_cpu(env); =20 @@ -539,8 +539,8 @@ void QEMU_NORETURN dynamic_excp(CPUAlphaState *env, uin= tptr_t retaddr, cpu_loop_exit(cs); } =20 -void QEMU_NORETURN arith_excp(CPUAlphaState *env, uintptr_t retaddr, - int exc, uint64_t mask) +G_NORETURN void arith_excp(CPUAlphaState *env, uintptr_t retaddr, + int exc, uint64_t mask) { env->trap_arg0 =3D exc; env->trap_arg1 =3D mask; diff --git a/target/arm/pauth_helper.c b/target/arm/pauth_helper.c index 739aa520dddd..d0483bf051ec 100644 --- a/target/arm/pauth_helper.c +++ b/target/arm/pauth_helper.c @@ -382,8 +382,8 @@ static uint64_t pauth_strip(CPUARMState *env, uint64_t = ptr, bool data) return pauth_original_ptr(ptr, param); } =20 -static void QEMU_NORETURN pauth_trap(CPUARMState *env, int target_el, - uintptr_t ra) +static G_NORETURN +void pauth_trap(CPUARMState *env, int target_el, uintptr_t ra) { raise_exception_ra(env, EXCP_UDEF, syn_pactrap(), target_el, ra); } diff --git a/target/arm/tlb_helper.c b/target/arm/tlb_helper.c index b79004e0cca6..6421e16202e5 100644 --- a/target/arm/tlb_helper.c +++ b/target/arm/tlb_helper.c @@ -79,9 +79,10 @@ static uint32_t compute_fsr_fsc(CPUARMState *env, ARMMMU= FaultInfo *fi, return fsr; } =20 -static void QEMU_NORETURN arm_deliver_fault(ARMCPU *cpu, vaddr addr, - MMUAccessType access_type, - int mmu_idx, ARMMMUFaultInfo *= fi) +static G_NORETURN +void arm_deliver_fault(ARMCPU *cpu, vaddr addr, + MMUAccessType access_type, + int mmu_idx, ARMMMUFaultInfo *fi) { CPUARMState *env =3D &cpu->env; int target_el; diff --git a/target/hexagon/op_helper.c b/target/hexagon/op_helper.c index 63e5ad5d68e2..a5ed819c0451 100644 --- a/target/hexagon/op_helper.c +++ b/target/hexagon/op_helper.c @@ -34,9 +34,10 @@ #define SF_MANTBITS 23 =20 /* Exceptions processing helpers */ -static void QEMU_NORETURN do_raise_exception_err(CPUHexagonState *env, - uint32_t exception, - uintptr_t pc) +static G_NORETURN +void do_raise_exception_err(CPUHexagonState *env, + uint32_t exception, + uintptr_t pc) { CPUState *cs =3D env_cpu(env); qemu_log_mask(CPU_LOG_INT, "%s: %d\n", __func__, exception); @@ -44,7 +45,7 @@ static void QEMU_NORETURN do_raise_exception_err(CPUHexag= onState *env, cpu_loop_exit_restore(cs, pc); } =20 -void QEMU_NORETURN HELPER(raise_exception)(CPUHexagonState *env, uint32_t = excp) +G_NORETURN void HELPER(raise_exception)(CPUHexagonState *env, uint32_t exc= p) { do_raise_exception_err(env, excp, 0); } diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index 5f46ba801eef..a6f52caf14a3 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -73,10 +73,10 @@ static void hppa_cpu_disas_set_info(CPUState *cs, disas= semble_info *info) } =20 #ifndef CONFIG_USER_ONLY -static void QEMU_NORETURN -hppa_cpu_do_unaligned_access(CPUState *cs, vaddr addr, - MMUAccessType access_type, int mmu_idx, - uintptr_t retaddr) +static G_NORETURN +void hppa_cpu_do_unaligned_access(CPUState *cs, vaddr addr, + MMUAccessType access_type, int mmu_idx, + uintptr_t retaddr) { HPPACPU *cpu =3D HPPA_CPU(cs); CPUHPPAState *env =3D &cpu->env; diff --git a/target/hppa/op_helper.c b/target/hppa/op_helper.c index 2810361be0b7..cd304f051e57 100644 --- a/target/hppa/op_helper.c +++ b/target/hppa/op_helper.c @@ -28,7 +28,7 @@ #include "fpu/softfloat.h" #include "trace.h" =20 -void QEMU_NORETURN HELPER(excp)(CPUHPPAState *env, int excp) +G_NORETURN void HELPER(excp)(CPUHPPAState *env, int excp) { CPUState *cs =3D env_cpu(env); =20 @@ -36,7 +36,7 @@ void QEMU_NORETURN HELPER(excp)(CPUHPPAState *env, int ex= cp) cpu_loop_exit(cs); } =20 -void QEMU_NORETURN hppa_dynamic_excp(CPUHPPAState *env, int excp, uintptr_= t ra) +G_NORETURN void hppa_dynamic_excp(CPUHPPAState *env, int excp, uintptr_t r= a) { CPUState *cs =3D env_cpu(env); =20 diff --git a/target/i386/tcg/bpt_helper.c b/target/i386/tcg/bpt_helper.c index b6c1fff16e51..bc34ac27fea7 100644 --- a/target/i386/tcg/bpt_helper.c +++ b/target/i386/tcg/bpt_helper.c @@ -22,7 +22,7 @@ #include "exec/helper-proto.h" #include "helper-tcg.h" =20 -void QEMU_NORETURN helper_single_step(CPUX86State *env) +G_NORETURN void helper_single_step(CPUX86State *env) { #ifndef CONFIG_USER_ONLY check_hw_breakpoints(env, true); diff --git a/target/i386/tcg/excp_helper.c b/target/i386/tcg/excp_helper.c index bdae887d0abc..c1ffa1c0ef74 100644 --- a/target/i386/tcg/excp_helper.c +++ b/target/i386/tcg/excp_helper.c @@ -25,13 +25,13 @@ #include "exec/helper-proto.h" #include "helper-tcg.h" =20 -void QEMU_NORETURN helper_raise_interrupt(CPUX86State *env, int intno, +G_NORETURN void helper_raise_interrupt(CPUX86State *env, int intno, int next_eip_addend) { raise_interrupt(env, intno, 1, 0, next_eip_addend); } =20 -void QEMU_NORETURN helper_raise_exception(CPUX86State *env, int exception_= index) +G_NORETURN void helper_raise_exception(CPUX86State *env, int exception_ind= ex) { raise_exception(env, exception_index); } @@ -87,10 +87,11 @@ static int check_exception(CPUX86State *env, int intno,= int *error_code, * env->eip value AFTER the interrupt instruction. It is only relevant if * is_int is TRUE. */ -static void QEMU_NORETURN raise_interrupt2(CPUX86State *env, int intno, - int is_int, int error_code, - int next_eip_addend, - uintptr_t retaddr) +static G_NORETURN +void raise_interrupt2(CPUX86State *env, int intno, + int is_int, int error_code, + int next_eip_addend, + uintptr_t retaddr) { CPUState *cs =3D env_cpu(env); =20 @@ -111,31 +112,31 @@ static void QEMU_NORETURN raise_interrupt2(CPUX86Stat= e *env, int intno, =20 /* shortcuts to generate exceptions */ =20 -void QEMU_NORETURN raise_interrupt(CPUX86State *env, int intno, int is_int, - int error_code, int next_eip_addend) +G_NORETURN void raise_interrupt(CPUX86State *env, int intno, int is_int, + int error_code, int next_eip_addend) { raise_interrupt2(env, intno, is_int, error_code, next_eip_addend, 0); } =20 -void QEMU_NORETURN raise_exception_err(CPUX86State *env, int exception_ind= ex, - int error_code) +G_NORETURN void raise_exception_err(CPUX86State *env, int exception_index, + int error_code) { raise_interrupt2(env, exception_index, 0, error_code, 0, 0); } =20 -void QEMU_NORETURN raise_exception_err_ra(CPUX86State *env, int exception_= index, - int error_code, uintptr_t retadd= r) +G_NORETURN void raise_exception_err_ra(CPUX86State *env, int exception_ind= ex, + int error_code, uintptr_t retaddr) { raise_interrupt2(env, exception_index, 0, error_code, 0, retaddr); } =20 -void QEMU_NORETURN raise_exception(CPUX86State *env, int exception_index) +G_NORETURN void raise_exception(CPUX86State *env, int exception_index) { raise_interrupt2(env, exception_index, 0, 0, 0, 0); } =20 -void QEMU_NORETURN raise_exception_ra(CPUX86State *env, int exception_inde= x, - uintptr_t retaddr) +G_NORETURN void raise_exception_ra(CPUX86State *env, int exception_index, + uintptr_t retaddr) { raise_interrupt2(env, exception_index, 0, 0, 0, retaddr); } diff --git a/target/i386/tcg/misc_helper.c b/target/i386/tcg/misc_helper.c index 24a0eaa3d596..5f7a3061ca59 100644 --- a/target/i386/tcg/misc_helper.c +++ b/target/i386/tcg/misc_helper.c @@ -81,7 +81,7 @@ void helper_rdtscp(CPUX86State *env) env->regs[R_ECX] =3D (uint32_t)(env->tsc_aux); } =20 -void QEMU_NORETURN helper_rdpmc(CPUX86State *env) +G_NORETURN void helper_rdpmc(CPUX86State *env) { if (((env->cr[4] & CR4_PCE_MASK) =3D=3D 0 ) && ((env->hflags & HF_CPL_MASK) !=3D 0)) { @@ -94,7 +94,7 @@ void QEMU_NORETURN helper_rdpmc(CPUX86State *env) raise_exception_err(env, EXCP06_ILLOP, 0); } =20 -void QEMU_NORETURN do_pause(CPUX86State *env) +G_NORETURN void do_pause(CPUX86State *env) { CPUState *cs =3D env_cpu(env); =20 @@ -103,7 +103,7 @@ void QEMU_NORETURN do_pause(CPUX86State *env) cpu_loop_exit(cs); } =20 -void QEMU_NORETURN helper_pause(CPUX86State *env, int next_eip_addend) +G_NORETURN void helper_pause(CPUX86State *env, int next_eip_addend) { cpu_svm_check_intercept_param(env, SVM_EXIT_PAUSE, 0, GETPC()); env->eip +=3D next_eip_addend; diff --git a/target/i386/tcg/sysemu/misc_helper.c b/target/i386/tcg/sysemu/= misc_helper.c index 3715c1e2625b..1328aa656fa8 100644 --- a/target/i386/tcg/sysemu/misc_helper.c +++ b/target/i386/tcg/sysemu/misc_helper.c @@ -471,7 +471,8 @@ void helper_flush_page(CPUX86State *env, target_ulong a= ddr) tlb_flush_page(env_cpu(env), addr); } =20 -static void QEMU_NORETURN do_hlt(CPUX86State *env) +static G_NORETURN +void do_hlt(CPUX86State *env) { CPUState *cs =3D env_cpu(env); =20 @@ -481,7 +482,7 @@ static void QEMU_NORETURN do_hlt(CPUX86State *env) cpu_loop_exit(cs); } =20 -void QEMU_NORETURN helper_hlt(CPUX86State *env, int next_eip_addend) +G_NORETURN void helper_hlt(CPUX86State *env, int next_eip_addend) { cpu_svm_check_intercept_param(env, SVM_EXIT_HLT, 0, GETPC()); env->eip +=3D next_eip_addend; @@ -498,7 +499,7 @@ void helper_monitor(CPUX86State *env, target_ulong ptr) cpu_svm_check_intercept_param(env, SVM_EXIT_MONITOR, 0, GETPC()); } =20 -void QEMU_NORETURN helper_mwait(CPUX86State *env, int next_eip_addend) +G_NORETURN void helper_mwait(CPUX86State *env, int next_eip_addend) { CPUState *cs =3D env_cpu(env); =20 diff --git a/target/openrisc/exception.c b/target/openrisc/exception.c index 28c1fce5232a..8699c3dcea42 100644 --- a/target/openrisc/exception.c +++ b/target/openrisc/exception.c @@ -22,7 +22,7 @@ #include "exec/exec-all.h" #include "exception.h" =20 -void QEMU_NORETURN raise_exception(OpenRISCCPU *cpu, uint32_t excp) +G_NORETURN void raise_exception(OpenRISCCPU *cpu, uint32_t excp) { CPUState *cs =3D CPU(cpu); =20 diff --git a/target/openrisc/exception_helper.c b/target/openrisc/exception= _helper.c index d02a1cf0aa14..1f5be4bed907 100644 --- a/target/openrisc/exception_helper.c +++ b/target/openrisc/exception_helper.c @@ -30,7 +30,8 @@ void HELPER(exception)(CPUOpenRISCState *env, uint32_t ex= cp) raise_exception(cpu, excp); } =20 -static void QEMU_NORETURN do_range(CPUOpenRISCState *env, uintptr_t pc) +static G_NORETURN +void do_range(CPUOpenRISCState *env, uintptr_t pc) { CPUState *cs =3D env_cpu(env); =20 diff --git a/target/riscv/op_helper.c b/target/riscv/op_helper.c index 1a75ba11e68f..df3573688325 100644 --- a/target/riscv/op_helper.c +++ b/target/riscv/op_helper.c @@ -24,8 +24,8 @@ #include "exec/helper-proto.h" =20 /* Exceptions processing helpers */ -void QEMU_NORETURN riscv_raise_exception(CPURISCVState *env, - uint32_t exception, uintptr_t pc) +G_NORETURN void riscv_raise_exception(CPURISCVState *env, + uint32_t exception, uintptr_t pc) { CPUState *cs =3D env_cpu(env); cs->exception_index =3D exception; diff --git a/target/rx/op_helper.c b/target/rx/op_helper.c index 11f952d34099..76a746300e46 100644 --- a/target/rx/op_helper.c +++ b/target/rx/op_helper.c @@ -24,8 +24,9 @@ #include "exec/cpu_ldst.h" #include "fpu/softfloat.h" =20 -static inline void QEMU_NORETURN raise_exception(CPURXState *env, int inde= x, - uintptr_t retaddr); +static inline G_NORETURN +void raise_exception(CPURXState *env, int index, + uintptr_t retaddr); =20 static void _set_psw(CPURXState *env, uint32_t psw, uint32_t rte) { @@ -418,8 +419,9 @@ uint32_t helper_divu(CPURXState *env, uint32_t num, uin= t32_t den) } =20 /* exception */ -static inline void QEMU_NORETURN raise_exception(CPURXState *env, int inde= x, - uintptr_t retaddr) +static inline G_NORETURN +void raise_exception(CPURXState *env, int index, + uintptr_t retaddr) { CPUState *cs =3D env_cpu(env); =20 @@ -427,22 +429,22 @@ static inline void QEMU_NORETURN raise_exception(CPUR= XState *env, int index, cpu_loop_exit_restore(cs, retaddr); } =20 -void QEMU_NORETURN helper_raise_privilege_violation(CPURXState *env) +G_NORETURN void helper_raise_privilege_violation(CPURXState *env) { raise_exception(env, 20, GETPC()); } =20 -void QEMU_NORETURN helper_raise_access_fault(CPURXState *env) +G_NORETURN void helper_raise_access_fault(CPURXState *env) { raise_exception(env, 21, GETPC()); } =20 -void QEMU_NORETURN helper_raise_illegal_instruction(CPURXState *env) +G_NORETURN void helper_raise_illegal_instruction(CPURXState *env) { raise_exception(env, 23, GETPC()); } =20 -void QEMU_NORETURN helper_wait(CPURXState *env) +G_NORETURN void helper_wait(CPURXState *env) { CPUState *cs =3D env_cpu(env); =20 @@ -451,12 +453,12 @@ void QEMU_NORETURN helper_wait(CPURXState *env) raise_exception(env, EXCP_HLT, 0); } =20 -void QEMU_NORETURN helper_rxint(CPURXState *env, uint32_t vec) +G_NORETURN void helper_rxint(CPURXState *env, uint32_t vec) { raise_exception(env, 0x100 + vec, 0); } =20 -void QEMU_NORETURN helper_rxbrk(CPURXState *env) +G_NORETURN void helper_rxbrk(CPURXState *env) { raise_exception(env, 0x100, 0); } diff --git a/target/s390x/tcg/excp_helper.c b/target/s390x/tcg/excp_helper.c index be6c966cfa4c..29ccf70df147 100644 --- a/target/s390x/tcg/excp_helper.c +++ b/target/s390x/tcg/excp_helper.c @@ -34,8 +34,8 @@ #include "hw/boards.h" #endif =20 -void QEMU_NORETURN tcg_s390_program_interrupt(CPUS390XState *env, - uint32_t code, uintptr_t ra) +G_NORETURN void tcg_s390_program_interrupt(CPUS390XState *env, + uint32_t code, uintptr_t ra) { CPUState *cs =3D env_cpu(env); =20 @@ -46,8 +46,8 @@ void QEMU_NORETURN tcg_s390_program_interrupt(CPUS390XSta= te *env, cpu_loop_exit(cs); } =20 -void QEMU_NORETURN tcg_s390_data_exception(CPUS390XState *env, uint32_t dx= c, - uintptr_t ra) +G_NORETURN void tcg_s390_data_exception(CPUS390XState *env, uint32_t dxc, + uintptr_t ra) { g_assert(dxc <=3D 0xff); #if !defined(CONFIG_USER_ONLY) @@ -63,8 +63,8 @@ void QEMU_NORETURN tcg_s390_data_exception(CPUS390XState = *env, uint32_t dxc, tcg_s390_program_interrupt(env, PGM_DATA, ra); } =20 -void QEMU_NORETURN tcg_s390_vector_exception(CPUS390XState *env, uint32_t = vxc, - uintptr_t ra) +G_NORETURN void tcg_s390_vector_exception(CPUS390XState *env, uint32_t vxc, + uintptr_t ra) { g_assert(vxc <=3D 0xff); #if !defined(CONFIG_USER_ONLY) @@ -88,7 +88,8 @@ void HELPER(data_exception)(CPUS390XState *env, uint32_t = dxc) * this is only for the atomic operations, for which we want to raise a * specification exception. */ -static void QEMU_NORETURN do_unaligned_access(CPUState *cs, uintptr_t reta= ddr) +static G_NORETURN +void do_unaligned_access(CPUState *cs, uintptr_t retaddr) { S390CPU *cpu =3D S390_CPU(cs); CPUS390XState *env =3D &cpu->env; @@ -620,9 +621,10 @@ void s390x_cpu_do_unaligned_access(CPUState *cs, vaddr= addr, do_unaligned_access(cs, retaddr); } =20 -static void QEMU_NORETURN monitor_event(CPUS390XState *env, - uint64_t monitor_code, - uint8_t monitor_class, uintptr_t r= a) +static G_NORETURN +void monitor_event(CPUS390XState *env, + uint64_t monitor_code, + uint8_t monitor_class, uintptr_t ra) { /* Store the Monitor Code and the Monitor Class Number into the lowcor= e */ stq_phys(env_cpu(env)->as, diff --git a/target/sh4/op_helper.c b/target/sh4/op_helper.c index 752669825f02..a663335c39ae 100644 --- a/target/sh4/op_helper.c +++ b/target/sh4/op_helper.c @@ -57,8 +57,9 @@ void helper_ldtlb(CPUSH4State *env) #endif } =20 -static inline void QEMU_NORETURN raise_exception(CPUSH4State *env, int ind= ex, - uintptr_t retaddr) +static inline G_NORETURN +void raise_exception(CPUSH4State *env, int index, + uintptr_t retaddr) { CPUState *cs =3D env_cpu(env); =20 diff --git a/target/sparc/mmu_helper.c b/target/sparc/mmu_helper.c index 346a6dfa3537..919448a49401 100644 --- a/target/sparc/mmu_helper.c +++ b/target/sparc/mmu_helper.c @@ -925,10 +925,10 @@ hwaddr sparc_cpu_get_phys_page_debug(CPUState *cs, va= ddr addr) } =20 #ifndef CONFIG_USER_ONLY -void QEMU_NORETURN sparc_cpu_do_unaligned_access(CPUState *cs, vaddr addr, - MMUAccessType access_type, - int mmu_idx, - uintptr_t retaddr) +G_NORETURN void sparc_cpu_do_unaligned_access(CPUState *cs, vaddr addr, + MMUAccessType access_type, + int mmu_idx, + uintptr_t retaddr) { SPARCCPU *cpu =3D SPARC_CPU(cs); CPUSPARCState *env =3D &cpu->env; diff --git a/target/tricore/op_helper.c b/target/tricore/op_helper.c index 9476d10d0065..a79c838a92cc 100644 --- a/target/tricore/op_helper.c +++ b/target/tricore/op_helper.c @@ -25,9 +25,9 @@ =20 /* Exception helpers */ =20 -static void QEMU_NORETURN -raise_exception_sync_internal(CPUTriCoreState *env, uint32_t class, int ti= n, - uintptr_t pc, uint32_t fcd_pc) +static G_NORETURN +void raise_exception_sync_internal(CPUTriCoreState *env, uint32_t class, i= nt tin, + uintptr_t pc, uint32_t fcd_pc) { CPUState *cs =3D env_cpu(env); /* in case we come from a helper-call we need to restore the PC */ diff --git a/tcg/tcg.c b/tcg/tcg.c index 666ca416cbf4..0f9cfe96f28a 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -320,7 +320,8 @@ static void set_jmp_reset_offset(TCGContext *s, int whi= ch) } =20 /* Signal overflow, starting over with fewer guest insns. */ -static void QEMU_NORETURN tcg_raise_tb_overflow(TCGContext *s) +static G_NORETURN +void tcg_raise_tb_overflow(TCGContext *s) { siglongjmp(s->jmp_trans, -2); } diff --git a/tests/fp/fp-bench.c b/tests/fp/fp-bench.c index c24baf85350a..8ce0ca1545d1 100644 --- a/tests/fp/fp-bench.c +++ b/tests/fp/fp-bench.c @@ -545,7 +545,8 @@ static int round_name_to_mode(const char *name) return -1; } =20 -static void QEMU_NORETURN die_host_rounding(enum rounding rounding) +static G_NORETURN +void die_host_rounding(enum rounding rounding) { fprintf(stderr, "fatal: '%s' rounding not supported on this host\n", round_names[rounding]); diff --git a/tests/fp/fp-test.c b/tests/fp/fp-test.c index 352dd71c44fa..35829ad5f71e 100644 --- a/tests/fp/fp-test.c +++ b/tests/fp/fp-test.c @@ -921,7 +921,8 @@ static void parse_args(int argc, char *argv[]) } } =20 -static void QEMU_NORETURN run_test(void) +static G_NORETURN +void run_test(void) { unsigned int i; =20 diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 910a6c74dff9..4763d02ae78f 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -223,7 +223,7 @@ our $Sparse =3D qr{ our $Attribute =3D qr{ const| volatile| - QEMU_NORETURN| + G_NORETURN| G_GNUC_WARN_UNUSED_RESULT| G_GNUC_NULL_TERMINATED| QEMU_PACKED| --=20 2.36.0 From nobody Wed May 22 02:46:12 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 165054989695868.3300408240924; Thu, 21 Apr 2022 07:04:56 -0700 (PDT) Received: from localhost ([::1]:56686 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhXQV-00019w-Ov for importer@patchew.org; Thu, 21 Apr 2022 10:04:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36914) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXDH-0004JN-P5 for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:51:17 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:20296) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXDE-0006BG-Ab for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:51:15 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-626-vNiUZengO5-y9F1GwlBXbA-1; Thu, 21 Apr 2022 09:51:10 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 366B7811E7A; Thu, 21 Apr 2022 13:51:10 +0000 (UTC) Received: from localhost (unknown [10.39.208.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7024A111E3EC; Thu, 21 Apr 2022 13:50:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650549071; 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=rZYdr60VTU1fGmbB4U3PxqLlInbmHwQzTYhPv4hKl6I=; b=RDOb+ByzK2unCDgsfz9telPIekR9vHHVoqbEhVeuTZ9FiAGFZg2v4UAkKVeDWji8AZkQnC Yy9MlhCWFRAq0EjQi4GLiM4rs+xFdmRnJw/XlLa2giUhMgrHsUwInDfmxlHrYKd+nrclhf njkmLR7iFqUatDff269+io/XG04yGwY= X-MC-Unique: vNiUZengO5-y9F1GwlBXbA-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PULL 14/30] include: move qemu_msync() to osdep Date: Thu, 21 Apr 2022 17:49:24 +0400 Message-Id: <20220421134940.2887768-15-marcandre.lureau@redhat.com> In-Reply-To: <20220421134940.2887768-1-marcandre.lureau@redhat.com> References: <20220421134940.2887768-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Stefan Weil , richard.henderson@linaro.org, Paolo Bonzini 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: 1650549899288100003 From: Marc-Andr=C3=A9 Lureau The implementation depends on the OS. (and longer-term goal is to move cutils to a common subproject) Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Daniel P. Berrang=C3=A9 Message-Id: <20220420132624.2439741-21-marcandre.lureau@redhat.com> --- include/qemu/cutils.h | 1 - include/qemu/osdep.h | 13 +++++++++++++ util/cutils.c | 38 -------------------------------------- util/oslib-posix.c | 18 ++++++++++++++++++ util/oslib-win32.c | 10 ++++++++++ 5 files changed, 41 insertions(+), 39 deletions(-) diff --git a/include/qemu/cutils.h b/include/qemu/cutils.h index e873bad36674..fb47ec931876 100644 --- a/include/qemu/cutils.h +++ b/include/qemu/cutils.h @@ -130,7 +130,6 @@ const char *qemu_strchrnul(const char *s, int c); #endif time_t mktimegm(struct tm *tm); int qemu_fdatasync(int fd); -int qemu_msync(void *addr, size_t length, int fd); int qemu_parse_fd(const char *param); int qemu_strtoi(const char *nptr, const char **endptr, int base, int *result); diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 14b6b65a5fa9..bf4f75dcde8f 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -641,6 +641,19 @@ static inline void qemu_reset_optind(void) #endif } =20 +/** + * Sync changes made to the memory mapped file back to the backing + * storage. For POSIX compliant systems this will fallback + * to regular msync call. Otherwise it will trigger whole file sync + * (including the metadata case there is no support to skip that otherwise) + * + * @addr - start of the memory area to be synced + * @length - length of the are to be synced + * @fd - file descriptor for the file to be synced + * (mandatory only for POSIX non-compliant systems) + */ +int qemu_msync(void *addr, size_t length, int fd); + /** * qemu_get_host_name: * @errp: Error object diff --git a/util/cutils.c b/util/cutils.c index a01a3a754049..c0775bb53c29 100644 --- a/util/cutils.c +++ b/util/cutils.c @@ -160,44 +160,6 @@ int qemu_fdatasync(int fd) #endif } =20 -/** - * Sync changes made to the memory mapped file back to the backing - * storage. For POSIX compliant systems this will fallback - * to regular msync call. Otherwise it will trigger whole file sync - * (including the metadata case there is no support to skip that otherwise) - * - * @addr - start of the memory area to be synced - * @length - length of the are to be synced - * @fd - file descriptor for the file to be synced - * (mandatory only for POSIX non-compliant systems) - */ -int qemu_msync(void *addr, size_t length, int fd) -{ -#ifdef CONFIG_POSIX - size_t align_mask =3D ~(qemu_real_host_page_size() - 1); - - /** - * There are no strict reqs as per the length of mapping - * to be synced. Still the length needs to follow the address - * alignment changes. Additionally - round the size to the multiple - * of PAGE_SIZE - */ - length +=3D ((uintptr_t)addr & (qemu_real_host_page_size() - 1)); - length =3D (length + ~align_mask) & align_mask; - - addr =3D (void *)((uintptr_t)addr & align_mask); - - return msync(addr, length, MS_SYNC); -#else /* CONFIG_POSIX */ - /** - * Perform the sync based on the file descriptor - * The sync range will most probably be wider than the one - * requested - but it will still get the job done - */ - return qemu_fdatasync(fd); -#endif /* CONFIG_POSIX */ -} - static int64_t suffix_mul(char suffix, int64_t unit) { switch (qemu_toupper(suffix)) { diff --git a/util/oslib-posix.c b/util/oslib-posix.c index c471c5bc9f8d..161f1123259f 100644 --- a/util/oslib-posix.c +++ b/util/oslib-posix.c @@ -950,3 +950,21 @@ int fcntl_setfl(int fd, int flag) } return 0; } + +int qemu_msync(void *addr, size_t length, int fd) +{ + size_t align_mask =3D ~(qemu_real_host_page_size() - 1); + + /** + * There are no strict reqs as per the length of mapping + * to be synced. Still the length needs to follow the address + * alignment changes. Additionally - round the size to the multiple + * of PAGE_SIZE + */ + length +=3D ((uintptr_t)addr & (qemu_real_host_page_size() - 1)); + length =3D (length + ~align_mask) & align_mask; + + addr =3D (void *)((uintptr_t)addr & align_mask); + + return msync(addr, length, MS_SYNC); +} diff --git a/util/oslib-win32.c b/util/oslib-win32.c index f38b06914e12..1e05c316b311 100644 --- a/util/oslib-win32.c +++ b/util/oslib-win32.c @@ -596,3 +596,13 @@ size_t qemu_get_host_physmem(void) } return 0; } + +int qemu_msync(void *addr, size_t length, int fd) +{ + /** + * Perform the sync based on the file descriptor + * The sync range will most probably be wider than the one + * requested - but it will still get the job done + */ + return qemu_fdatasync(fd); +} --=20 2.36.0 From nobody Wed May 22 02:46:12 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 1650549425951807.2852808227265; Thu, 21 Apr 2022 06:57:05 -0700 (PDT) Received: from localhost ([::1]:40460 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhXIu-0006fk-TR for importer@patchew.org; Thu, 21 Apr 2022 09:57:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36948) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXDN-0004Sr-C5 for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:51:23 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:39194) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXDL-0006Bd-7k for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:51:20 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-393-A3bdmXCxN52yBBHY7-RP8Q-1; Thu, 21 Apr 2022 09:51:14 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9726C1C0E0E7; Thu, 21 Apr 2022 13:51:14 +0000 (UTC) Received: from localhost (unknown [10.39.208.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id C440E404D2E2; Thu, 21 Apr 2022 13:51:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650549078; 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=7Cz/YdSgKkJlrV8fo1ydaOhEn1MafCaf9j4Mo7q1KUE=; b=GAAI4IHIuQDpVWEL0IXnukn4sq/DG9AH82rNXFrCfi8RUAnpqnW+NuyFIBshUYnl+xRtJt NO30/Sy8Tb5QJJWPYV8h1NDWUXAJHEpGM2ypMObfE0pgY3sIal+dhpcsR36yAAFMG3pRai qskygtIfTzgTI8yZW6B1VF5tOWIzgXM= X-MC-Unique: A3bdmXCxN52yBBHY7-RP8Q-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PULL 15/30] include: move qemu_fdatasync() to osdep Date: Thu, 21 Apr 2022 17:49:25 +0400 Message-Id: <20220421134940.2887768-16-marcandre.lureau@redhat.com> In-Reply-To: <20220421134940.2887768-1-marcandre.lureau@redhat.com> References: <20220421134940.2887768-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , richard.henderson@linaro.org 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: 1650549426647100001 From: Marc-Andr=C3=A9 Lureau Move QEMU-specific code to util/osdep.c, so cutils can become a common subproject. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Daniel P. Berrang=C3=A9 Message-Id: <20220420132624.2439741-22-marcandre.lureau@redhat.com> --- include/qemu/cutils.h | 1 - include/qemu/osdep.h | 2 ++ util/cutils.c | 16 ---------------- util/osdep.c | 16 ++++++++++++++++ 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/include/qemu/cutils.h b/include/qemu/cutils.h index fb47ec931876..5c6572d44422 100644 --- a/include/qemu/cutils.h +++ b/include/qemu/cutils.h @@ -129,7 +129,6 @@ static inline const char *qemu_strchrnul(const char *s,= int c) const char *qemu_strchrnul(const char *s, int c); #endif time_t mktimegm(struct tm *tm); -int qemu_fdatasync(int fd); int qemu_parse_fd(const char *param); int qemu_strtoi(const char *nptr, const char **endptr, int base, int *result); diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index bf4f75dcde8f..a87f1b7f32e6 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -641,6 +641,8 @@ static inline void qemu_reset_optind(void) #endif } =20 +int qemu_fdatasync(int fd); + /** * Sync changes made to the memory mapped file back to the backing * storage. For POSIX compliant systems this will fallback diff --git a/util/cutils.c b/util/cutils.c index c0775bb53c29..b2777210e7da 100644 --- a/util/cutils.c +++ b/util/cutils.c @@ -144,22 +144,6 @@ time_t mktimegm(struct tm *tm) return t; } =20 -/* - * Make sure data goes on disk, but if possible do not bother to - * write out the inode just for timestamp updates. - * - * Unfortunately even in 2009 many operating systems do not support - * fdatasync and have to fall back to fsync. - */ -int qemu_fdatasync(int fd) -{ -#ifdef CONFIG_FDATASYNC - return fdatasync(fd); -#else - return fsync(fd); -#endif -} - static int64_t suffix_mul(char suffix, int64_t unit) { switch (qemu_toupper(suffix)) { diff --git a/util/osdep.c b/util/osdep.c index 1ea2398686ee..c7aec36f22c7 100644 --- a/util/osdep.c +++ b/util/osdep.c @@ -607,3 +607,19 @@ writev(int fd, const struct iovec *iov, int iov_cnt) return readv_writev(fd, iov, iov_cnt, true); } #endif + +/* + * Make sure data goes on disk, but if possible do not bother to + * write out the inode just for timestamp updates. + * + * Unfortunately even in 2009 many operating systems do not support + * fdatasync and have to fall back to fsync. + */ +int qemu_fdatasync(int fd) +{ +#ifdef CONFIG_FDATASYNC + return fdatasync(fd); +#else + return fsync(fd); +#endif +} --=20 2.36.0 From nobody Wed May 22 02:46:12 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 1650550115783350.8178628404495; Thu, 21 Apr 2022 07:08:35 -0700 (PDT) Received: from localhost ([::1]:36688 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhXU2-0006v5-RV for importer@patchew.org; Thu, 21 Apr 2022 10:08:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36984) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXDT-0004YL-3j for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:51:27 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:37238) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXDQ-0006Bz-OK for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:51:26 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-494-swHCwukrNluLpl6tOc_-sQ-1; Thu, 21 Apr 2022 09:51:22 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4649A86B8A1; Thu, 21 Apr 2022 13:51:22 +0000 (UTC) Received: from localhost (unknown [10.39.208.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id BE2A39D45; Thu, 21 Apr 2022 13:51:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650549084; 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=6z7p+s34888eEpz0F7LS3IEktkpXvTZkTAxz0ibaBew=; b=Lwkc2mLv48PLpo8YkQ7lTFFquiTp2EtOTrymEvCWDsKtgQnqTYaXxZAsOKcd4nP8E009J/ RwL2/kPvKikslgLxeeO3/anPTJ0vBMeqwWYXKLh0P05DT3ctrlsKHDq0qzPOFrdFsDUWVp t5xZJg01TWBBY/0VkJNaubTSXNI4PgA= X-MC-Unique: swHCwukrNluLpl6tOc_-sQ-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PULL 16/30] include: add qemu/keyval.h Date: Thu, 21 Apr 2022 17:49:26 +0400 Message-Id: <20220421134940.2887768-17-marcandre.lureau@redhat.com> In-Reply-To: <20220421134940.2887768-1-marcandre.lureau@redhat.com> References: <20220421134940.2887768-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 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, 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: Eduardo Habkost , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Michael Roth , richard.henderson@linaro.org, Markus Armbruster , Paolo Bonzini , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= 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: 1650550116465100001 From: Marc-Andr=C3=A9 Lureau Do not require the whole option machinery to handle keyval, as it is used by QAPI alone, without the option API. And match the associated unit name. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Daniel P. Berrang=C3=A9 Message-Id: <20220420132624.2439741-24-marcandre.lureau@redhat.com> --- include/qemu/keyval.h | 14 ++++++++++++++ include/qemu/option.h | 6 ------ qapi/qobject-input-visitor.c | 2 +- qom/object_interfaces.c | 1 + softmmu/vl.c | 1 + tests/unit/check-qom-proplist.c | 1 + tests/unit/test-forward-visitor.c | 2 +- tests/unit/test-keyval.c | 2 +- util/keyval.c | 2 +- 9 files changed, 21 insertions(+), 10 deletions(-) create mode 100644 include/qemu/keyval.h diff --git a/include/qemu/keyval.h b/include/qemu/keyval.h new file mode 100644 index 000000000000..2d263286d7c5 --- /dev/null +++ b/include/qemu/keyval.h @@ -0,0 +1,14 @@ +/* + * This work is licensed under the terms of the GNU GPL, version 2 or late= r. + * See the COPYING file in the top-level directory. + */ +#ifndef KEYVAL_H_ +#define KEYVAL_H_ + +QDict *keyval_parse_into(QDict *qdict, const char *params, const char *imp= lied_key, + bool *p_help, Error **errp); +QDict *keyval_parse(const char *params, const char *implied_key, + bool *help, Error **errp); +void keyval_merge(QDict *old, const QDict *new, Error **errp); + +#endif /* KEYVAL_H_ */ diff --git a/include/qemu/option.h b/include/qemu/option.h index bbd86e1c4eab..b34982878238 100644 --- a/include/qemu/option.h +++ b/include/qemu/option.h @@ -144,12 +144,6 @@ void qemu_opts_print_help(QemuOptsList *list, bool pri= nt_caption); void qemu_opts_free(QemuOptsList *list); QemuOptsList *qemu_opts_append(QemuOptsList *dst, QemuOptsList *list); =20 -QDict *keyval_parse_into(QDict *qdict, const char *params, const char *imp= lied_key, - bool *p_help, Error **errp); -QDict *keyval_parse(const char *params, const char *implied_key, - bool *help, Error **errp); -void keyval_merge(QDict *old, const QDict *new, Error **errp); - G_DEFINE_AUTOPTR_CLEANUP_FUNC(QemuOpts, qemu_opts_del) =20 #endif diff --git a/qapi/qobject-input-visitor.c b/qapi/qobject-input-visitor.c index f0b4c7ca9d39..3e8aca6b1594 100644 --- a/qapi/qobject-input-visitor.c +++ b/qapi/qobject-input-visitor.c @@ -28,7 +28,7 @@ #include "qapi/qmp/qnum.h" #include "qapi/qmp/qstring.h" #include "qemu/cutils.h" -#include "qemu/option.h" +#include "qemu/keyval.h" =20 typedef struct StackObject { const char *name; /* Name of @obj in its parent, if any */ diff --git a/qom/object_interfaces.c b/qom/object_interfaces.c index 3b61c195c53d..f94b6c319312 100644 --- a/qom/object_interfaces.c +++ b/qom/object_interfaces.c @@ -17,6 +17,7 @@ #include "qemu/qemu-print.h" #include "qapi/opts-visitor.h" #include "qemu/config-file.h" +#include "qemu/keyval.h" =20 bool user_creatable_complete(UserCreatable *uc, Error **errp) { diff --git a/softmmu/vl.c b/softmmu/vl.c index 2a38ebe5fbb4..5312bd25649f 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -128,6 +128,7 @@ #include "qapi/qmp/qerror.h" #include "sysemu/iothread.h" #include "qemu/guest-random.h" +#include "qemu/keyval.h" =20 #include "config-host.h" =20 diff --git a/tests/unit/check-qom-proplist.c b/tests/unit/check-qom-proplis= t.c index ed341088d35f..79d4a8b89d38 100644 --- a/tests/unit/check-qom-proplist.c +++ b/tests/unit/check-qom-proplist.c @@ -27,6 +27,7 @@ #include "qom/object.h" #include "qemu/module.h" #include "qemu/option.h" +#include "qemu/keyval.h" #include "qemu/config-file.h" #include "qom/object_interfaces.h" =20 diff --git a/tests/unit/test-forward-visitor.c b/tests/unit/test-forward-vi= sitor.c index 01de15522711..eea8ffc0720e 100644 --- a/tests/unit/test-forward-visitor.c +++ b/tests/unit/test-forward-visitor.c @@ -15,7 +15,7 @@ #include "qapi/qmp/qobject.h" #include "qapi/qmp/qdict.h" #include "test-qapi-visit.h" -#include "qemu/option.h" +#include "qemu/keyval.h" =20 typedef bool GenericVisitor (Visitor *, const char *, void **, Error **); #define CAST_VISIT_TYPE(fn) ((GenericVisitor *)(fn)) diff --git a/tests/unit/test-keyval.c b/tests/unit/test-keyval.c index af0581ae6c5b..4dc52c7a1a8b 100644 --- a/tests/unit/test-keyval.c +++ b/tests/unit/test-keyval.c @@ -19,7 +19,7 @@ #include "qapi/qobject-input-visitor.h" #include "test-qapi-visit.h" #include "qemu/cutils.h" -#include "qemu/option.h" +#include "qemu/keyval.h" =20 static void test_keyval_parse(void) { diff --git a/util/keyval.c b/util/keyval.c index 0cf2e84dc8d8..66a5b4740f12 100644 --- a/util/keyval.c +++ b/util/keyval.c @@ -95,8 +95,8 @@ #include "qapi/qmp/qlist.h" #include "qapi/qmp/qstring.h" #include "qemu/cutils.h" +#include "qemu/keyval.h" #include "qemu/help_option.h" -#include "qemu/option.h" =20 /* * Convert @key to a list index. --=20 2.36.0 From nobody Wed May 22 02:46:12 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 1650550218439323.70888864652693; Thu, 21 Apr 2022 07:10:18 -0700 (PDT) Received: from localhost ([::1]:41228 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhXVh-0001or-Bf for importer@patchew.org; Thu, 21 Apr 2022 10:10:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37012) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXDZ-0004ct-Iq for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:51:35 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:38614) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXDX-0006CY-GN for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:51:32 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-218-oJL8viRSMiaQAaE6iIMDqA-1; Thu, 21 Apr 2022 09:51:27 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AD0A6801E67; Thu, 21 Apr 2022 13:51:26 +0000 (UTC) Received: from localhost (unknown [10.39.208.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id D87C4C2811F; Thu, 21 Apr 2022 13:51:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650549090; 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=oDByLMgCYMHJe0+lnh+tjldX7ObszOaXPf06zZNPboo=; b=Bd9lw6QjfsuB3SOyBPx8/BHbLXk2NIuBkZKUyYHOzfB46lZ5dimhfAHH/CEamt2tzU6Jrr 035O/QKHtkx8NRx/XN2tHMqogeAR0bfmJi3r5FRGTkE2XiRJX7+CpVCY+BW69saSUk1/23 5Kc0NAwr9a3klc41ZV/cAIbJogUyF7o= X-MC-Unique: oJL8viRSMiaQAaE6iIMDqA-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PULL 17/30] include: move qdict_{crumple,flatten} declarations Date: Thu, 21 Apr 2022 17:49:27 +0400 Message-Id: <20220421134940.2887768-18-marcandre.lureau@redhat.com> In-Reply-To: <20220421134940.2887768-1-marcandre.lureau@redhat.com> References: <20220421134940.2887768-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 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, 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: Kevin Wolf , "open list:Block layer core" , richard.henderson@linaro.org, Markus Armbruster , Hanna Reitz , Paolo Bonzini , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= 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: 1650550219655100001 From: Marc-Andr=C3=A9 Lureau Move them where they belong, since the functions are implemented in block-q= dict.c. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Daniel P. Berrang=C3=A9 Message-Id: <20220420132624.2439741-25-marcandre.lureau@redhat.com> --- include/block/qdict.h | 3 +++ include/qapi/qmp/qdict.h | 3 --- softmmu/vl.c | 1 + tests/unit/check-qobject.c | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/block/qdict.h b/include/block/qdict.h index ced2acfb92a0..b4c28d96a9e5 100644 --- a/include/block/qdict.h +++ b/include/block/qdict.h @@ -12,6 +12,9 @@ =20 #include "qapi/qmp/qdict.h" =20 +QObject *qdict_crumple(const QDict *src, Error **errp); +void qdict_flatten(QDict *qdict); + void qdict_copy_default(QDict *dst, QDict *src, const char *key); void qdict_set_default_str(QDict *dst, const char *key, const char *val); =20 diff --git a/include/qapi/qmp/qdict.h b/include/qapi/qmp/qdict.h index 882d950bde89..82e90fc07229 100644 --- a/include/qapi/qmp/qdict.h +++ b/include/qapi/qmp/qdict.h @@ -68,7 +68,4 @@ const char *qdict_get_try_str(const QDict *qdict, const c= har *key); =20 QDict *qdict_clone_shallow(const QDict *src); =20 -QObject *qdict_crumple(const QDict *src, Error **errp); -void qdict_flatten(QDict *qdict); - #endif /* QDICT_H */ diff --git a/softmmu/vl.c b/softmmu/vl.c index 5312bd25649f..06a0e342fe9e 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -125,6 +125,7 @@ #include "qapi/qapi-visit-qom.h" #include "qapi/qapi-commands-ui.h" #include "qapi/qmp/qdict.h" +#include "block/qdict.h" #include "qapi/qmp/qerror.h" #include "sysemu/iothread.h" #include "qemu/guest-random.h" diff --git a/tests/unit/check-qobject.c b/tests/unit/check-qobject.c index 0ed094e55f3a..c5e850a10cb5 100644 --- a/tests/unit/check-qobject.c +++ b/tests/unit/check-qobject.c @@ -15,6 +15,7 @@ #include "qapi/qmp/qnull.h" #include "qapi/qmp/qnum.h" #include "qapi/qmp/qstring.h" +#include "block/qdict.h" =20 #include =20 --=20 2.36.0 From nobody Wed May 22 02:46:12 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 1650550356499214.931841245516; Thu, 21 Apr 2022 07:12:36 -0700 (PDT) Received: from localhost ([::1]:45946 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhXXv-00055c-Br for importer@patchew.org; Thu, 21 Apr 2022 10:12:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37040) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXDc-0004dj-4H for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:51:37 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:36277) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXDa-0006Cn-KD for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:51:35 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-617-_RavvkfUN_mFHjnghFMN-w-1; Thu, 21 Apr 2022 09:51:30 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 92F721014A64; Thu, 21 Apr 2022 13:51:30 +0000 (UTC) Received: from localhost (unknown [10.39.208.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id C065F2024CB6; Thu, 21 Apr 2022 13:51:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650549094; 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=wYm4U65bb3EFCPGKRJq93PeVgsxf2a9oSs6Q9uQqPPA=; b=BllQ743A7g1raoFG1f8Mtt/CPOOLfv3fW8KAtPoeIAab6DtB1wGePeUeopxXKXmM4p93Wy c3+QDnVouadXSoUH4/abAqJaII3pZe4w6td8kDqjFhX8WcdNzgxrARFKmppBCekTE+2BBl XgVDJDESrt9x7t/C7DPDGhZ7+M22Wvc= X-MC-Unique: _RavvkfUN_mFHjnghFMN-w-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PULL 18/30] tests: remove block/qdict checks from check-qobject.c Date: Thu, 21 Apr 2022 17:49:28 +0400 Message-Id: <20220421134940.2887768-19-marcandre.lureau@redhat.com> In-Reply-To: <20220421134940.2887768-1-marcandre.lureau@redhat.com> References: <20220421134940.2887768-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , richard.henderson@linaro.org, Markus Armbruster 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: 1650550357151100001 From: Marc-Andr=C3=A9 Lureau The functions are already covered in check-block-qdict.c. This will help moving QAPI-related tests in a common subproject. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Daniel P. Berrang=C3=A9 Message-Id: <20220420132624.2439741-26-marcandre.lureau@redhat.com> --- tests/unit/check-qobject.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/tests/unit/check-qobject.c b/tests/unit/check-qobject.c index c5e850a10cb5..022b7c74fe57 100644 --- a/tests/unit/check-qobject.c +++ b/tests/unit/check-qobject.c @@ -15,7 +15,6 @@ #include "qapi/qmp/qnull.h" #include "qapi/qmp/qnum.h" #include "qapi/qmp/qstring.h" -#include "block/qdict.h" =20 #include =20 @@ -179,7 +178,6 @@ static void qobject_is_equal_list_test(void) static void qobject_is_equal_dict_test(void) { g_autoptr(QDict) dict_cloned =3D NULL; - g_autoptr(QDict) dict_crumpled =3D NULL; g_autoptr(QDict) dict_0 =3D qdict_new(); g_autoptr(QDict) dict_1 =3D qdict_new(); g_autoptr(QDict) dict_different_key =3D qdict_new(); @@ -237,12 +235,6 @@ static void qobject_is_equal_dict_test(void) dict_different_null_key, dict_longer, dict_shorter, dict_nested); =20 - dict_crumpled =3D qobject_to(QDict, qdict_crumple(dict_1, &error_abort= )); - check_equal(dict_crumpled, dict_nested); - - qdict_flatten(dict_nested); - check_equal(dict_0, dict_nested); - /* Containing an NaN value will make this dict compare unequal to * itself */ qdict_put(dict_0, "NaN", qnum_from_double(NAN)); --=20 2.36.0 From nobody Wed May 22 02:46:12 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 1650550473582135.38511159720076; Thu, 21 Apr 2022 07:14:33 -0700 (PDT) Received: from localhost ([::1]:49552 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhXZo-0007aC-Ip for importer@patchew.org; Thu, 21 Apr 2022 10:14:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37058) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXDg-0004es-33 for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:51:40 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:26130) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXDe-0006D7-7t for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:51:39 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-28-so9airaPOz6BQUEDIghBmw-1; Thu, 21 Apr 2022 09:51:35 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 128EB3C37F32; Thu, 21 Apr 2022 13:51:35 +0000 (UTC) Received: from localhost (unknown [10.39.208.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3FE13C27DB5; Thu, 21 Apr 2022 13:51:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650549096; 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=sfjP9Xnjt6boYf8jomJEEutGXaa/gWUk0KPTC0nSBac=; b=OEVTD4s7506CosJTObFYOlYBeeSBs9SlNZ+EDxg697vVToOYBP3Bl9lkwz59/U7xQLzAEe GGgNJ3mgAr6tyFLWjIqNgOvKtIwTHkczHtZJxJmjZxt0lA9Qa9D1w8EHW2f7fYZLrAeLgI ObA3rsx/ZQLAxRlmNT9ZCh9m0Mbclfg= X-MC-Unique: so9airaPOz6BQUEDIghBmw-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PULL 19/30] compiler.h: add QEMU_SANITIZE_{ADDRESS,THREAD} Date: Thu, 21 Apr 2022 17:49:29 +0400 Message-Id: <20220421134940.2887768-20-marcandre.lureau@redhat.com> In-Reply-To: <20220421134940.2887768-1-marcandre.lureau@redhat.com> References: <20220421134940.2887768-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , richard.henderson@linaro.org 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: 1650550475771100001 From: Marc-Andr=C3=A9 Lureau Simplify a bit pre-compiler conditions. For TSAN, QEMU already has CONFIG_TSAN, but it is only set when the fiber API is present. (I wonder whether supporting TSAN without the fiber API is really relevant) Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Daniel P. Berrang=C3=A9 Message-Id: <20220420132624.2439741-27-marcandre.lureau@redhat.com> --- include/qemu/compiler.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h index f12c0fb581ec..f20a76e4a286 100644 --- a/include/qemu/compiler.h +++ b/include/qemu/compiler.h @@ -106,6 +106,14 @@ #define __has_attribute(x) 0 /* compatibility with older GCC */ #endif =20 +#if defined(__SANITIZE_ADDRESS__) || __has_feature(address_sanitizer) +# define QEMU_SANITIZE_ADDRESS 1 +#endif + +#if defined(__SANITIZE_THREAD__) || __has_feature(thread_sanitizer) +# define QEMU_SANITIZE_THREAD 1 +#endif + /* * GCC doesn't provide __has_attribute() until GCC 5, but we know all the = GCC * versions we support have the "flatten" attribute. Clang may not have the --=20 2.36.0 From nobody Wed May 22 02:46:12 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 1650550533635929.9527854906049; Thu, 21 Apr 2022 07:15:33 -0700 (PDT) Received: from localhost ([::1]:53232 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhXam-0001ky-HG for importer@patchew.org; Thu, 21 Apr 2022 10:15:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37082) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXDj-0004hB-JO for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:51:44 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:34542) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXDh-0006DO-2A for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:51:42 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-607-A6vzXugZM3eJCAgvYQbUGw-1; Thu, 21 Apr 2022 09:51:39 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D96B3185A7A4; Thu, 21 Apr 2022 13:51:38 +0000 (UTC) Received: from localhost (unknown [10.39.208.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id 114C5404728A; Thu, 21 Apr 2022 13:51:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650549100; 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=6LChbIKCQGgWTk8FDlJNk6Ns6fz1CDlRHNwJ1l7roGk=; b=fD3vqDkJN7EgBbrzdHk7Ee1FhTrZIllQwA0mZEu7hlpixsHb/XoaqqdgqG6GVHyc+t2s2a qeVo6ip8QgZ6cXzbjPwDGo1BC/vhK+rI/zBL5Cr1CVQAYxgI27NuZIpn8fUnxPZGTX1XOd /1HOETTJhYyV4Zz3dBxoxe6Ykb8pgFE= X-MC-Unique: A6vzXugZM3eJCAgvYQbUGw-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PULL 20/30] tests: run-time skip test-qga if TSAN is enabled Date: Thu, 21 Apr 2022 17:49:30 +0400 Message-Id: <20220421134940.2887768-21-marcandre.lureau@redhat.com> In-Reply-To: <20220421134940.2887768-1-marcandre.lureau@redhat.com> References: <20220421134940.2887768-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , richard.henderson@linaro.org, Michael Roth 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: 1650550534141100001 From: Marc-Andr=C3=A9 Lureau This allows to make sure the test is still built, and gives more accurate report details. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Daniel P. Berrang=C3=A9 Message-Id: <20220420132624.2439741-30-marcandre.lureau@redhat.com> --- tests/unit/test-qga.c | 7 +++++++ tests/unit/meson.build | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/unit/test-qga.c b/tests/unit/test-qga.c index 5cb140d1b53d..e17a288034bc 100644 --- a/tests/unit/test-qga.c +++ b/tests/unit/test-qga.c @@ -969,6 +969,13 @@ int main(int argc, char **argv) TestFixture fix; int ret; =20 +#ifdef QEMU_SANITIZE_THREAD + { + g_test_skip("tsan enabled, https://github.com/google/sanitizers/is= sues/1116"); + return 0; + } +#endif + setlocale (LC_ALL, ""); g_test_init(&argc, &argv, NULL); fixture_setup(&fix, NULL, NULL); diff --git a/tests/unit/meson.build b/tests/unit/meson.build index 026e39f52025..ab01e00f12cf 100644 --- a/tests/unit/meson.build +++ b/tests/unit/meson.build @@ -153,7 +153,7 @@ if have_system endif endif =20 -if have_ga and targetos =3D=3D 'linux' and 'CONFIG_TSAN' not in config_host +if have_ga and targetos =3D=3D 'linux' tests +=3D {'test-qga': ['../qtest/libqtest.c']} test_deps +=3D {'test-qga': qga} endif --=20 2.36.0 From nobody Wed May 22 02:46:12 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 1650549717240514.9805068147908; Thu, 21 Apr 2022 07:01:57 -0700 (PDT) Received: from localhost ([::1]:49076 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhXNc-0004KJ-3v for importer@patchew.org; Thu, 21 Apr 2022 10:01:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37104) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXDo-0004k2-P9 for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:51:49 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:26820) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXDn-0006Eg-1U for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:51:48 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-604-AWpqSG7hOXi-VHJr5LC7Ig-1; Thu, 21 Apr 2022 09:51:43 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7C0B11C0E0EA; Thu, 21 Apr 2022 13:51:43 +0000 (UTC) Received: from localhost (unknown [10.39.208.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6F1EAC27EBF; Thu, 21 Apr 2022 13:51:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650549105; 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=Hkc0OarZ+8s3qPtcUvc3tjeGI4qKYwmlNtw4ga7bDrA=; b=E4TOOXBwOXCNaAoePE33V+YwybTz0QAYBeer/GN9Uf7y49rgkFBWTeDOZi5hKTWPsXdpRN aZXOAAU3Kdx/en4XLw/PVM1uFOHQoKZqZFJR+5ghqlUn36eQlNn9qEoJ713WJhloV7PDPJ s84asrWfkR/mwuLjV8s+fFcOZpbF73g= X-MC-Unique: AWpqSG7hOXi-VHJr5LC7Ig-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PULL 21/30] Move error_printf_unless_qmp() with monitor unit Date: Thu, 21 Apr 2022 17:49:31 +0400 Message-Id: <20220421134940.2887768-22-marcandre.lureau@redhat.com> In-Reply-To: <20220421134940.2887768-1-marcandre.lureau@redhat.com> References: <20220421134940.2887768-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 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, 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: richard.henderson@linaro.org, Markus Armbruster , "Dr. David Alan Gilbert" , Gerd Hoffmann , Paolo Bonzini , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= 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: 1650549718606100001 From: Marc-Andr=C3=A9 Lureau Since it depends on monitor code, and error_vprintf_unless_qmp() is already there. This will help to move error-report in a common subproject. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Daniel P. Berrang=C3=A9 Message-Id: <20220420132624.2439741-31-marcandre.lureau@redhat.com> --- include/monitor/monitor.h | 3 +++ include/qemu/error-report.h | 2 -- monitor/monitor.c | 10 ++++++++++ stubs/error-printf.c | 1 + ui/vnc.c | 1 + util/error-report.c | 11 ----------- 6 files changed, 15 insertions(+), 13 deletions(-) diff --git a/include/monitor/monitor.h b/include/monitor/monitor.h index cc4cc6c6adcf..a4b40e8391db 100644 --- a/include/monitor/monitor.h +++ b/include/monitor/monitor.h @@ -56,4 +56,7 @@ void monitor_register_hmp(const char *name, bool info, void monitor_register_hmp_info_hrt(const char *name, HumanReadableText *(*handler)(Error **e= rrp)); =20 +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); + #endif /* MONITOR_H */ diff --git a/include/qemu/error-report.h b/include/qemu/error-report.h index b6f45e69d79a..3ae2357fda54 100644 --- a/include/qemu/error-report.h +++ b/include/qemu/error-report.h @@ -32,8 +32,6 @@ void loc_set_file(const char *fname, int lno); =20 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) G_GNUC_PRINTF(1, 0); void warn_vreport(const char *fmt, va_list ap) G_GNUC_PRINTF(1, 0); diff --git a/monitor/monitor.c b/monitor/monitor.c index 21c7a68758f5..86949024f643 100644 --- a/monitor/monitor.c +++ b/monitor/monitor.c @@ -286,6 +286,16 @@ int error_vprintf_unless_qmp(const char *fmt, va_list = ap) return -1; } =20 +int error_printf_unless_qmp(const char *fmt, ...) +{ + va_list ap; + int ret; + + va_start(ap, fmt); + ret =3D error_vprintf_unless_qmp(fmt, ap); + va_end(ap); + return ret; +} =20 static MonitorQAPIEventConf monitor_qapi_event_conf[QAPI_EVENT__MAX] =3D { /* Limit guest-triggerable events to 1 per second */ diff --git a/stubs/error-printf.c b/stubs/error-printf.c index a2f61521a16f..0e326d801059 100644 --- a/stubs/error-printf.c +++ b/stubs/error-printf.c @@ -1,5 +1,6 @@ #include "qemu/osdep.h" #include "qemu/error-report.h" +#include "monitor/monitor.h" =20 int error_vprintf(const char *fmt, va_list ap) { diff --git a/ui/vnc.c b/ui/vnc.c index 6261d922953b..badf1d7664fe 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -54,6 +54,7 @@ #include "qemu/cutils.h" #include "qemu/help_option.h" #include "io/dns-resolver.h" +#include "monitor/monitor.h" =20 #define VNC_REFRESH_INTERVAL_BASE GUI_REFRESH_INTERVAL_DEFAULT #define VNC_REFRESH_INTERVAL_INC 50 diff --git a/util/error-report.c b/util/error-report.c index 4ec7b30bcbcc..dbadaf206d27 100644 --- a/util/error-report.c +++ b/util/error-report.c @@ -40,17 +40,6 @@ int error_printf(const char *fmt, ...) return ret; } =20 -int error_printf_unless_qmp(const char *fmt, ...) -{ - va_list ap; - int ret; - - va_start(ap, fmt); - ret =3D error_vprintf_unless_qmp(fmt, ap); - va_end(ap); - return ret; -} - static Location std_loc =3D { .kind =3D LOC_NONE }; --=20 2.36.0 From nobody Wed May 22 02:46:12 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 1650549932889719.8324704430861; Thu, 21 Apr 2022 07:05:32 -0700 (PDT) Received: from localhost ([::1]:57646 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhXR5-0001nv-Fj for importer@patchew.org; Thu, 21 Apr 2022 10:05:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37144) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXDy-00054E-9b for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:51:58 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:43818) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXDw-0006HG-Ab for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:51:58 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-315-RjMjpNW-P1Kfj06PrhGMsA-1; Thu, 21 Apr 2022 09:51:52 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3ADE21014A60; Thu, 21 Apr 2022 13:51:52 +0000 (UTC) Received: from localhost (unknown [10.39.208.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id 853142166B48; Thu, 21 Apr 2022 13:51:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650549115; 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=RPj4vdGD1IHh8x+TqjPJVuSuUxUc9g+12x2cb4vMPwA=; b=PwkndRVQFzqTlIqudrMsVxl6swkAuUGCZYlfBV4jJ+cO0L49vXyOuHVZxWx+zpsi5Rs10D 6EdYCdSdZE2ty61nlD7L4qZAESlRMnOP+MWKt3kUNlENQh0k7wqIzFdesRC4tFAQks/0Pn XMGu90vT73XExr5077jhmtvnDRX3HLc= X-MC-Unique: RjMjpNW-P1Kfj06PrhGMsA-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PULL 22/30] qga: move qga_get_host_name() Date: Thu, 21 Apr 2022 17:49:32 +0400 Message-Id: <20220421134940.2887768-23-marcandre.lureau@redhat.com> In-Reply-To: <20220421134940.2887768-1-marcandre.lureau@redhat.com> References: <20220421134940.2887768-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 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, 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: Stefan Weil , richard.henderson@linaro.org, Konstantin Kostiuk , Michael Roth , Paolo Bonzini , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= 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: 1650549935350100001 From: Marc-Andr=C3=A9 Lureau The function is specific to qemu-ga, no need to share it in QEMU. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Konstantin Kostiuk Message-Id: <20220420132624.2439741-32-marcandre.lureau@redhat.com> --- include/qemu/osdep.h | 10 ---------- qga/commands-common.h | 11 +++++++++++ qga/commands-posix.c | 35 +++++++++++++++++++++++++++++++++++ qga/commands-win32.c | 13 +++++++++++++ qga/commands.c | 2 +- util/oslib-posix.c | 35 ----------------------------------- util/oslib-win32.c | 13 ------------- 7 files changed, 60 insertions(+), 59 deletions(-) diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index a87f1b7f32e6..4bf2883a60b3 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -656,16 +656,6 @@ int qemu_fdatasync(int fd); */ int qemu_msync(void *addr, size_t length, int fd); =20 -/** - * qemu_get_host_name: - * @errp: Error object - * - * Operating system agnostic way of querying host name. - * - * Returns allocated hostname (caller should free), NULL on failure. - */ -char *qemu_get_host_name(Error **errp); - /** * qemu_get_host_physmem: * diff --git a/qga/commands-common.h b/qga/commands-common.h index 90785ed4bb7b..d0e4a9696f37 100644 --- a/qga/commands-common.h +++ b/qga/commands-common.h @@ -18,4 +18,15 @@ GuestFileHandle *guest_file_handle_find(int64_t id, Erro= r **errp); GuestFileRead *guest_file_read_unsafe(GuestFileHandle *gfh, int64_t count, Error **errp); =20 +/** + * qga_get_host_name: + * @errp: Error object + * + * Operating system agnostic way of querying host name. + * Compared to g_get_host_name(), it doesn't cache the result. + * + * Returns allocated hostname (caller should free), NULL on failure. + */ +char *qga_get_host_name(Error **errp); + #endif diff --git a/qga/commands-posix.c b/qga/commands-posix.c index 390c1560e1b5..77f4672ca2c9 100644 --- a/qga/commands-posix.c +++ b/qga/commands-posix.c @@ -3278,3 +3278,38 @@ GuestDeviceInfoList *qmp_guest_get_devices(Error **e= rrp) =20 return NULL; } + +#ifndef HOST_NAME_MAX +# ifdef _POSIX_HOST_NAME_MAX +# define HOST_NAME_MAX _POSIX_HOST_NAME_MAX +# else +# define HOST_NAME_MAX 255 +# endif +#endif + +char *qga_get_host_name(Error **errp) +{ + long len =3D -1; + g_autofree char *hostname =3D NULL; + +#ifdef _SC_HOST_NAME_MAX + len =3D sysconf(_SC_HOST_NAME_MAX); +#endif /* _SC_HOST_NAME_MAX */ + + if (len < 0) { + len =3D HOST_NAME_MAX; + } + + /* Unfortunately, gethostname() below does not guarantee a + * NULL terminated string. Therefore, allocate one byte more + * to be sure. */ + hostname =3D g_new0(char, len + 1); + + if (gethostname(hostname, len) < 0) { + error_setg_errno(errp, errno, + "cannot get hostname"); + return NULL; + } + + return g_steal_pointer(&hostname); +} diff --git a/qga/commands-win32.c b/qga/commands-win32.c index 406e4072a012..d56b5fd2a71c 100644 --- a/qga/commands-win32.c +++ b/qga/commands-win32.c @@ -2519,3 +2519,16 @@ GuestDeviceInfoList *qmp_guest_get_devices(Error **e= rrp) } return head; } + +char *qga_get_host_name(Error **errp) +{ + wchar_t tmp[MAX_COMPUTERNAME_LENGTH + 1]; + DWORD size =3D G_N_ELEMENTS(tmp); + + if (GetComputerNameW(tmp, &size) =3D=3D 0) { + error_setg_win32(errp, GetLastError(), "failed close handle"); + return NULL; + } + + return g_utf16_to_utf8(tmp, size, NULL, NULL, NULL); +} diff --git a/qga/commands.c b/qga/commands.c index 4e9ce25b2e73..690da0073d6e 100644 --- a/qga/commands.c +++ b/qga/commands.c @@ -511,7 +511,7 @@ int ga_parse_whence(GuestFileWhence *whence, Error **er= rp) GuestHostName *qmp_guest_get_host_name(Error **errp) { GuestHostName *result =3D NULL; - g_autofree char *hostname =3D qemu_get_host_name(errp); + g_autofree char *hostname =3D qga_get_host_name(errp); =20 /* * We want to avoid using g_get_host_name() because that diff --git a/util/oslib-posix.c b/util/oslib-posix.c index 161f1123259f..fd2bdc9ac7b3 100644 --- a/util/oslib-posix.c +++ b/util/oslib-posix.c @@ -886,41 +886,6 @@ void sigaction_invoke(struct sigaction *action, action->sa_sigaction(info->ssi_signo, &si, NULL); } =20 -#ifndef HOST_NAME_MAX -# ifdef _POSIX_HOST_NAME_MAX -# define HOST_NAME_MAX _POSIX_HOST_NAME_MAX -# else -# define HOST_NAME_MAX 255 -# endif -#endif - -char *qemu_get_host_name(Error **errp) -{ - long len =3D -1; - g_autofree char *hostname =3D NULL; - -#ifdef _SC_HOST_NAME_MAX - len =3D sysconf(_SC_HOST_NAME_MAX); -#endif /* _SC_HOST_NAME_MAX */ - - if (len < 0) { - len =3D HOST_NAME_MAX; - } - - /* Unfortunately, gethostname() below does not guarantee a - * NULL terminated string. Therefore, allocate one byte more - * to be sure. */ - hostname =3D g_new0(char, len + 1); - - if (gethostname(hostname, len) < 0) { - error_setg_errno(errp, errno, - "cannot get hostname"); - return NULL; - } - - return g_steal_pointer(&hostname); -} - size_t qemu_get_host_physmem(void) { #ifdef _SC_PHYS_PAGES diff --git a/util/oslib-win32.c b/util/oslib-win32.c index 1e05c316b311..b897d759365f 100644 --- a/util/oslib-win32.c +++ b/util/oslib-win32.c @@ -573,19 +573,6 @@ bool qemu_write_pidfile(const char *filename, Error **= errp) return true; } =20 -char *qemu_get_host_name(Error **errp) -{ - wchar_t tmp[MAX_COMPUTERNAME_LENGTH + 1]; - DWORD size =3D G_N_ELEMENTS(tmp); - - if (GetComputerNameW(tmp, &size) =3D=3D 0) { - error_setg_win32(errp, GetLastError(), "failed close handle"); - return NULL; - } - - return g_utf16_to_utf8(tmp, size, NULL, NULL, NULL); -} - size_t qemu_get_host_physmem(void) { MEMORYSTATUSEX statex; --=20 2.36.0 From nobody Wed May 22 02:46:12 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 1650550703710975.0779788533937; Thu, 21 Apr 2022 07:18:23 -0700 (PDT) Received: from localhost ([::1]:33534 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhXdW-0007vG-Lq for importer@patchew.org; Thu, 21 Apr 2022 10:18:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37180) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXE4-0005So-TA for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:52:04 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:51171) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXE3-0006NJ-C3 for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:52:04 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-655-XNaE7ToxPiyOVWr_ZDCzwg-1; Thu, 21 Apr 2022 09:51:56 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 94203280534C; Thu, 21 Apr 2022 13:51:56 +0000 (UTC) Received: from localhost (unknown [10.39.208.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id AC1364087D85; Thu, 21 Apr 2022 13:51:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650549122; 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=m3B8+ynsC+uMs0q+WDo/B4eZyQLcdtVZ2JrMoayAc/s=; b=MtFtV1LUG9bEIkT7YPHluM58egjFRSUJzlsd8f08evEWJmI6mPWS2x/oj70hF8drT3eM/t mzsy8LBTEqUF3tTWh4BpHyfVmxrEPzcafezg4jpucbUUKrTJpUgnXLkNuGzy5gy2LX6FsU S+JNr81fA5Yl11FJowZuOoxFAN7xhyA= X-MC-Unique: XNaE7ToxPiyOVWr_ZDCzwg-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PULL 23/30] qtest: simplify socket_send() Date: Thu, 21 Apr 2022 17:49:33 +0400 Message-Id: <20220421134940.2887768-24-marcandre.lureau@redhat.com> In-Reply-To: <20220421134940.2887768-1-marcandre.lureau@redhat.com> References: <20220421134940.2887768-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 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, 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: Laurent Vivier , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Thomas Huth , richard.henderson@linaro.org, Paolo Bonzini 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: 1650550705125100001 From: Marc-Andr=C3=A9 Lureau Reuse qemu_write_full(). Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Thomas Huth Message-Id: <20220420132624.2439741-33-marcandre.lureau@redhat.com> --- tests/qtest/libqtest.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c index 7b5890dcc487..2b9bdb947d6f 100644 --- a/tests/qtest/libqtest.c +++ b/tests/qtest/libqtest.c @@ -414,21 +414,9 @@ void qtest_quit(QTestState *s) =20 static void socket_send(int fd, const char *buf, size_t size) { - size_t offset; - - offset =3D 0; - while (offset < size) { - ssize_t len; + size_t res =3D qemu_write_full(fd, buf, size); =20 - len =3D write(fd, buf + offset, size - offset); - if (len =3D=3D -1 && errno =3D=3D EINTR) { - continue; - } - - g_assert_cmpint(len, >, 0); - - offset +=3D len; - } + assert(res =3D=3D size); } =20 static void qtest_client_socket_send(QTestState *s, const char *buf) --=20 2.36.0 From nobody Wed May 22 02:46:12 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 1650550144626164.53433519479097; Thu, 21 Apr 2022 07:09:04 -0700 (PDT) Received: from localhost ([::1]:37738 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhXUV-0007g2-6A for importer@patchew.org; Thu, 21 Apr 2022 10:09:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37176) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXE4-0005Pq-4L for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:52:04 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:34628) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXE2-0006N8-Lj for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:52:03 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-99-xh73lWkePPeXepvu38DbZQ-1; Thu, 21 Apr 2022 09:52:00 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5EB3C3C37F26; Thu, 21 Apr 2022 13:52:00 +0000 (UTC) Received: from localhost (unknown [10.39.208.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7DF3FC28110; Thu, 21 Apr 2022 13:51:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650549122; 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=byhhTH4PBXv8zo/fZq7JFgPYfuONtJHoy4ZTS5ZpPdQ=; b=W3H2tvaH6agqw6uYB5xjIweku4nwj2YMr3bXqi9WFtYwsGkYXifeELNj0ehINBimE4FvNh YVJi4XI2jzwIQlzrtfKW5buj5xamHRY7f67WFbwXIU1fcV/qpTezZpZNX+b8PAEz9Fimwf M67N0di3aL5D1ZrOSEkTuIlipy0e0rE= X-MC-Unique: xh73lWkePPeXepvu38DbZQ-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PULL 24/30] util: simplify write in signal handler Date: Thu, 21 Apr 2022 17:49:34 +0400 Message-Id: <20220421134940.2887768-25-marcandre.lureau@redhat.com> In-Reply-To: <20220421134940.2887768-1-marcandre.lureau@redhat.com> References: <20220421134940.2887768-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , richard.henderson@linaro.org 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: 1650550146585100003 From: Marc-Andr=C3=A9 Lureau Use qemu_write_full() instead of open-coding a write loop. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Daniel P. Berrang=C3=A9 Message-Id: <20220420132624.2439741-36-marcandre.lureau@redhat.com> --- util/compatfd.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/util/compatfd.c b/util/compatfd.c index ab810c42a927..55b6e0b7fb27 100644 --- a/util/compatfd.c +++ b/util/compatfd.c @@ -42,25 +42,11 @@ static void *sigwait_compat(void *opaque) } } else { struct qemu_signalfd_siginfo buffer; - size_t offset =3D 0; - memset(&buffer, 0, sizeof(buffer)); buffer.ssi_signo =3D sig; =20 - while (offset < sizeof(buffer)) { - ssize_t len; - - len =3D write(info->fd, (char *)&buffer + offset, - sizeof(buffer) - offset); - if (len =3D=3D -1 && errno =3D=3D EINTR) { - continue; - } - - if (len <=3D 0) { - return NULL; - } - - offset +=3D len; + if (qemu_write_full(info->fd, &buffer, sizeof(buffer)) !=3D si= zeof(buffer)) { + return NULL; } } } --=20 2.36.0 From nobody Wed May 22 02:46:12 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 1650550644936759.8733752391163; Thu, 21 Apr 2022 07:17:24 -0700 (PDT) Received: from localhost ([::1]:57796 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhXcZ-000539-Tm for importer@patchew.org; Thu, 21 Apr 2022 10:17:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37194) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXEA-0005fq-Jn for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:52:10 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:42170) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXE9-0006Ni-1Z for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:52:10 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-662-n6hmYTILMNmWNLJlky4bSg-1; Thu, 21 Apr 2022 09:52:05 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D8B51811E76; Thu, 21 Apr 2022 13:52:04 +0000 (UTC) Received: from localhost (unknown [10.39.208.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id 29837145BA52; Thu, 21 Apr 2022 13:52:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650549128; 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=7HY2enkTHDFK0cg7DfjNMaD1WR99bTYd848r1vjI67E=; b=djX9dDJDLHUCBqyos2HDS+N1GPrSLu5XXEj4AB5XKL0t4vYRqnMBLgjopYDaBmRN7dVGO1 aqiPhDn/R099ngF7HjKCAd8IiFJcTNXXC8A7pd1sTeiw5m8s+2ZVebBkflc6sAa+mi9P7v gk9z3GNxo8zNJnIuvqSShPdImR4QF04= X-MC-Unique: n6hmYTILMNmWNLJlky4bSg-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PULL 25/30] util: use qemu_write_full() in qemu_write_pidfile() Date: Thu, 21 Apr 2022 17:49:35 +0400 Message-Id: <20220421134940.2887768-26-marcandre.lureau@redhat.com> In-Reply-To: <20220421134940.2887768-1-marcandre.lureau@redhat.com> References: <20220421134940.2887768-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , richard.henderson@linaro.org, Paolo Bonzini 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: 1650550646747100001 From: Marc-Andr=C3=A9 Lureau Mostly for correctness. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Daniel P. Berrang=C3=A9 Message-Id: <20220420132624.2439741-37-marcandre.lureau@redhat.com> --- util/oslib-posix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/oslib-posix.c b/util/oslib-posix.c index fd2bdc9ac7b3..9751bc6be9d7 100644 --- a/util/oslib-posix.c +++ b/util/oslib-posix.c @@ -184,7 +184,7 @@ bool qemu_write_pidfile(const char *path, Error **errp) } =20 snprintf(pidstr, sizeof(pidstr), FMT_pid "\n", getpid()); - if (write(fd, pidstr, strlen(pidstr)) !=3D strlen(pidstr)) { + if (qemu_write_full(fd, pidstr, strlen(pidstr)) !=3D strlen(pidstr)) { error_setg(errp, "Failed to write pid file"); goto fail_unlink; } --=20 2.36.0 From nobody Wed May 22 02:46:12 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 1650550843026465.9577359143443; Thu, 21 Apr 2022 07:20:43 -0700 (PDT) Received: from localhost ([::1]:38090 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhXfl-0003KB-ID for importer@patchew.org; Thu, 21 Apr 2022 10:20:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37212) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXEC-0005m4-GU for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:52:12 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:32846) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXEA-0006Nt-TG for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:52:12 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-568-Nt3cVU5uN0yoDUvuGIfOyA-1; Thu, 21 Apr 2022 09:52:09 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AEA163804527; Thu, 21 Apr 2022 13:52:08 +0000 (UTC) Received: from localhost (unknown [10.39.208.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id D7E4BC28110; Thu, 21 Apr 2022 13:52:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650549130; 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=PdQyA2C822oZFMPY2UeAT5HEc+HSQi+Jzp6MJ+UeXzs=; b=K/JA3VGReg87C9mkPDFJpWYuG5PmSUdVCbVw/eDQ7+b6VK1Y9ZPXrbJvW+CE9oZFttrnku KHF5noeNx7RabjgOqzdTgQF395bqimemBxdkiwAW3Iu758YFVAG2H1+sfy2oxoXR7IcEs2 kdE1Z7SUFHFsF6Wr3dy21P/uvFaxP8I= X-MC-Unique: Nt3cVU5uN0yoDUvuGIfOyA-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PULL 26/30] util: use qemu_create() in qemu_write_pidfile() Date: Thu, 21 Apr 2022 17:49:36 +0400 Message-Id: <20220421134940.2887768-27-marcandre.lureau@redhat.com> In-Reply-To: <20220421134940.2887768-1-marcandre.lureau@redhat.com> References: <20220421134940.2887768-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , richard.henderson@linaro.org, Paolo Bonzini 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: 1650550844408100001 From: Marc-Andr=C3=A9 Lureau qemu_open_old(O_CREATE) should be replaced with qemu_create() which handles Error reporting. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Daniel P. Berrang=C3=A9 Message-Id: <20220420132624.2439741-38-marcandre.lureau@redhat.com> --- util/oslib-posix.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/util/oslib-posix.c b/util/oslib-posix.c index 9751bc6be9d7..bcb35c3c8246 100644 --- a/util/oslib-posix.c +++ b/util/oslib-posix.c @@ -138,9 +138,8 @@ bool qemu_write_pidfile(const char *path, Error **errp) .l_len =3D 0, }; =20 - fd =3D qemu_open_old(path, O_CREAT | O_WRONLY, S_IRUSR | S_IWUSR); + fd =3D qemu_create(path, O_WRONLY, S_IRUSR | S_IWUSR, errp); if (fd =3D=3D -1) { - error_setg_errno(errp, errno, "Cannot open pid file"); return false; } =20 --=20 2.36.0 From nobody Wed May 22 02:46:12 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 1650550973545571.9397057014075; Thu, 21 Apr 2022 07:22:53 -0700 (PDT) Received: from localhost ([::1]:41958 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhXhs-00078E-4i for importer@patchew.org; Thu, 21 Apr 2022 10:22:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37352) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXEf-00073I-Ks for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:52:41 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:26850) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXEd-0006SS-Ou for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:52:41 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-639-g1rjxgtoOOW4UuM1Xwwefg-1; Thu, 21 Apr 2022 09:52:36 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 77EFC1014A66; Thu, 21 Apr 2022 13:52:35 +0000 (UTC) Received: from localhost (unknown [10.39.208.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id 489DE2024CB6; Thu, 21 Apr 2022 13:52:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650549159; 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=frEuKCz7vFQixLAFoJkgnLoLchzJ4B4ZLPUS8uN7rfY=; b=Y0K9vTgG/skRqwtj+FJXbi21s9xf+NfPWU9TxapItvdTa41YR5e5cA2TSHQery7ljJFwPp CWuWnrS0UYV7SE7XdO55HFLjLjyFWQKOIqZwSrzB9C4ogSHodJY2+xB/c3aZo7Z7xE3cXX 9s9JKQJC1FebM9IBb+4gR0KMvxgarQ8= X-MC-Unique: g1rjxgtoOOW4UuM1Xwwefg-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PULL 27/30] util: replace qemu_get_local_state_pathname() Date: Thu, 21 Apr 2022 17:49:37 +0400 Message-Id: <20220421134940.2887768-28-marcandre.lureau@redhat.com> In-Reply-To: <20220421134940.2887768-1-marcandre.lureau@redhat.com> References: <20220421134940.2887768-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 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, 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: Fam Zheng , "open list:Block SCSI subsystem" , Michael Roth , richard.henderson@linaro.org, "Dr. David Alan Gilbert" , "open list:virtiofs" , Stefan Hajnoczi , Paolo Bonzini , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Stefan Weil 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: 1650550976131100001 From: Marc-Andr=C3=A9 Lureau Simplify the function to only return the directory path. Callers are adjusted to use the GLib function to build paths, g_build_filename(). Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Daniel P. Berrang=C3=A9 Message-Id: <20220420132624.2439741-39-marcandre.lureau@redhat.com> --- include/qemu/osdep.h | 9 +++------ qga/main.c | 8 ++++---- scsi/qemu-pr-helper.c | 6 ++++-- tools/virtiofsd/fuse_virtio.c | 4 +++- util/oslib-posix.c | 7 ++----- util/oslib-win32.c | 5 ++--- 6 files changed, 18 insertions(+), 21 deletions(-) diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 4bf2883a60b3..baaa23c1568d 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -556,16 +556,13 @@ void qemu_set_cloexec(int fd); void fips_set_state(bool requested); bool fips_get_state(void); =20 -/* Return a dynamically allocated pathname denoting a file or directory th= at is - * appropriate for storing local state. - * - * @relative_pathname need not start with a directory separator; one will = be - * added automatically. +/* Return a dynamically allocated directory path that is appropriate for s= toring + * local state. * * The caller is responsible for releasing the value returned with g_free() * after use. */ -char *qemu_get_local_state_pathname(const char *relative_pathname); +char *qemu_get_local_state_dir(void); =20 /* Find program directory, and save it for later usage with * qemu_get_exec_dir(). diff --git a/qga/main.c b/qga/main.c index aa00ad8fabdf..3c20bf1fbfe0 100644 --- a/qga/main.c +++ b/qga/main.c @@ -129,12 +129,12 @@ static void stop_agent(GAState *s, bool requested); static void init_dfl_pathnames(void) { + g_autofree char *state =3D qemu_get_local_state_dir(); + g_assert(dfl_pathnames.state_dir =3D=3D NULL); g_assert(dfl_pathnames.pidfile =3D=3D NULL); - dfl_pathnames.state_dir =3D qemu_get_local_state_pathname( - QGA_STATE_RELATIVE_DIR); - dfl_pathnames.pidfile =3D qemu_get_local_state_pathname( - QGA_STATE_RELATIVE_DIR G_DIR_SEPARATOR_S "qemu-ga.pid"); + dfl_pathnames.state_dir =3D g_build_filename(state, QGA_STATE_RELATIVE= _DIR, NULL); + dfl_pathnames.pidfile =3D g_build_filename(state, QGA_STATE_RELATIVE_D= IR, "qemu-ga.pid", NULL); } =20 static void quit_handler(int sig) diff --git a/scsi/qemu-pr-helper.c b/scsi/qemu-pr-helper.c index df493e2a503e..196b78c00df5 100644 --- a/scsi/qemu-pr-helper.c +++ b/scsi/qemu-pr-helper.c @@ -77,8 +77,10 @@ static int gid =3D -1; =20 static void compute_default_paths(void) { - socket_path =3D qemu_get_local_state_pathname("run/qemu-pr-helper.sock= "); - pidfile =3D qemu_get_local_state_pathname("run/qemu-pr-helper.pid"); + g_autofree char *state =3D qemu_get_local_state_dir(); + + socket_path =3D g_build_filename(state, "run", "qemu-pr-helper.sock", = NULL); + pidfile =3D g_build_filename(state, "run", "qemu-pr-helper.pid", NULL); } =20 static void usage(const char *name) diff --git a/tools/virtiofsd/fuse_virtio.c b/tools/virtiofsd/fuse_virtio.c index 60b96470c51a..a52eacf82e1e 100644 --- a/tools/virtiofsd/fuse_virtio.c +++ b/tools/virtiofsd/fuse_virtio.c @@ -901,10 +901,12 @@ static bool fv_socket_lock(struct fuse_session *se) { g_autofree gchar *sk_name =3D NULL; g_autofree gchar *pidfile =3D NULL; + g_autofree gchar *state =3D NULL; g_autofree gchar *dir =3D NULL; Error *local_err =3D NULL; =20 - dir =3D qemu_get_local_state_pathname("run/virtiofsd"); + state =3D qemu_get_local_state_dir(); + dir =3D g_build_filename(state, "run", "virtiofsd", NULL); =20 if (g_mkdir_with_parents(dir, S_IRWXU) < 0) { fuse_log(FUSE_LOG_ERR, "%s: Failed to create directory %s: %s\n", diff --git a/util/oslib-posix.c b/util/oslib-posix.c index bcb35c3c8246..b8bf7d4070ce 100644 --- a/util/oslib-posix.c +++ b/util/oslib-posix.c @@ -297,12 +297,9 @@ int qemu_pipe(int pipefd[2]) } =20 char * -qemu_get_local_state_pathname(const char *relative_pathname) +qemu_get_local_state_dir(void) { - g_autofree char *dir =3D g_strdup_printf("%s/%s", - CONFIG_QEMU_LOCALSTATEDIR, - relative_pathname); - return get_relocated_path(dir); + return get_relocated_path(CONFIG_QEMU_LOCALSTATEDIR); } =20 void qemu_set_tty_echo(int fd, bool echo) diff --git a/util/oslib-win32.c b/util/oslib-win32.c index b897d759365f..9c1e8121fd6d 100644 --- a/util/oslib-win32.c +++ b/util/oslib-win32.c @@ -235,7 +235,7 @@ int qemu_get_thread_id(void) } =20 char * -qemu_get_local_state_pathname(const char *relative_pathname) +qemu_get_local_state_dir(void) { HRESULT result; char base_path[MAX_PATH+1] =3D ""; @@ -247,8 +247,7 @@ qemu_get_local_state_pathname(const char *relative_path= name) g_critical("CSIDL_COMMON_APPDATA unavailable: %ld", (long)result); abort(); } - return g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s", base_path, - relative_pathname); + return g_strdup(base_path); } =20 void qemu_set_tty_echo(int fd, bool echo) --=20 2.36.0 From nobody Wed May 22 02:46:12 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 1650550595107694.8363466966881; Thu, 21 Apr 2022 07:16:35 -0700 (PDT) Received: from localhost ([::1]:54614 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhXbl-0002lT-NI for importer@patchew.org; Thu, 21 Apr 2022 10:16:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37434) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXEm-0007Q0-Fi for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:52:48 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:38085) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXEk-0006TA-50 for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:52:48 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-635-UNA7s18mNCK1jO4lvHGNHw-1; Thu, 21 Apr 2022 09:52:40 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 042E9280533C; Thu, 21 Apr 2022 13:52:40 +0000 (UTC) Received: from localhost (unknown [10.39.208.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id 30127572321; Thu, 21 Apr 2022 13:52:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650549165; 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=0i0Ts0FqDWhBd6JL/EO6obdTWtDQ9t0lyh7NPG7JjII=; b=UZA+97aqKKagZebYeN9YvTUoigcpNI2q2JH49N+B957mhcSIfI8FSh6v1lwhEUZfUE2A1o cQdZXvZ0vx8/bF6nx2uJyMtCOAnJHs4WwrZ3RbXHGAu32kES/Ah2hIOh4uuAPvWUuUXv+1 OSn4h/qg7YF9ddb+FlbdkhJ24Kp7Cqc= X-MC-Unique: UNA7s18mNCK1jO4lvHGNHw-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PULL 28/30] qga: remove need for QEMU atomic.h Date: Thu, 21 Apr 2022 17:49:38 +0400 Message-Id: <20220421134940.2887768-29-marcandre.lureau@redhat.com> In-Reply-To: <20220421134940.2887768-1-marcandre.lureau@redhat.com> References: <20220421134940.2887768-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , richard.henderson@linaro.org, Michael Roth 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: 1650550596512100001 From: Marc-Andr=C3=A9 Lureau Since the introduction of guest-exec in/out/err redirections in commit a1853dca74 ("qga: guest-exec simple stdin/stdout/stderr redirection"), some execution state variables are handled with atomic ops. However, there are no threads involved in this code (and glib sources are dispatched in the same thread), and no other obvious reason to use them. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Daniel P. Berrang=C3=A9 Message-Id: <20220420132624.2439741-40-marcandre.lureau@redhat.com> --- qga/commands.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/qga/commands.c b/qga/commands.c index 690da0073d6e..7ff551d092a1 100644 --- a/qga/commands.c +++ b/qga/commands.c @@ -18,7 +18,6 @@ #include "qapi/qmp/qerror.h" #include "qemu/base64.h" #include "qemu/cutils.h" -#include "qemu/atomic.h" #include "commands-common.h" =20 /* Maximum captured guest-exec out_data/err_data - 16MB */ @@ -162,13 +161,12 @@ GuestExecStatus *qmp_guest_exec_status(int64_t pid, E= rror **errp) =20 ges =3D g_new0(GuestExecStatus, 1); =20 - bool finished =3D qatomic_mb_read(&gei->finished); + bool finished =3D gei->finished; =20 /* need to wait till output channels are closed * to be sure we captured all output at this point */ if (gei->has_output) { - finished =3D finished && qatomic_mb_read(&gei->out.closed); - finished =3D finished && qatomic_mb_read(&gei->err.closed); + finished &=3D gei->out.closed && gei->err.closed; } =20 ges->exited =3D finished; @@ -270,7 +268,7 @@ static void guest_exec_child_watch(GPid pid, gint statu= s, gpointer data) (int32_t)gpid_to_int64(pid), (uint32_t)status); =20 gei->status =3D status; - qatomic_mb_set(&gei->finished, true); + gei->finished =3D true; =20 g_spawn_close_pid(pid); } @@ -326,7 +324,7 @@ static gboolean guest_exec_input_watch(GIOChannel *ch, done: g_io_channel_shutdown(ch, true, NULL); g_io_channel_unref(ch); - qatomic_mb_set(&p->closed, true); + p->closed =3D true; g_free(p->data); =20 return false; @@ -380,7 +378,7 @@ static gboolean guest_exec_output_watch(GIOChannel *ch, close: g_io_channel_shutdown(ch, true, NULL); g_io_channel_unref(ch); - qatomic_mb_set(&p->closed, true); + p->closed =3D true; return false; } =20 --=20 2.36.0 From nobody Wed May 22 02:46:12 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 1650550361989293.29192380042707; Thu, 21 Apr 2022 07:12:41 -0700 (PDT) Received: from localhost ([::1]:46232 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhXY0-0005Hi-QG for importer@patchew.org; Thu, 21 Apr 2022 10:12:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37438) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXEn-0007Su-BT for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:52:49 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:24692) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXEl-0006TQ-NL for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:52:49 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-161-eQY50SLzNCeaNS5gNe6HWQ-1; Thu, 21 Apr 2022 09:52:44 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9CFED86B8A1; Thu, 21 Apr 2022 13:52:43 +0000 (UTC) Received: from localhost (unknown [10.39.208.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id E2F84404728A; Thu, 21 Apr 2022 13:52:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650549167; 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=p1TtJ3WkmbG6S6v17d2qM4obFqkei7UhVT5UKCJaTN0=; b=b88TbsJInYgjDmGeBrK9xfG/dvFsAUQdKJFiIzCGCnkUMZDjCiSByuuDswniXYOC0CFqgI atGzLvqI/mwVzfGjjy3YHzYD24XAGQaSbBlgLX02MwyTRdayLqU7rqZHVSaEdT2AZx9Y3v 5e5nAYR9oN1RPNo/N80PLhAEh/jHW08= X-MC-Unique: eQY50SLzNCeaNS5gNe6HWQ-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PULL 29/30] tests/fuzz: fix warning Date: Thu, 21 Apr 2022 17:49:39 +0400 Message-Id: <20220421134940.2887768-30-marcandre.lureau@redhat.com> In-Reply-To: <20220421134940.2887768-1-marcandre.lureau@redhat.com> References: <20220421134940.2887768-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 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, 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: Laurent Vivier , Thomas Huth , Darren Kenny , richard.henderson@linaro.org, Qiuhao Li , Alexander Bulekov , Bandan Das , Stefan Hajnoczi , Paolo Bonzini , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= 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: 1650550363147100001 From: Marc-Andr=C3=A9 Lureau ../tests/qtest/fuzz/generic_fuzz.c:746:17: warning: variable 'name' set but= not used [-Wunused-but-set-variable] Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Thomas Huth Message-Id: <20220420132624.2439741-42-marcandre.lureau@redhat.com> --- tests/qtest/fuzz/generic_fuzz.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/qtest/fuzz/generic_fuzz.c b/tests/qtest/fuzz/generic_fuz= z.c index dd7e25851cb6..bce83604825e 100644 --- a/tests/qtest/fuzz/generic_fuzz.c +++ b/tests/qtest/fuzz/generic_fuzz.c @@ -743,14 +743,12 @@ static void usage(void) =20 static int locate_fuzz_memory_regions(Object *child, void *opaque) { - const char *name; MemoryRegion *mr; if (object_dynamic_cast(child, TYPE_MEMORY_REGION)) { mr =3D MEMORY_REGION(child); if ((memory_region_is_ram(mr) || memory_region_is_ram_device(mr) || memory_region_is_rom(mr)) =3D=3D false) { - name =3D object_get_canonical_path_component(child); /* * We don't want duplicate pointers to the same MemoryRegion, = so * try to remove copies of the pointer, before adding it. --=20 2.36.0 From nobody Wed May 22 02:46:12 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 16505510386501008.6231013181506; Thu, 21 Apr 2022 07:23:58 -0700 (PDT) Received: from localhost ([::1]:46342 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhXit-000224-Bx for importer@patchew.org; Thu, 21 Apr 2022 10:23:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37460) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXEr-0007hO-Jr for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:52:53 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:30902) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhXEq-0006U5-4v for qemu-devel@nongnu.org; Thu, 21 Apr 2022 09:52:53 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-495-437lY15APSaCgAIqj3b0YQ-1; Thu, 21 Apr 2022 09:52:48 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 057DD185A7B2; Thu, 21 Apr 2022 13:52:48 +0000 (UTC) Received: from localhost (unknown [10.39.208.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id 232B640E80F5; Thu, 21 Apr 2022 13:52:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650549171; 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=isXn+YnfS5KSYFCe4gFUD89pPfoLmUAdk0hnX2U9yPo=; b=UbDdjKsyY2lGNgA5qs9mvMWiPIA38oTFoCrKSDqlweFiaf4nuTWlzJkCtxhkYB4wfFxlCp gFQSmg69yrm8xMjOU2Xy1KHuf0Qax7oKnJAKTwN7+Iv5IwrujIlUJ0IoLnIjVT+7K7gLPh f2wXs9+DrW+BCVzWmO1o3ZcJz7KiZ+I= X-MC-Unique: 437lY15APSaCgAIqj3b0YQ-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PULL 30/30] qga: use fixed-length and GDateTime for log timestamp Date: Thu, 21 Apr 2022 17:49:40 +0400 Message-Id: <20220421134940.2887768-31-marcandre.lureau@redhat.com> In-Reply-To: <20220421134940.2887768-1-marcandre.lureau@redhat.com> References: <20220421134940.2887768-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , richard.henderson@linaro.org, Michael Roth 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: 1650551038915100001 From: Marc-Andr=C3=A9 Lureau The old code is kind of wrong. Say it's 1649309843.000001 seconds past the epoch. Prints "1649309843.1". 9us later, it prints "1649309843.10". Should really use %06lu for the microseconds part. Use GDateTime instead, as suggested by Daniel. Suggested-by: Markus Armbruster Suggested-by: Daniel P. Berrang=C3=A9 Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Daniel P. Berrang=C3=A9 --- qga/main.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/qga/main.c b/qga/main.c index 3c20bf1fbfe0..3b9546c18584 100644 --- a/qga/main.c +++ b/qga/main.c @@ -328,11 +328,9 @@ static void ga_log(const gchar *domain, GLogLevelFlags= level, #else if (level & s->log_level) { #endif - gint64 t =3D g_get_real_time(); - fprintf(s->log_file, - "%" G_GINT64_FORMAT ".%" G_GINT64_FORMAT - ": %s: %s\n", t / G_USEC_PER_SEC, t % G_USEC_PER_SEC, - level_str, msg); + g_autoptr(GDateTime) now =3D g_date_time_new_now_utc(); + g_autofree char *nowstr =3D g_date_time_format(now, "%s.%f"); + fprintf(s->log_file, "%s: %s: %s\n", nowstr, level_str, msg); fflush(s->log_file); } } --=20 2.36.0