All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/41] Misc cleanups
@ 2022-04-20 13:25 marcandre.lureau
  2022-04-20 13:25 ` [PATCH 01/41] qga: use fixed-length for usecs formatting marcandre.lureau
                   ` (41 more replies)
  0 siblings, 42 replies; 124+ messages in thread
From: marcandre.lureau @ 2022-04-20 13:25 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Hi,

Another batch of cleanup patches, mostly while working on moving the common code
in some future subprojects. (a few patches have been posted and reviewed
earlier)

Marc-André Lureau (41):
  qga: use fixed-length for usecs formatting
  glib-compat: isolate g_date_time_format_iso8601 version-bypass
  scripts/analyze-inclusions: drop qemu-common.h from analysis
  Simplify softmmu/main.c
  hw/hyperv: remove needless qemu-common.h include
  include: rename qemu-common.h qemu/copyright.h
  build-sys: remove MSI's QEMU_GA_MSI_MINGW_DLL_PATH
  build-sys: simplify MSI's QEMU_GA_MANUFACTURER
  build-sys: simplify MSI's QEMU_GA_VERSION
  build-sys: drop MSI's QEMU_GA_DISTRO
  qga: replace usleep() with g_usleep()
  docs: trace-events-all is installed without renaming
  arm/digic: replace snprintf() with g_strdup_printf()
  arm/allwinner-a10: replace snprintf() with g_strdup_printf()
  intc/exynos4210_gic: replace snprintf() with g_strdup_printf()
  doc/style: CLang -> Clang
  doc/build-platforms: document supported compilers
  osdep.h: move qemu_build_not_reached()
  compiler.h: replace QEMU_NORETURN with G_NORETURN
  include: move qemu_msync() to osdep
  include: move qemu_fdatasync() to osdep
  include: move qemu_*_exec_dir() to cutils
  include: add qemu/keyval.h
  include: move qdict_{crumple,flatten} declarations
  tests: remove block/qdict checks from check-qobject.c
  compiler.h: add QEMU_SANITIZE_{ADDRESS,THREAD}
  Use QEMU_SANITIZE_THREAD
  Use QEMU_SANITIZE_ADDRESS
  tests: run-time skip test-qga if TSAN is enabled
  Move error_printf_unless_qmp() with monitor unit
  qga: move qga_get_host_name()
  qtest: simplify socket_send()
  tests: move libqtest.c under libqos/
  libqtest: split QMP part in libqmp
  util: simplify write in signal handler
  util: use qemu_write_full() in qemu_write_pidfile()
  util: use qemu_create() in qemu_write_pidfile()
  util: replace qemu_get_local_state_pathname()
  qga: remove need for QEMU atomic.h
  migration/ram: fix clang warning
  tests/fuzz: fix warning

 docs/about/build-platforms.rst               |  10 +
 docs/devel/qtest.rst                         |   4 +-
 docs/devel/style.rst                         |   2 +-
 docs/devel/tracing.rst                       |   2 +-
 configure                                    |  16 --
 accel/tcg/internal.h                         |   3 +-
 include/block/qdict.h                        |   3 +
 include/exec/exec-all.h                      |  20 +-
 include/exec/helper-head.h                   |   2 +-
 include/glib-compat.h                        |  12 +-
 include/hw/core/cpu.h                        |   2 +-
 include/hw/core/tcg-cpu-ops.h                |   6 +-
 include/hw/hw.h                              |   2 +-
 include/monitor/monitor.h                    |   3 +
 include/qapi/qmp/qdict.h                     |   3 -
 include/qemu-main.h                          |  10 +
 include/qemu/atomic.h                        |   8 +-
 include/qemu/compiler.h                      |  26 +--
 include/{qemu-common.h => qemu/copyright.h}  |   5 -
 include/qemu/cutils.h                        |   9 +-
 include/qemu/error-report.h                  |   2 -
 include/qemu/keyval.h                        |  14 ++
 include/qemu/option.h                        |   6 -
 include/qemu/osdep.h                         |  51 ++--
 include/qemu/thread.h                        |   2 +-
 include/tcg/tcg-ldst.h                       |   4 +-
 include/tcg/tcg.h                            |   2 +-
 linux-user/user-internals.h                  |   2 +-
 qga/commands-common.h                        |  11 +
 scripts/cocci-macro-file.h                   |   2 +-
 subprojects/libvhost-user/include/compiler.h |   1 +
 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 +-
 tests/qtest/libqos/libqmp.h                  |  50 ++++
 tests/qtest/libqos/libqtest.h                |  29 +--
 accel/stubs/tcg-stub.c                       |   4 +-
 bsd-user/main.c                              |   2 +-
 bsd-user/signal.c                            |   3 +-
 hw/arm/allwinner-a10.c                       |   4 +-
 hw/arm/digic.c                               |   5 +-
 hw/hyperv/syndbg.c                           |   1 -
 hw/intc/exynos4210_gic.c                     |   9 +-
 hw/misc/mips_itu.c                           |   3 +-
 linux-user/main.c                            |   2 +-
 linux-user/signal.c                          |   3 +-
 migration/ram.c                              |   2 +-
 monitor/hmp.c                                |   4 +-
 monitor/monitor.c                            |  10 +
 qapi/qobject-input-visitor.c                 |   2 +-
 qemu-img.c                                   |  14 +-
 qemu-io.c                                    |   3 +-
 qemu-nbd.c                                   |   2 +-
 qga/commands-posix.c                         |  35 +++
 qga/commands-win32.c                         |  13 ++
 qga/commands.c                               |  14 +-
 qga/main.c                                   |  19 +-
 qom/object_interfaces.c                      |   1 +
 scsi/qemu-pr-helper.c                        |   8 +-
 softmmu/main.c                               |  25 +-
 softmmu/vl.c                                 |   4 +-
 storage-daemon/qemu-storage-daemon.c         |   3 +-
 stubs/error-printf.c                         |   1 +
 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 +-
 tests/qtest/fdc-test.c                       |   2 +-
 tests/qtest/fuzz/fuzz.c                      |   1 +
 tests/qtest/fuzz/generic_fuzz.c              |   2 -
 tests/qtest/libqos/libqmp.c                  | 230 +++++++++++++++++++
 tests/qtest/{ => libqos}/libqtest.c          | 222 +-----------------
 tests/unit/check-qobject.c                   |   7 -
 tests/unit/check-qom-proplist.c              |   1 +
 tests/unit/test-forward-visitor.c            |   2 +-
 tests/unit/test-keyval.c                     |   2 +-
 tests/unit/test-qga.c                        |   7 +
 tools/virtiofsd/fuse_virtio.c                |   4 +-
 tools/virtiofsd/passthrough_ll.c             |   2 +-
 ui/vnc.c                                     |   1 +
 util/compatfd.c                              |  18 +-
 util/coroutine-ucontext.c                    |   2 +-
 util/cutils.c                                | 163 ++++++++-----
 util/error-report.c                          |  17 +-
 util/keyval.c                                |   2 +-
 util/osdep.c                                 |  16 ++
 util/oslib-posix.c                           | 146 ++----------
 util/oslib-win32.c                           |  64 +-----
 qga/installer/qemu-ga.wxs                    |  24 +-
 qga/meson.build                              |   5 +-
 scripts/analyze-inclusions                   |   4 -
 scripts/checkpatch.pl                        |   2 +-
 tests/qtest/libqos/meson.build               |   5 +-
 tests/unit/meson.build                       |   4 +-
 ui/cocoa.m                                   |   3 +-
 125 files changed, 914 insertions(+), 882 deletions(-)
 create mode 100644 include/qemu-main.h
 rename include/{qemu-common.h => qemu/copyright.h} (80%)
 create mode 100644 include/qemu/keyval.h
 create mode 120000 subprojects/libvhost-user/include/compiler.h
 create mode 100644 tests/qtest/libqos/libqmp.h
 create mode 100644 tests/qtest/libqos/libqmp.c
 rename tests/qtest/{ => libqos}/libqtest.c (87%)

-- 
2.35.1.693.g805e0a68082a



^ permalink raw reply	[flat|nested] 124+ messages in thread

* [PATCH 01/41] qga: use fixed-length for usecs formatting
  2022-04-20 13:25 [PATCH 00/41] Misc cleanups marcandre.lureau
@ 2022-04-20 13:25 ` marcandre.lureau
  2022-04-20 14:26   ` Daniel P. Berrangé
  2022-04-20 13:25 ` [PATCH 02/41] glib-compat: isolate g_date_time_format_iso8601 version-bypass marcandre.lureau
                   ` (40 subsequent siblings)
  41 siblings, 1 reply; 124+ messages in thread
From: marcandre.lureau @ 2022-04-20 13:25 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau, Michael Roth

From: Marc-André Lureau <marcandre.lureau@redhat.com>

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 int64_t/PRId64 instead of old GLib-style.

Suggested-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 qga/main.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/qga/main.c b/qga/main.c
index 1deb0ee2fbfe..ac63d8e47802 100644
--- a/qga/main.c
+++ b/qga/main.c
@@ -328,11 +328,10 @@ static void ga_log(const gchar *domain, GLogLevelFlags level,
 #else
     if (level & s->log_level) {
 #endif
-        gint64 t = g_get_real_time();
+        int64_t t = 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);
+                "%" PRId64 ".%06" PRId64 ": %s: %s\n",
+                t / G_USEC_PER_SEC, t % G_USEC_PER_SEC, level_str, msg);
         fflush(s->log_file);
     }
 }
-- 
2.35.1.693.g805e0a68082a



^ permalink raw reply related	[flat|nested] 124+ messages in thread

* [PATCH 02/41] glib-compat: isolate g_date_time_format_iso8601 version-bypass
  2022-04-20 13:25 [PATCH 00/41] Misc cleanups marcandre.lureau
  2022-04-20 13:25 ` [PATCH 01/41] qga: use fixed-length for usecs formatting marcandre.lureau
@ 2022-04-20 13:25 ` marcandre.lureau
  2022-04-20 14:32   ` Daniel P. Berrangé
  2022-04-20 13:25 ` [PATCH 03/41] scripts/analyze-inclusions: drop qemu-common.h from analysis marcandre.lureau
                   ` (39 subsequent siblings)
  41 siblings, 1 reply; 124+ messages in thread
From: marcandre.lureau @ 2022-04-20 13:25 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau

From: Marc-André Lureau <marcandre.lureau@redhat.com>

The solution was discussed with Markus Armbruster during the review:
https://patchew.org/QEMU/20220323155743.1585078-1-marcandre.lureau@redhat.com/20220323155743.1585078-14-marcandre.lureau@redhat.com/

Signed-off-by: Marc-André Lureau <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())
 
-#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
 
 #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 = g_date_time_new_from_unix_utc(g_get_real_time());
+    /* 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);
-- 
2.35.1.693.g805e0a68082a



^ permalink raw reply related	[flat|nested] 124+ messages in thread

* [PATCH 03/41] scripts/analyze-inclusions: drop qemu-common.h from analysis
  2022-04-20 13:25 [PATCH 00/41] Misc cleanups marcandre.lureau
  2022-04-20 13:25 ` [PATCH 01/41] qga: use fixed-length for usecs formatting marcandre.lureau
  2022-04-20 13:25 ` [PATCH 02/41] glib-compat: isolate g_date_time_format_iso8601 version-bypass marcandre.lureau
@ 2022-04-20 13:25 ` marcandre.lureau
  2022-04-20 14:32   ` Daniel P. Berrangé
  2022-04-20 13:25 ` [PATCH 04/41] Simplify softmmu/main.c marcandre.lureau
                   ` (38 subsequent siblings)
  41 siblings, 1 reply; 124+ messages in thread
From: marcandre.lureau @ 2022-04-20 13:25 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau

From: Marc-André Lureau <marcandre.lureau@redhat.com>

The header is no longer commonly included.

Signed-off-by: Marc-André Lureau <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() {
 }
 
 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
 
-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
 
-- 
2.35.1.693.g805e0a68082a



^ permalink raw reply related	[flat|nested] 124+ messages in thread

* [PATCH 04/41] Simplify softmmu/main.c
  2022-04-20 13:25 [PATCH 00/41] Misc cleanups marcandre.lureau
                   ` (2 preceding siblings ...)
  2022-04-20 13:25 ` [PATCH 03/41] scripts/analyze-inclusions: drop qemu-common.h from analysis marcandre.lureau
@ 2022-04-20 13:25 ` marcandre.lureau
  2022-04-20 14:55   ` Daniel P. Berrangé
  2022-04-20 13:25 ` [PATCH 05/41] hw/hyperv: remove needless qemu-common.h include marcandre.lureau
                   ` (37 subsequent siblings)
  41 siblings, 1 reply; 124+ messages in thread
From: marcandre.lureau @ 2022-04-20 13:25 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Philippe Mathieu-Daudé,
	Gerd Hoffmann, Akihiko Odaki, Paolo Bonzini,
	Marc-André Lureau

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Move qemu_main() declaration to a new header.

Simplify main.c since both cocoa & sdl cannot be enabled together.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Akihiko Odaki <akihiko.odaki@gmail.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 <https://qemu.org/contribute/report-a-bug> for how to report bugs.\n" \
     "More information on the QEMU project at <https://qemu.org>."
 
-/* 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 later.
+ * 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 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
+#include "qemu-main.h"
 #include "sysemu/sysemu.h"
 
 #ifdef CONFIG_SDL
-#if defined(__APPLE__) || defined(main)
 #include <SDL.h>
-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 */
 
-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)
 
     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 <crt_externs.h>
 
 #include "qemu-common.h"
+#include "qemu-main.h"
 #include "ui/clipboard.h"
 #include "ui/console.h"
 #include "ui/input.h"
-- 
2.35.1.693.g805e0a68082a



^ permalink raw reply related	[flat|nested] 124+ messages in thread

* [PATCH 05/41] hw/hyperv: remove needless qemu-common.h include
  2022-04-20 13:25 [PATCH 00/41] Misc cleanups marcandre.lureau
                   ` (3 preceding siblings ...)
  2022-04-20 13:25 ` [PATCH 04/41] Simplify softmmu/main.c marcandre.lureau
@ 2022-04-20 13:25 ` marcandre.lureau
  2022-04-20 15:01   ` Daniel P. Berrangé
  2022-04-20 13:25   ` [Virtio-fs] " marcandre.lureau
                   ` (36 subsequent siblings)
  41 siblings, 1 reply; 124+ messages in thread
From: marcandre.lureau @ 2022-04-20 13:25 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Signed-off-by: Marc-André Lureau <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"
-- 
2.35.1.693.g805e0a68082a



^ permalink raw reply related	[flat|nested] 124+ messages in thread

* [PATCH 06/41] include: rename qemu-common.h qemu/copyright.h
  2022-04-20 13:25 [PATCH 00/41] Misc cleanups marcandre.lureau
@ 2022-04-20 13:25   ` marcandre.lureau
  2022-04-20 13:25 ` [PATCH 02/41] glib-compat: isolate g_date_time_format_iso8601 version-bypass marcandre.lureau
                     ` (40 subsequent siblings)
  41 siblings, 0 replies; 124+ messages in thread
From: marcandre.lureau @ 2022-04-20 13:25 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Fam Zheng, Vladimir Sementsov-Ogievskiy,
	Akihiko Odaki, open list:Block layer core, Peter Maydell,
	Kyle Evans, Laurent Vivier, Dr. David Alan Gilbert,
	open list:virtiofs, Hanna Reitz, Paolo Bonzini, Gerd Hoffmann,
	Stefan Hajnoczi, Michael Roth, Marc-André Lureau,
	Eric Blake, Warner Losh, Philippe Mathieu-Daudé

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 include/{qemu-common.h => qemu/copyright.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 => qemu/copyright.h} (100%)

diff --git a/include/qemu-common.h b/include/qemu/copyright.h
similarity index 100%
rename from include/qemu-common.h
rename to include/qemu/copyright.h
diff --git a/bsd-user/main.c b/bsd-user/main.c
index 88d347d05ebf..aaab3f278534 100644
--- a/bsd-user/main.c
+++ b/bsd-user/main.c
@@ -24,7 +24,7 @@
 #include <sys/sysctl.h>
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
+#include "qemu/copyright.h"
 #include "qemu/units.h"
 #include "qemu/accel.h"
 #include "sysemu/tcg.h"
diff --git a/linux-user/main.c b/linux-user/main.c
index fbc9bcfd5f5f..744d216b1e8e 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -18,7 +18,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
+#include "qemu/copyright.h"
 #include "qemu/units.h"
 #include "qemu/accel.h"
 #include "sysemu/tcg.h"
diff --git a/qemu-img.c b/qemu-img.c
index 116e05867558..a2b1d3653a1e 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -25,7 +25,7 @@
 #include "qemu/osdep.h"
 #include <getopt.h>
 
-#include "qemu-common.h"
+#include "qemu/copyright.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 eb8afc8b413b..952a36643b0c 100644
--- a/qemu-io.c
+++ b/qemu-io.c
@@ -15,7 +15,7 @@
 #include <termios.h>
 #endif
 
-#include "qemu-common.h"
+#include "qemu/copyright.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 713e7557a9eb..f4d121c0c40e 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -21,7 +21,7 @@
 #include <libgen.h>
 #include <pthread.h>
 
-#include "qemu-common.h"
+#include "qemu/copyright.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 ac63d8e47802..8994f73e4735 100644
--- a/qga/main.c
+++ b/qga/main.c
@@ -18,7 +18,7 @@
 #include <syslog.h>
 #include <sys/wait.h>
 #endif
-#include "qemu-common.h"
+#include "qemu/copyright.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 f281daeced8d..e7549ffb3bc9 100644
--- a/scsi/qemu-pr-helper.c
+++ b/scsi/qemu-pr-helper.c
@@ -36,7 +36,7 @@
 #include <mpath_persist.h>
 #endif
 
-#include "qemu-common.h"
+#include "qemu/copyright.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 46aba6a039c4..b0bf16e16aaa 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -23,7 +23,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
+#include "qemu/copyright.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-storage-daemon.c
index eb724072579a..a4415e8c995b 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"
 
-#include "qemu-common.h"
+#include "qemu/copyright.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..8af28f5fb823 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/copyright.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..a2a74656fabf 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -27,7 +27,7 @@
 #import <Cocoa/Cocoa.h>
 #include <crt_externs.h>
 
-#include "qemu-common.h"
+#include "qemu/copyright.h"
 #include "qemu-main.h"
 #include "ui/clipboard.h"
 #include "ui/console.h"
-- 
2.35.1.693.g805e0a68082a



^ permalink raw reply related	[flat|nested] 124+ messages in thread

* [Virtio-fs] [PATCH 06/41] include: rename qemu-common.h qemu/copyright.h
@ 2022-04-20 13:25   ` marcandre.lureau
  0 siblings, 0 replies; 124+ messages in thread
From: marcandre.lureau @ 2022-04-20 13:25 UTC (permalink / raw)
  To: qemu-devel
  Cc: Marc-André Lureau, Warner Losh, Kyle Evans, Laurent Vivier,
	Kevin Wolf, Hanna Reitz, Eric Blake,
	Vladimir Sementsov-Ogievskiy, Michael Roth, Paolo Bonzini,
	Fam Zheng, Dr. David Alan Gilbert, Stefan Hajnoczi,
	Peter Maydell, Philippe Mathieu-Daudé,
	Akihiko Odaki, Gerd Hoffmann, open list:Block layer core,
	open list:virtiofs

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 include/{qemu-common.h => qemu/copyright.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 => qemu/copyright.h} (100%)

diff --git a/include/qemu-common.h b/include/qemu/copyright.h
similarity index 100%
rename from include/qemu-common.h
rename to include/qemu/copyright.h
diff --git a/bsd-user/main.c b/bsd-user/main.c
index 88d347d05ebf..aaab3f278534 100644
--- a/bsd-user/main.c
+++ b/bsd-user/main.c
@@ -24,7 +24,7 @@
 #include <sys/sysctl.h>
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
+#include "qemu/copyright.h"
 #include "qemu/units.h"
 #include "qemu/accel.h"
 #include "sysemu/tcg.h"
diff --git a/linux-user/main.c b/linux-user/main.c
index fbc9bcfd5f5f..744d216b1e8e 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -18,7 +18,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
+#include "qemu/copyright.h"
 #include "qemu/units.h"
 #include "qemu/accel.h"
 #include "sysemu/tcg.h"
diff --git a/qemu-img.c b/qemu-img.c
index 116e05867558..a2b1d3653a1e 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -25,7 +25,7 @@
 #include "qemu/osdep.h"
 #include <getopt.h>
 
-#include "qemu-common.h"
+#include "qemu/copyright.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 eb8afc8b413b..952a36643b0c 100644
--- a/qemu-io.c
+++ b/qemu-io.c
@@ -15,7 +15,7 @@
 #include <termios.h>
 #endif
 
-#include "qemu-common.h"
+#include "qemu/copyright.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 713e7557a9eb..f4d121c0c40e 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -21,7 +21,7 @@
 #include <libgen.h>
 #include <pthread.h>
 
-#include "qemu-common.h"
+#include "qemu/copyright.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 ac63d8e47802..8994f73e4735 100644
--- a/qga/main.c
+++ b/qga/main.c
@@ -18,7 +18,7 @@
 #include <syslog.h>
 #include <sys/wait.h>
 #endif
-#include "qemu-common.h"
+#include "qemu/copyright.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 f281daeced8d..e7549ffb3bc9 100644
--- a/scsi/qemu-pr-helper.c
+++ b/scsi/qemu-pr-helper.c
@@ -36,7 +36,7 @@
 #include <mpath_persist.h>
 #endif
 
-#include "qemu-common.h"
+#include "qemu/copyright.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 46aba6a039c4..b0bf16e16aaa 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -23,7 +23,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
+#include "qemu/copyright.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-storage-daemon.c
index eb724072579a..a4415e8c995b 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"
 
-#include "qemu-common.h"
+#include "qemu/copyright.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..8af28f5fb823 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/copyright.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..a2a74656fabf 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -27,7 +27,7 @@
 #import <Cocoa/Cocoa.h>
 #include <crt_externs.h>
 
-#include "qemu-common.h"
+#include "qemu/copyright.h"
 #include "qemu-main.h"
 #include "ui/clipboard.h"
 #include "ui/console.h"
-- 
2.35.1.693.g805e0a68082a


^ permalink raw reply related	[flat|nested] 124+ messages in thread

* [PATCH 07/41] build-sys: remove MSI's QEMU_GA_MSI_MINGW_DLL_PATH
  2022-04-20 13:25 [PATCH 00/41] Misc cleanups marcandre.lureau
                   ` (5 preceding siblings ...)
  2022-04-20 13:25   ` [Virtio-fs] " marcandre.lureau
@ 2022-04-20 13:25 ` marcandre.lureau
  2022-04-20 15:00   ` Konstantin Kostiuk
                     ` (2 more replies)
  2022-04-20 13:25 ` [PATCH 08/41] build-sys: simplify MSI's QEMU_GA_MANUFACTURER marcandre.lureau
                   ` (34 subsequent siblings)
  41 siblings, 3 replies; 124+ messages in thread
From: marcandre.lureau @ 2022-04-20 13:25 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau, Michael Roth

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Since the introduction of the variable in commit 9dacf32d2cb ("qemu-ga:
Building Windows MSI installation with configure/Makefile"), nothing
makes use of the Mingw_dlls variable in the .wxs file.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 configure       | 3 ---
 qga/meson.build | 1 -
 2 files changed, 4 deletions(-)

diff --git a/configure b/configure
index 7c08c18358be..8cbe55ac82e8 100755
--- a/configure
+++ b/configure
@@ -2704,8 +2704,6 @@ if test "$QEMU_GA_VERSION" = ""; then
     QEMU_GA_VERSION=$(cat $source_path/VERSION)
 fi
 
-QEMU_GA_MSI_MINGW_DLL_PATH="$($pkg_config --variable=prefix glib-2.0)/bin"
-
 # Mac OS X ships with a broken assembler
 roms=
 if { test "$cpu" = "i386" || test "$cpu" = "x86_64"; } && \
@@ -2792,7 +2790,6 @@ if test "$debug_tcg" = "yes" ; then
 fi
 if test "$mingw32" = "yes" ; then
   echo "CONFIG_WIN32=y" >> $config_host_mak
-  echo "QEMU_GA_MSI_MINGW_DLL_PATH=${QEMU_GA_MSI_MINGW_DLL_PATH}" >> $config_host_mak
   echo "QEMU_GA_MANUFACTURER=${QEMU_GA_MANUFACTURER}" >> $config_host_mak
   echo "QEMU_GA_DISTRO=${QEMU_GA_DISTRO}" >> $config_host_mak
   echo "QEMU_GA_VERSION=${QEMU_GA_VERSION}" >> $config_host_mak
diff --git a/qga/meson.build b/qga/meson.build
index 392d56094198..da5e5efb19e8 100644
--- a/qga/meson.build
+++ b/qga/meson.build
@@ -129,7 +129,6 @@ if targetos == 'windows'
                               wixl, '-o', '@OUTPUT0@', '@INPUT0@',
                               qemu_ga_msi_arch[cpu],
                               qemu_ga_msi_vss,
-                              '-D', 'Mingw_dlls=' + config_host['QEMU_GA_MSI_MINGW_DLL_PATH'],
                             ])
     all_qga += [qga_msi]
     alias_target('msi', qga_msi)
-- 
2.35.1.693.g805e0a68082a



^ permalink raw reply related	[flat|nested] 124+ messages in thread

* [PATCH 08/41] build-sys: simplify MSI's QEMU_GA_MANUFACTURER
  2022-04-20 13:25 [PATCH 00/41] Misc cleanups marcandre.lureau
                   ` (6 preceding siblings ...)
  2022-04-20 13:25 ` [PATCH 07/41] build-sys: remove MSI's QEMU_GA_MSI_MINGW_DLL_PATH marcandre.lureau
@ 2022-04-20 13:25 ` marcandre.lureau
  2022-04-20 13:48   ` Konstantin Kostiuk
  2022-04-20 13:25 ` [PATCH 09/41] build-sys: simplify MSI's QEMU_GA_VERSION marcandre.lureau
                   ` (33 subsequent siblings)
  41 siblings, 1 reply; 124+ messages in thread
From: marcandre.lureau @ 2022-04-20 13:25 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau, Michael Roth, Konstantin Kostiuk

From: Marc-André Lureau <marcandre.lureau@redhat.com>

If there is any reason to allow customization of this variable, we
should provide a proper configure option.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 configure                 |  4 ----
 qga/installer/qemu-ga.wxs | 10 ++++------
 qga/meson.build           |  1 -
 3 files changed, 4 insertions(+), 11 deletions(-)

diff --git a/configure b/configure
index 8cbe55ac82e8..5ac653b21351 100755
--- a/configure
+++ b/configure
@@ -2694,9 +2694,6 @@ fi
 
 # Guest agent Windows MSI package
 
-if test "$QEMU_GA_MANUFACTURER" = ""; then
-  QEMU_GA_MANUFACTURER=QEMU
-fi
 if test "$QEMU_GA_DISTRO" = ""; then
   QEMU_GA_DISTRO=Linux
 fi
@@ -2790,7 +2787,6 @@ if test "$debug_tcg" = "yes" ; then
 fi
 if test "$mingw32" = "yes" ; then
   echo "CONFIG_WIN32=y" >> $config_host_mak
-  echo "QEMU_GA_MANUFACTURER=${QEMU_GA_MANUFACTURER}" >> $config_host_mak
   echo "QEMU_GA_DISTRO=${QEMU_GA_DISTRO}" >> $config_host_mak
   echo "QEMU_GA_VERSION=${QEMU_GA_VERSION}" >> $config_host_mak
 else
diff --git a/qga/installer/qemu-ga.wxs b/qga/installer/qemu-ga.wxs
index 0950e8c6becc..53d836c06a96 100644
--- a/qga/installer/qemu-ga.wxs
+++ b/qga/installer/qemu-ga.wxs
@@ -8,9 +8,7 @@
     <?error Environment variable QEMU_GA_DISTRO undefined?>
   <?endif?>
 
-  <?ifndef env.QEMU_GA_MANUFACTURER ?>
-    <?error Environment variable QEMU_GA_MANUFACTURER undefined?>
-  <?endif?>
+  <?define QEMU_GA_MANUFACTURER = "QEMU" ?>
 
   <?ifndef var.Arch?>
     <?error Define Arch to 32 or 64?>
@@ -43,14 +41,14 @@
     Name="QEMU guest agent"
     Id="*"
     UpgradeCode="{EB6B8302-C06E-4BEC-ADAC-932C68A3A98D}"
-    Manufacturer="$(env.QEMU_GA_MANUFACTURER)"
+    Manufacturer="$(var.QEMU_GA_MANUFACTURER)"
     Version="$(env.QEMU_GA_VERSION)"
     Language="1033">
     <?if $(var.Arch) = 32 ?>
     <Condition Message="Error: 32-bit version of Qemu GA can not be installed on 64-bit Windows.">NOT VersionNT64</Condition>
     <?endif?>
     <Package
-      Manufacturer="$(env.QEMU_GA_MANUFACTURER)"
+      Manufacturer="$(var.QEMU_GA_MANUFACTURER)"
       InstallerVersion="200"
       Languages="1033"
       Compressed="yes"
@@ -133,7 +131,7 @@
           </Component>
           <Component Id="registry_entries" Guid="{D075D109-51CA-11E3-9F8B-000C29858960}">
             <RegistryKey Root="HKLM"
-                         Key="Software\$(env.QEMU_GA_MANUFACTURER)\$(env.QEMU_GA_DISTRO)\Tools\QemuGA">
+                         Key="Software\$(var.QEMU_GA_MANUFACTURER)\$(env.QEMU_GA_DISTRO)\Tools\QemuGA">
               <RegistryValue Type="string" Name="ProductID" Value="fb0a0d66-c7fb-4e2e-a16b-c4a3bfe8d13b" />
               <RegistryValue Type="string" Name="Version" Value="$(env.QEMU_GA_VERSION)" />
             </RegistryKey>
diff --git a/qga/meson.build b/qga/meson.build
index da5e5efb19e8..6e57de430d29 100644
--- a/qga/meson.build
+++ b/qga/meson.build
@@ -123,7 +123,6 @@ if targetos == 'windows'
                             command: [
                               find_program('env'),
                               'QEMU_GA_VERSION=' + config_host['QEMU_GA_VERSION'],
-                              'QEMU_GA_MANUFACTURER=' + config_host['QEMU_GA_MANUFACTURER'],
                               'QEMU_GA_DISTRO=' + config_host['QEMU_GA_DISTRO'],
                               'BUILD_DIR=' + meson.build_root(),
                               wixl, '-o', '@OUTPUT0@', '@INPUT0@',
-- 
2.35.1.693.g805e0a68082a



^ permalink raw reply related	[flat|nested] 124+ messages in thread

* [PATCH 09/41] build-sys: simplify MSI's QEMU_GA_VERSION
  2022-04-20 13:25 [PATCH 00/41] Misc cleanups marcandre.lureau
                   ` (7 preceding siblings ...)
  2022-04-20 13:25 ` [PATCH 08/41] build-sys: simplify MSI's QEMU_GA_MANUFACTURER marcandre.lureau
@ 2022-04-20 13:25 ` marcandre.lureau
  2022-04-20 13:25 ` [PATCH 10/41] build-sys: drop MSI's QEMU_GA_DISTRO marcandre.lureau
                   ` (32 subsequent siblings)
  41 siblings, 0 replies; 124+ messages in thread
From: marcandre.lureau @ 2022-04-20 13:25 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau, Michael Roth, Konstantin Kostiuk

From: Marc-André Lureau <marcandre.lureau@redhat.com>

No need to pass it from configure environment down to wixl. Let simply
set a wixl -D variable. If it needs to be configurable, we should have a
proper option.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 configure                 |  4 ----
 qga/installer/qemu-ga.wxs | 10 +++++-----
 qga/meson.build           |  2 +-
 3 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/configure b/configure
index 5ac653b21351..321e66809234 100755
--- a/configure
+++ b/configure
@@ -2697,9 +2697,6 @@ fi
 if test "$QEMU_GA_DISTRO" = ""; then
   QEMU_GA_DISTRO=Linux
 fi
-if test "$QEMU_GA_VERSION" = ""; then
-    QEMU_GA_VERSION=$(cat $source_path/VERSION)
-fi
 
 # Mac OS X ships with a broken assembler
 roms=
@@ -2788,7 +2785,6 @@ fi
 if test "$mingw32" = "yes" ; then
   echo "CONFIG_WIN32=y" >> $config_host_mak
   echo "QEMU_GA_DISTRO=${QEMU_GA_DISTRO}" >> $config_host_mak
-  echo "QEMU_GA_VERSION=${QEMU_GA_VERSION}" >> $config_host_mak
 else
   echo "CONFIG_POSIX=y" >> $config_host_mak
 fi
diff --git a/qga/installer/qemu-ga.wxs b/qga/installer/qemu-ga.wxs
index 53d836c06a96..2c49a2336e11 100644
--- a/qga/installer/qemu-ga.wxs
+++ b/qga/installer/qemu-ga.wxs
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
-  <?ifndef env.QEMU_GA_VERSION ?>
-    <?error Environment variable QEMU_GA_VERSION undefined?>
+  <?ifndef var.QEMU_GA_VERSION ?>
+    <?error Variable QEMU_GA_VERSION undefined ?>
   <?endif?>
 
   <?ifndef env.QEMU_GA_DISTRO ?>
@@ -42,7 +42,7 @@
     Id="*"
     UpgradeCode="{EB6B8302-C06E-4BEC-ADAC-932C68A3A98D}"
     Manufacturer="$(var.QEMU_GA_MANUFACTURER)"
-    Version="$(env.QEMU_GA_VERSION)"
+    Version="$(var.QEMU_GA_VERSION)"
     Language="1033">
     <?if $(var.Arch) = 32 ?>
     <Condition Message="Error: 32-bit version of Qemu GA can not be installed on 64-bit Windows.">NOT VersionNT64</Condition>
@@ -54,7 +54,7 @@
       Compressed="yes"
       InstallScope="perMachine"
       />
-    <Media Id="1" Cabinet="qemu_ga.$(env.QEMU_GA_VERSION).cab" EmbedCab="yes" />
+    <Media Id="1" Cabinet="qemu_ga.$(var.QEMU_GA_VERSION).cab" EmbedCab="yes" />
     <Property Id="WHSLogo">1</Property>
     <MajorUpgrade
       DowngradeErrorMessage="Error: A newer version of QEMU guest agent is already installed."
@@ -133,7 +133,7 @@
             <RegistryKey Root="HKLM"
                          Key="Software\$(var.QEMU_GA_MANUFACTURER)\$(env.QEMU_GA_DISTRO)\Tools\QemuGA">
               <RegistryValue Type="string" Name="ProductID" Value="fb0a0d66-c7fb-4e2e-a16b-c4a3bfe8d13b" />
-              <RegistryValue Type="string" Name="Version" Value="$(env.QEMU_GA_VERSION)" />
+              <RegistryValue Type="string" Name="Version" Value="$(var.QEMU_GA_VERSION)" />
             </RegistryKey>
           </Component>
         </Directory>
diff --git a/qga/meson.build b/qga/meson.build
index 6e57de430d29..fb437062612e 100644
--- a/qga/meson.build
+++ b/qga/meson.build
@@ -122,12 +122,12 @@ if targetos == 'windows'
                             depends: deps,
                             command: [
                               find_program('env'),
-                              'QEMU_GA_VERSION=' + config_host['QEMU_GA_VERSION'],
                               'QEMU_GA_DISTRO=' + config_host['QEMU_GA_DISTRO'],
                               'BUILD_DIR=' + meson.build_root(),
                               wixl, '-o', '@OUTPUT0@', '@INPUT0@',
                               qemu_ga_msi_arch[cpu],
                               qemu_ga_msi_vss,
+                              '-D', 'QEMU_GA_VERSION=' + meson.project_version(),
                             ])
     all_qga += [qga_msi]
     alias_target('msi', qga_msi)
-- 
2.35.1.693.g805e0a68082a



^ permalink raw reply related	[flat|nested] 124+ messages in thread

* [PATCH 10/41] build-sys: drop MSI's QEMU_GA_DISTRO
  2022-04-20 13:25 [PATCH 00/41] Misc cleanups marcandre.lureau
                   ` (8 preceding siblings ...)
  2022-04-20 13:25 ` [PATCH 09/41] build-sys: simplify MSI's QEMU_GA_VERSION marcandre.lureau
@ 2022-04-20 13:25 ` marcandre.lureau
  2022-04-20 13:25 ` [PATCH 11/41] qga: replace usleep() with g_usleep() marcandre.lureau
                   ` (31 subsequent siblings)
  41 siblings, 0 replies; 124+ messages in thread
From: marcandre.lureau @ 2022-04-20 13:25 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau, Michael Roth, Konstantin Kostiuk

From: Marc-André Lureau <marcandre.lureau@redhat.com>

The variable doesn't have much use, and is not easily discoverable (from
configure time option, or as installed registry value).

Eventually, QEMU_GA_MANUFACTURER customization could cover the need for
a specialized registry key or directory path, but as in its current
form, they don't really help.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 configure                 | 5 -----
 qga/installer/qemu-ga.wxs | 6 +-----
 qga/meson.build           | 1 -
 3 files changed, 1 insertion(+), 11 deletions(-)

diff --git a/configure b/configure
index 321e66809234..3fd2c91e0d76 100755
--- a/configure
+++ b/configure
@@ -2694,10 +2694,6 @@ fi
 
 # Guest agent Windows MSI package
 
-if test "$QEMU_GA_DISTRO" = ""; then
-  QEMU_GA_DISTRO=Linux
-fi
-
 # Mac OS X ships with a broken assembler
 roms=
 if { test "$cpu" = "i386" || test "$cpu" = "x86_64"; } && \
@@ -2784,7 +2780,6 @@ if test "$debug_tcg" = "yes" ; then
 fi
 if test "$mingw32" = "yes" ; then
   echo "CONFIG_WIN32=y" >> $config_host_mak
-  echo "QEMU_GA_DISTRO=${QEMU_GA_DISTRO}" >> $config_host_mak
 else
   echo "CONFIG_POSIX=y" >> $config_host_mak
 fi
diff --git a/qga/installer/qemu-ga.wxs b/qga/installer/qemu-ga.wxs
index 2c49a2336e11..768bc35d1159 100644
--- a/qga/installer/qemu-ga.wxs
+++ b/qga/installer/qemu-ga.wxs
@@ -4,10 +4,6 @@
     <?error Variable QEMU_GA_VERSION undefined ?>
   <?endif?>
 
-  <?ifndef env.QEMU_GA_DISTRO ?>
-    <?error Environment variable QEMU_GA_DISTRO undefined?>
-  <?endif?>
-
   <?define QEMU_GA_MANUFACTURER = "QEMU" ?>
 
   <?ifndef var.Arch?>
@@ -131,7 +127,7 @@
           </Component>
           <Component Id="registry_entries" Guid="{D075D109-51CA-11E3-9F8B-000C29858960}">
             <RegistryKey Root="HKLM"
-                         Key="Software\$(var.QEMU_GA_MANUFACTURER)\$(env.QEMU_GA_DISTRO)\Tools\QemuGA">
+                         Key="Software\$(var.QEMU_GA_MANUFACTURER)\Tools\QemuGA">
               <RegistryValue Type="string" Name="ProductID" Value="fb0a0d66-c7fb-4e2e-a16b-c4a3bfe8d13b" />
               <RegistryValue Type="string" Name="Version" Value="$(var.QEMU_GA_VERSION)" />
             </RegistryKey>
diff --git a/qga/meson.build b/qga/meson.build
index fb437062612e..40a7baabfde3 100644
--- a/qga/meson.build
+++ b/qga/meson.build
@@ -122,7 +122,6 @@ if targetos == 'windows'
                             depends: deps,
                             command: [
                               find_program('env'),
-                              'QEMU_GA_DISTRO=' + config_host['QEMU_GA_DISTRO'],
                               'BUILD_DIR=' + meson.build_root(),
                               wixl, '-o', '@OUTPUT0@', '@INPUT0@',
                               qemu_ga_msi_arch[cpu],
-- 
2.35.1.693.g805e0a68082a



^ permalink raw reply related	[flat|nested] 124+ messages in thread

* [PATCH 11/41] qga: replace usleep() with g_usleep()
  2022-04-20 13:25 [PATCH 00/41] Misc cleanups marcandre.lureau
                   ` (9 preceding siblings ...)
  2022-04-20 13:25 ` [PATCH 10/41] build-sys: drop MSI's QEMU_GA_DISTRO marcandre.lureau
@ 2022-04-20 13:25 ` marcandre.lureau
  2022-04-20 15:16   ` Daniel P. Berrangé
  2022-04-20 13:25 ` [PATCH 12/41] docs: trace-events-all is installed without renaming marcandre.lureau
                   ` (30 subsequent siblings)
  41 siblings, 1 reply; 124+ messages in thread
From: marcandre.lureau @ 2022-04-20 13:25 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau, Michael Roth

From: Marc-André Lureau <marcandre.lureau@redhat.com>

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é Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 qga/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qga/main.c b/qga/main.c
index 8994f73e4735..b1dae0659d16 100644
--- a/qga/main.c
+++ b/qga/main.c
@@ -609,7 +609,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:
-- 
2.35.1.693.g805e0a68082a



^ permalink raw reply related	[flat|nested] 124+ messages in thread

* [PATCH 12/41] docs: trace-events-all is installed without renaming
  2022-04-20 13:25 [PATCH 00/41] Misc cleanups marcandre.lureau
                   ` (10 preceding siblings ...)
  2022-04-20 13:25 ` [PATCH 11/41] qga: replace usleep() with g_usleep() marcandre.lureau
@ 2022-04-20 13:25 ` marcandre.lureau
  2022-04-20 15:16   ` Daniel P. Berrangé
  2022-04-20 13:25 ` [PATCH 13/41] arm/digic: replace snprintf() with g_strdup_printf() marcandre.lureau
                   ` (29 subsequent siblings)
  41 siblings, 1 reply; 124+ messages in thread
From: marcandre.lureau @ 2022-04-20 13:25 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau, Stefan Hajnoczi

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Signed-off-by: Marc-André Lureau <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 listed subdirectory will be
 processed by the "tracetool" script to generate code for the trace events.
 
 The individual "trace-events" files are merged into a "trace-events-all" file,
-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 analyse
 traces in the simpletrace data format.
 
-- 
2.35.1.693.g805e0a68082a



^ permalink raw reply related	[flat|nested] 124+ messages in thread

* [PATCH 13/41] arm/digic: replace snprintf() with g_strdup_printf()
  2022-04-20 13:25 [PATCH 00/41] Misc cleanups marcandre.lureau
                   ` (11 preceding siblings ...)
  2022-04-20 13:25 ` [PATCH 12/41] docs: trace-events-all is installed without renaming marcandre.lureau
@ 2022-04-20 13:25 ` marcandre.lureau
  2022-04-20 15:17   ` Daniel P. Berrangé
  2022-04-20 13:25 ` [PATCH 14/41] arm/allwinner-a10: " marcandre.lureau
                   ` (28 subsequent siblings)
  41 siblings, 1 reply; 124+ messages in thread
From: marcandre.lureau @ 2022-04-20 13:25 UTC (permalink / raw)
  To: qemu-devel
  Cc: Marc-André Lureau, open list:Canon DIGIC, Antony Pavlov,
	Peter Maydell

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Also fixes a GCC 12.0.1 false-positive:
../hw/arm/digic.c: In function ‘digic_init’:
../hw/arm/digic.c:45:54: error: ‘%d’ directive output may be truncated writing between 1 and 11 bytes into a region of size 5 [-Werror=format-truncation=]
   45 |         snprintf(name, DIGIC_TIMER_NAME_MLEN, "timer[%d]", i);
      |                                                      ^~

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
---
 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"));
 
     for (i = 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 = g_strdup_printf("timer[%d]", i);
         object_initialize_child(obj, name, &s->timer[i], TYPE_DIGIC_TIMER);
     }
 
-- 
2.35.1.693.g805e0a68082a



^ permalink raw reply related	[flat|nested] 124+ messages in thread

* [PATCH 14/41] arm/allwinner-a10: replace snprintf() with g_strdup_printf()
  2022-04-20 13:25 [PATCH 00/41] Misc cleanups marcandre.lureau
                   ` (12 preceding siblings ...)
  2022-04-20 13:25 ` [PATCH 13/41] arm/digic: replace snprintf() with g_strdup_printf() marcandre.lureau
@ 2022-04-20 13:25 ` marcandre.lureau
  2022-04-20 15:17   ` Daniel P. Berrangé
  2022-04-20 13:25 ` [PATCH 15/41] intc/exynos4210_gic: " marcandre.lureau
                   ` (27 subsequent siblings)
  41 siblings, 1 reply; 124+ messages in thread
From: marcandre.lureau @ 2022-04-20 13:25 UTC (permalink / raw)
  To: qemu-devel
  Cc: Beniamino Galvani, Marc-André Lureau,
	open list:Allwinner-a10, Peter Maydell

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Also fixes a GCC 12.0.1 false-positive:
../hw/arm/allwinner-a10.c: In function ‘aw_a10_realize’:
../hw/arm/allwinner-a10.c:135:35: error: ‘%d’ directive writing between 1 and 11 bytes into a region of size 8 [-Werror=format-overflow=]
  135 |             sprintf(bus, "usb-bus.%d", i);
      |                                   ^~

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
---
 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 **errp)
         int i;
 
         for (i = 0; i < AW_A10_NUM_USB; i++) {
-            char bus[16];
-
-            sprintf(bus, "usb-bus.%d", i);
+            g_autofree char *bus = g_strdup_printf("usb-bus.%d", i);
 
             object_property_set_bool(OBJECT(&s->ehci[i]), "companion-enable",
                                      true, &error_fatal);
-- 
2.35.1.693.g805e0a68082a



^ permalink raw reply related	[flat|nested] 124+ messages in thread

* [PATCH 15/41] intc/exynos4210_gic: replace snprintf() with g_strdup_printf()
  2022-04-20 13:25 [PATCH 00/41] Misc cleanups marcandre.lureau
                   ` (13 preceding siblings ...)
  2022-04-20 13:25 ` [PATCH 14/41] arm/allwinner-a10: " marcandre.lureau
@ 2022-04-20 13:25 ` marcandre.lureau
  2022-04-20 15:19   ` Daniel P. Berrangé
  2022-04-20 13:25 ` [PATCH 16/41] doc/style: CLang -> Clang marcandre.lureau
                   ` (26 subsequent siblings)
  41 siblings, 1 reply; 124+ messages in thread
From: marcandre.lureau @ 2022-04-20 13:25 UTC (permalink / raw)
  To: qemu-devel
  Cc: Igor Mitsyanko, Marc-André Lureau, open list:Exynos, Peter Maydell

From: Marc-André Lureau <marcandre.lureau@redhat.com>

While at it, replace '%x' with '%u' as suggested by Philippe Mathieu-Daudé.

Also fixes a GCC 12.0.1 -Wformat-overflow false-positive.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
---
 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, Error **errp)
     Object *obj = OBJECT(dev);
     Exynos4210GicState *s = EXYNOS4210_GIC(obj);
     SysBusDevice *sbd = SYS_BUS_DEVICE(obj);
-    const char cpu_prefix[] = "exynos4210-gic-alias_cpu";
-    const char dist_prefix[] = "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 = s->num_cpu;
     uint32_t i;
@@ -322,8 +318,10 @@ static void exynos4210_gic_realize(DeviceState *dev, Error **errp)
      */
     assert(n <= EXYNOS4210_NCPUS);
     for (i = 0; i < n; i++) {
+        g_autofree char *cpu_alias_name = g_strdup_printf("exynos4210-gic-alias_cpu%u", i);
+        g_autofree char *dist_alias_name = g_strdup_printf("exynos4210-gic-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, Error **errp)
                 EXYNOS4210_EXT_GIC_CPU_GET_OFFSET(i), &s->cpu_alias[i]);
 
         /* 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),
-- 
2.35.1.693.g805e0a68082a



^ permalink raw reply related	[flat|nested] 124+ messages in thread

* [PATCH 16/41] doc/style: CLang -> Clang
  2022-04-20 13:25 [PATCH 00/41] Misc cleanups marcandre.lureau
                   ` (14 preceding siblings ...)
  2022-04-20 13:25 ` [PATCH 15/41] intc/exynos4210_gic: " marcandre.lureau
@ 2022-04-20 13:25 ` marcandre.lureau
  2022-04-20 15:20   ` Daniel P. Berrangé
  2022-04-20 13:26 ` [PATCH 17/41] doc/build-platforms: document supported compilers marcandre.lureau
                   ` (25 subsequent siblings)
  41 siblings, 1 reply; 124+ messages in thread
From: marcandre.lureau @ 2022-04-20 13:25 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau

From: Marc-André Lureau <marcandre.lureau@redhat.com>

It's not the way it is usually written (see https://clang.llvm.org/).

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Damien Hedde <damien.hedde@greensocs.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 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 starting at version 4.0.
 Automatic memory deallocation
 =============================
 
-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,
-- 
2.35.1.693.g805e0a68082a



^ permalink raw reply related	[flat|nested] 124+ messages in thread

* [PATCH 17/41] doc/build-platforms: document supported compilers
  2022-04-20 13:25 [PATCH 00/41] Misc cleanups marcandre.lureau
                   ` (15 preceding siblings ...)
  2022-04-20 13:25 ` [PATCH 16/41] doc/style: CLang -> Clang marcandre.lureau
@ 2022-04-20 13:26 ` marcandre.lureau
  2022-04-20 14:10   ` Daniel P. Berrangé
  2022-04-20 13:26 ` [PATCH 18/41] osdep.h: move qemu_build_not_reached() marcandre.lureau
                   ` (24 subsequent siblings)
  41 siblings, 1 reply; 124+ messages in thread
From: marcandre.lureau @ 2022-04-20 13:26 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau

From: Marc-André Lureau <marcandre.lureau@redhat.com>

According to our configure checks, this is the list of supported
compilers.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Damien Hedde <damien.hedde@greensocs.com>
---
 docs/about/build-platforms.rst | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/docs/about/build-platforms.rst b/docs/about/build-platforms.rst
index c29a4b8fe649..1980c5d2476f 100644
--- a/docs/about/build-platforms.rst
+++ b/docs/about/build-platforms.rst
@@ -92,6 +92,16 @@ hosted on Linux (Debian/Fedora).
 The version of the Windows API that's currently targeted is Vista / Server
 2008.
 
+Supported compilers
+-------------------
+
+To compile, QEMU requires either:
+
+- GCC >= 7.4.0
+- Clang >= 6.0
+- XCode Clang >= 10.0
+
+
 .. _HomeBrew: https://brew.sh/
 .. _MacPorts: https://www.macports.org/
 .. _Repology: https://repology.org/
-- 
2.35.1.693.g805e0a68082a



^ permalink raw reply related	[flat|nested] 124+ messages in thread

* [PATCH 18/41] osdep.h: move qemu_build_not_reached()
  2022-04-20 13:25 [PATCH 00/41] Misc cleanups marcandre.lureau
                   ` (16 preceding siblings ...)
  2022-04-20 13:26 ` [PATCH 17/41] doc/build-platforms: document supported compilers marcandre.lureau
@ 2022-04-20 13:26 ` marcandre.lureau
  2022-04-20 15:27   ` Daniel P. Berrangé
  2022-04-20 13:26   ` marcandre.lureau
                   ` (23 subsequent siblings)
  41 siblings, 1 reply; 124+ messages in thread
From: marcandre.lureau @ 2022-04-20 13:26 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau

From: Marc-André Lureau <marcandre.lureau@redhat.com>

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é Lureau <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
 
-/**
- * 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
 
+/**
+ * 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
-- 
2.35.1.693.g805e0a68082a



^ permalink raw reply related	[flat|nested] 124+ messages in thread

* [PATCH 19/41] compiler.h: replace QEMU_NORETURN with G_NORETURN
  2022-04-20 13:25 [PATCH 00/41] Misc cleanups marcandre.lureau
@ 2022-04-20 13:26   ` marcandre.lureau
  2022-04-20 13:25 ` [PATCH 02/41] glib-compat: isolate g_date_time_format_iso8601 version-bypass marcandre.lureau
                     ` (40 subsequent siblings)
  41 siblings, 0 replies; 124+ messages in thread
From: marcandre.lureau @ 2022-04-20 13:26 UTC (permalink / raw)
  To: qemu-devel
  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, Marc-André Lureau,
	Artyom Tarasenko, Kevin Wolf, Aleksandar Rikalo, Kyle Evans,
	Richard Henderson, Dr. David Alan Gilbert, Greg Kurz,
	open list:S390 TCG CPUs, open list:ARM TCG CPUs,
	Cédric Le Goater, open list:PowerPC TCG CPUs,
	Stafford Horne, Alex Bennée, David Gibson, Eduardo Habkost,
	open list:RISC-V TCG CPUs, open list:Block layer core,
	Bastian Koppelmann, Chris Wulff, Philippe Mathieu-Daudé,
	Hanna Reitz, Palmer Dabbelt, Paolo Bonzini, Aurelien Jarno

From: Marc-André Lureau <marcandre.lureau@redhat.com>

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é Lureau <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);
 
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, TranslationBlock *tb,
  */
 bool cpu_restore_state(CPUState *cpu, uintptr_t searched_pc, bool will_exit);
 
-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);
 
 /**
  * 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);
 
 /**
  * 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);
 
 #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
 
 #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)
 
 #pragma GCC diagnostic pop
 
+#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, vaddr addr, vaddr len);
  */
 AddressSpace *cpu_get_address_space(CPUState *cpu, int asidx);
 
-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);
 
 /* $(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_NORETURN;
+    G_NORETURN void (*do_unaligned_access)(CPUState *cpu, vaddr addr,
+                                           MMUAccessType access_type,
+                                           int mmu_idx, uintptr_t retaddr);
 
     /**
      * @adjust_watchpoint_address: hack for cpu_check_watchpoint used by ARM
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
 
-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);
 
 #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
 
-#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);
 
 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 addr, uint64_t val,
 
 #else
 
-void QEMU_NORETURN helper_unaligned_ld(CPUArchState *env, target_ulong addr);
-void QEMU_NORETURN helper_unaligned_st(CPUArchState *env, target_ulong addr);
+G_NORETURN void helper_unaligned_ld(CPUArchState *env, target_ulong addr);
+G_NORETURN void helper_unaligned_st(CPUArchState *env, target_ulong addr);
 
 #endif /* CONFIG_SOFTMMU */
 #endif /* TCG_LDST_H */
diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h
index 73869fd9d04f..688d1fb46077 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
 
 /* 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 @@
  */
 
 /* 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))
 
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
 
 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);
 
 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 address,
 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, int 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);
 
 /*
  * 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_el,
                                       uintptr_t ra);
 
@@ -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);
 
 /* Raise a data fault alignment exception for the specified virtual address */
-void arm_cpu_do_unaligned_access(CPUState *cs, vaddr vaddr,
-                                 MMUAccessType access_type,
-                                 int mmu_idx, uintptr_t retaddr) QEMU_NORETURN;
+G_NORETURN void arm_cpu_do_unaligned_access(CPUState *cs, vaddr vaddr,
+                                            MMUAccessType access_type,
+                                            int mmu_idx, uintptr_t retaddr);
 
 /* 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 ra);
 
 #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);
 
 /* excp_helper.c */
-void QEMU_NORETURN raise_exception(CPUX86State *env, int exception_index);
-void QEMU_NORETURN raise_exception_ra(CPUX86State *env, int exception_index,
-                                      uintptr_t retaddr);
-void QEMU_NORETURN raise_exception_err(CPUX86State *env, int exception_index,
-                                       int error_code);
-void QEMU_NORETURN raise_exception_err_ra(CPUX86State *env, int exception_index,
-                                          int error_code, uintptr_t retaddr);
-void QEMU_NORETURN raise_interrupt(CPUX86State *nenv, int intno, int is_int,
-                                   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_index,
+                                       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);
 
 /* cc_helper.c */
 extern const uint8_t parity_table[256];
 
 /* 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);
 
 /* 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
 
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_NORETURN;
+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);
 
 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, int mmu_idx,
+                                             uintptr_t retaddr);
 
 const char *mips_exception_name(int32_t exception);
 
-void QEMU_NORETURN do_raise_exception_err(CPUMIPSState *env, uint32_t exception,
-                                          int error_code, uintptr_t pc);
+G_NORETURN void do_raise_exception_err(CPUMIPSState *env, uint32_t exception,
+                                       int error_code, uintptr_t pc);
 
-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, int mmu_idx,
+                                              uintptr_t retaddr);
 
 void do_nios2_semihosting(CPUNios2State *env);
 
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 @@
 
 #include "cpu.h"
 
-void QEMU_NORETURN raise_exception(OpenRISCCPU *cpu, uint32_t excp);
+G_NORETURN void raise_exception(OpenRISCCPU *cpu, uint32_t excp);
 
 #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
 
-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 exception,
-                                       uint32_t error_code);
-void QEMU_NORETURN raise_exception_err_ra(CPUPPCState *env, uint32_t exception,
-                                          uint32_t error_code, uintptr_t raddr);
+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 exception,
+                                       uint32_t error_code, uintptr_t raddr);
 
 /* 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
 
 #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, bool 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);
 
 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);
 
 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, int mmu_idx,
+                                              uintptr_t retaddr);
 #endif
 
 
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
 
 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 dxc,
-                                           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);
 
 #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);
 
 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);
 
 #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);
 
 #define cpu_list xtensa_cpu_list
 
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();
 }
 
-void QEMU_NORETURN cpu_loop_exit(CPUState *cpu)
+G_NORETURN void cpu_loop_exit(CPUState *cpu)
 {
     g_assert_not_reached();
 }
 
-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)
 }
 
 /* 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 = thread_cpu->env_ptr;
     CPUState *cpu = 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 = 0;
 }
 
-static void QEMU_NORETURN block_thread_and_exit(ITCStorageCell *c)
+static G_NORETURN
+void block_thread_and_exit(ITCStorageCell *c)
 {
     c->blocked_threads |= 1ULL << current_cpu->cpu_index;
     current_cpu->halted = 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 addr,
 }
 
 /* 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 = thread_cpu;
     CPUArchState *env = 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;
 
-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 a2b1d3653a1e..6077c947002d 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);
 }
 
-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;
 
@@ -112,18 +113,21 @@ static void QEMU_NORETURN G_GNUC_PRINTF(1, 2) error_exit(const char *fmt, ...)
     exit(EXIT_FAILURE);
 }
 
-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);
 }
 
-static void QEMU_NORETURN unrecognized_option(const char *option)
+static G_NORETURN
+void unrecognized_option(const char *option)
 {
     error_exit("unrecognized option '%s'", option);
 }
 
 /* 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 =
            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 flags)
 
 /* 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 = env_cpu(env);
 
@@ -524,8 +524,8 @@ void QEMU_NORETURN helper_excp(CPUAlphaState *env, int excp, int error)
 }
 
 /* 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 = env_cpu(env);
 
@@ -539,8 +539,8 @@ void QEMU_NORETURN dynamic_excp(CPUAlphaState *env, uintptr_t retaddr,
     cpu_loop_exit(cs);
 }
 
-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 = exc;
     env->trap_arg1 = 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);
 }
 
-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, ARMMMUFaultInfo *fi,
     return fsr;
 }
 
-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 = &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
 
 /* 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 = 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(CPUHexagonState *env,
     cpu_loop_exit_restore(cs, pc);
 }
 
-void QEMU_NORETURN HELPER(raise_exception)(CPUHexagonState *env, uint32_t excp)
+G_NORETURN void HELPER(raise_exception)(CPUHexagonState *env, uint32_t excp)
 {
     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, disassemble_info *info)
 }
 
 #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 = HPPA_CPU(cs);
     CPUHPPAState *env = &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"
 
-void QEMU_NORETURN HELPER(excp)(CPUHPPAState *env, int excp)
+G_NORETURN void HELPER(excp)(CPUHPPAState *env, int excp)
 {
     CPUState *cs = env_cpu(env);
 
@@ -36,7 +36,7 @@ void QEMU_NORETURN HELPER(excp)(CPUHPPAState *env, int excp)
     cpu_loop_exit(cs);
 }
 
-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 ra)
 {
     CPUState *cs = env_cpu(env);
 
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"
 
-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"
 
-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);
 }
 
-void QEMU_NORETURN helper_raise_exception(CPUX86State *env, int exception_index)
+G_NORETURN void helper_raise_exception(CPUX86State *env, int exception_index)
 {
     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 = env_cpu(env);
 
@@ -111,31 +112,31 @@ static void QEMU_NORETURN raise_interrupt2(CPUX86State *env, int intno,
 
 /* shortcuts to generate exceptions */
 
-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);
 }
 
-void QEMU_NORETURN raise_exception_err(CPUX86State *env, int exception_index,
-                                       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);
 }
 
-void QEMU_NORETURN raise_exception_err_ra(CPUX86State *env, int exception_index,
-                                          int error_code, uintptr_t retaddr)
+G_NORETURN void raise_exception_err_ra(CPUX86State *env, int exception_index,
+                                       int error_code, uintptr_t retaddr)
 {
     raise_interrupt2(env, exception_index, 0, error_code, 0, retaddr);
 }
 
-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);
 }
 
-void QEMU_NORETURN raise_exception_ra(CPUX86State *env, int exception_index,
-                                      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] = (uint32_t)(env->tsc_aux);
 }
 
-void QEMU_NORETURN helper_rdpmc(CPUX86State *env)
+G_NORETURN void helper_rdpmc(CPUX86State *env)
 {
     if (((env->cr[4] & CR4_PCE_MASK) == 0 ) &&
         ((env->hflags & HF_CPL_MASK) != 0)) {
@@ -94,7 +94,7 @@ void QEMU_NORETURN helper_rdpmc(CPUX86State *env)
     raise_exception_err(env, EXCP06_ILLOP, 0);
 }
 
-void QEMU_NORETURN do_pause(CPUX86State *env)
+G_NORETURN void do_pause(CPUX86State *env)
 {
     CPUState *cs = env_cpu(env);
 
@@ -103,7 +103,7 @@ void QEMU_NORETURN do_pause(CPUX86State *env)
     cpu_loop_exit(cs);
 }
 
-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 += 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 addr)
     tlb_flush_page(env_cpu(env), addr);
 }
 
-static void QEMU_NORETURN do_hlt(CPUX86State *env)
+static G_NORETURN
+void do_hlt(CPUX86State *env)
 {
     CPUState *cs = env_cpu(env);
 
@@ -481,7 +482,7 @@ static void QEMU_NORETURN do_hlt(CPUX86State *env)
     cpu_loop_exit(cs);
 }
 
-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 += 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());
 }
 
-void QEMU_NORETURN helper_mwait(CPUX86State *env, int next_eip_addend)
+G_NORETURN void helper_mwait(CPUX86State *env, int next_eip_addend)
 {
     CPUState *cs = env_cpu(env);
 
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"
 
-void QEMU_NORETURN raise_exception(OpenRISCCPU *cpu, uint32_t excp)
+G_NORETURN void raise_exception(OpenRISCCPU *cpu, uint32_t excp)
 {
     CPUState *cs = CPU(cpu);
 
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 excp)
     raise_exception(cpu, excp);
 }
 
-static void QEMU_NORETURN do_range(CPUOpenRISCState *env, uintptr_t pc)
+static G_NORETURN
+void do_range(CPUOpenRISCState *env, uintptr_t pc)
 {
     CPUState *cs = env_cpu(env);
 
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"
 
 /* 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 = env_cpu(env);
     cs->exception_index = 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"
 
-static inline void QEMU_NORETURN raise_exception(CPURXState *env, int index,
-                                                 uintptr_t retaddr);
+static inline G_NORETURN
+void raise_exception(CPURXState *env, int index,
+                     uintptr_t retaddr);
 
 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, uint32_t den)
 }
 
 /* exception */
-static inline void QEMU_NORETURN raise_exception(CPURXState *env, int index,
-                                                 uintptr_t retaddr)
+static inline G_NORETURN
+void raise_exception(CPURXState *env, int index,
+                     uintptr_t retaddr)
 {
     CPUState *cs = env_cpu(env);
 
@@ -427,22 +429,22 @@ static inline void QEMU_NORETURN raise_exception(CPURXState *env, int index,
     cpu_loop_exit_restore(cs, retaddr);
 }
 
-void QEMU_NORETURN helper_raise_privilege_violation(CPURXState *env)
+G_NORETURN void helper_raise_privilege_violation(CPURXState *env)
 {
     raise_exception(env, 20, GETPC());
 }
 
-void QEMU_NORETURN helper_raise_access_fault(CPURXState *env)
+G_NORETURN void helper_raise_access_fault(CPURXState *env)
 {
     raise_exception(env, 21, GETPC());
 }
 
-void QEMU_NORETURN helper_raise_illegal_instruction(CPURXState *env)
+G_NORETURN void helper_raise_illegal_instruction(CPURXState *env)
 {
     raise_exception(env, 23, GETPC());
 }
 
-void QEMU_NORETURN helper_wait(CPURXState *env)
+G_NORETURN void helper_wait(CPURXState *env)
 {
     CPUState *cs = env_cpu(env);
 
@@ -451,12 +453,12 @@ void QEMU_NORETURN helper_wait(CPURXState *env)
     raise_exception(env, EXCP_HLT, 0);
 }
 
-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);
 }
 
-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
 
-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 = env_cpu(env);
 
@@ -46,8 +46,8 @@ void QEMU_NORETURN tcg_s390_program_interrupt(CPUS390XState *env,
     cpu_loop_exit(cs);
 }
 
-void QEMU_NORETURN tcg_s390_data_exception(CPUS390XState *env, uint32_t dxc,
-                                           uintptr_t ra)
+G_NORETURN void tcg_s390_data_exception(CPUS390XState *env, uint32_t dxc,
+                                        uintptr_t ra)
 {
     g_assert(dxc <= 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);
 }
 
-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 <= 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 retaddr)
+static G_NORETURN
+void do_unaligned_access(CPUState *cs, uintptr_t retaddr)
 {
     S390CPU *cpu = S390_CPU(cs);
     CPUS390XState *env = &cpu->env;
@@ -620,9 +621,10 @@ void s390x_cpu_do_unaligned_access(CPUState *cs, vaddr addr,
     do_unaligned_access(cs, retaddr);
 }
 
-static void QEMU_NORETURN monitor_event(CPUS390XState *env,
-                                        uint64_t monitor_code,
-                                        uint8_t monitor_class, uintptr_t ra)
+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 lowcore */
     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
 }
 
-static inline void QEMU_NORETURN raise_exception(CPUSH4State *env, int index,
-                                                 uintptr_t retaddr)
+static inline G_NORETURN
+void raise_exception(CPUSH4State *env, int index,
+                     uintptr_t retaddr)
 {
     CPUState *cs = env_cpu(env);
 
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, vaddr addr)
 }
 
 #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 = SPARC_CPU(cs);
     CPUSPARCState *env = &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 @@
 
 /* Exception helpers */
 
-static void QEMU_NORETURN
-raise_exception_sync_internal(CPUTriCoreState *env, uint32_t class, int tin,
-                              uintptr_t pc, uint32_t fcd_pc)
+static G_NORETURN
+void raise_exception_sync_internal(CPUTriCoreState *env, uint32_t class, int tin,
+                                   uintptr_t pc, uint32_t fcd_pc)
 {
     CPUState *cs = 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 f8542529d030..6196c2ee4124 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -320,7 +320,8 @@ static void set_jmp_reset_offset(TCGContext *s, int which)
 }
 
 /* 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;
 }
 
-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[])
     }
 }
 
-static void QEMU_NORETURN run_test(void)
+static G_NORETURN
+void run_test(void)
 {
     unsigned int i;
 
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	= qr{
 our $Attribute	= qr{
 			const|
 			volatile|
-			QEMU_NORETURN|
+			G_NORETURN|
 			G_GNUC_WARN_UNUSED_RESULT|
 			G_GNUC_NULL_TERMINATED|
 			QEMU_PACKED|
-- 
2.35.1.693.g805e0a68082a



^ permalink raw reply related	[flat|nested] 124+ messages in thread

* [PATCH 19/41] compiler.h: replace QEMU_NORETURN with G_NORETURN
@ 2022-04-20 13:26   ` marcandre.lureau
  0 siblings, 0 replies; 124+ messages in thread
From: marcandre.lureau @ 2022-04-20 13:26 UTC (permalink / raw)
  To: qemu-devel
  Cc: Marc-André Lureau, Richard Henderson, Paolo Bonzini,
	Warner Losh, Kyle Evans, Philippe Mathieu-Daudé,
	Eduardo Habkost, Marcel Apfelbaum, Yanan Wang, Laurent Vivier,
	Dr. David Alan Gilbert, Kevin Wolf, Hanna Reitz, Peter Maydell,
	Taylor Simpson, Edgar E. Iglesias, Aurelien Jarno, Jiaxun Yang,
	Aleksandar Rikalo, Chris Wulff, Marek Vasut, Stafford Horne,
	Cédric Le Goater, Daniel Henrique Barboza, David Gibson,
	Greg Kurz, Palmer Dabbelt, Alistair Francis, Bin Meng,
	Yoshinori Sato, David Hildenbrand, Cornelia Huck, Thomas Huth,
	Mark Cave-Ayland, Artyom Tarasenko, Bastian Koppelmann,
	Max Filippov, Alex Bennée, open list:Block layer core,
	open list:ARM TCG CPUs, open list:PowerPC TCG CPUs,
	open list:RISC-V TCG CPUs, open list:S390 TCG CPUs

From: Marc-André Lureau <marcandre.lureau@redhat.com>

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é Lureau <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);
 
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, TranslationBlock *tb,
  */
 bool cpu_restore_state(CPUState *cpu, uintptr_t searched_pc, bool will_exit);
 
-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);
 
 /**
  * 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);
 
 /**
  * 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);
 
 #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
 
 #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)
 
 #pragma GCC diagnostic pop
 
+#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, vaddr addr, vaddr len);
  */
 AddressSpace *cpu_get_address_space(CPUState *cpu, int asidx);
 
-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);
 
 /* $(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_NORETURN;
+    G_NORETURN void (*do_unaligned_access)(CPUState *cpu, vaddr addr,
+                                           MMUAccessType access_type,
+                                           int mmu_idx, uintptr_t retaddr);
 
     /**
      * @adjust_watchpoint_address: hack for cpu_check_watchpoint used by ARM
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
 
-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);
 
 #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
 
-#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);
 
 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 addr, uint64_t val,
 
 #else
 
-void QEMU_NORETURN helper_unaligned_ld(CPUArchState *env, target_ulong addr);
-void QEMU_NORETURN helper_unaligned_st(CPUArchState *env, target_ulong addr);
+G_NORETURN void helper_unaligned_ld(CPUArchState *env, target_ulong addr);
+G_NORETURN void helper_unaligned_st(CPUArchState *env, target_ulong addr);
 
 #endif /* CONFIG_SOFTMMU */
 #endif /* TCG_LDST_H */
diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h
index 73869fd9d04f..688d1fb46077 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
 
 /* 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 @@
  */
 
 /* 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))
 
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
 
 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);
 
 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 address,
 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, int 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);
 
 /*
  * 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_el,
                                       uintptr_t ra);
 
@@ -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);
 
 /* Raise a data fault alignment exception for the specified virtual address */
-void arm_cpu_do_unaligned_access(CPUState *cs, vaddr vaddr,
-                                 MMUAccessType access_type,
-                                 int mmu_idx, uintptr_t retaddr) QEMU_NORETURN;
+G_NORETURN void arm_cpu_do_unaligned_access(CPUState *cs, vaddr vaddr,
+                                            MMUAccessType access_type,
+                                            int mmu_idx, uintptr_t retaddr);
 
 /* 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 ra);
 
 #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);
 
 /* excp_helper.c */
-void QEMU_NORETURN raise_exception(CPUX86State *env, int exception_index);
-void QEMU_NORETURN raise_exception_ra(CPUX86State *env, int exception_index,
-                                      uintptr_t retaddr);
-void QEMU_NORETURN raise_exception_err(CPUX86State *env, int exception_index,
-                                       int error_code);
-void QEMU_NORETURN raise_exception_err_ra(CPUX86State *env, int exception_index,
-                                          int error_code, uintptr_t retaddr);
-void QEMU_NORETURN raise_interrupt(CPUX86State *nenv, int intno, int is_int,
-                                   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_index,
+                                       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);
 
 /* cc_helper.c */
 extern const uint8_t parity_table[256];
 
 /* 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);
 
 /* 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
 
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_NORETURN;
+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);
 
 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, int mmu_idx,
+                                             uintptr_t retaddr);
 
 const char *mips_exception_name(int32_t exception);
 
-void QEMU_NORETURN do_raise_exception_err(CPUMIPSState *env, uint32_t exception,
-                                          int error_code, uintptr_t pc);
+G_NORETURN void do_raise_exception_err(CPUMIPSState *env, uint32_t exception,
+                                       int error_code, uintptr_t pc);
 
-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, int mmu_idx,
+                                              uintptr_t retaddr);
 
 void do_nios2_semihosting(CPUNios2State *env);
 
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 @@
 
 #include "cpu.h"
 
-void QEMU_NORETURN raise_exception(OpenRISCCPU *cpu, uint32_t excp);
+G_NORETURN void raise_exception(OpenRISCCPU *cpu, uint32_t excp);
 
 #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
 
-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 exception,
-                                       uint32_t error_code);
-void QEMU_NORETURN raise_exception_err_ra(CPUPPCState *env, uint32_t exception,
-                                          uint32_t error_code, uintptr_t raddr);
+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 exception,
+                                       uint32_t error_code, uintptr_t raddr);
 
 /* 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
 
 #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, bool 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);
 
 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);
 
 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, int mmu_idx,
+                                              uintptr_t retaddr);
 #endif
 
 
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
 
 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 dxc,
-                                           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);
 
 #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);
 
 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);
 
 #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);
 
 #define cpu_list xtensa_cpu_list
 
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();
 }
 
-void QEMU_NORETURN cpu_loop_exit(CPUState *cpu)
+G_NORETURN void cpu_loop_exit(CPUState *cpu)
 {
     g_assert_not_reached();
 }
 
-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)
 }
 
 /* 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 = thread_cpu->env_ptr;
     CPUState *cpu = 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 = 0;
 }
 
-static void QEMU_NORETURN block_thread_and_exit(ITCStorageCell *c)
+static G_NORETURN
+void block_thread_and_exit(ITCStorageCell *c)
 {
     c->blocked_threads |= 1ULL << current_cpu->cpu_index;
     current_cpu->halted = 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 addr,
 }
 
 /* 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 = thread_cpu;
     CPUArchState *env = 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;
 
-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 a2b1d3653a1e..6077c947002d 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);
 }
 
-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;
 
@@ -112,18 +113,21 @@ static void QEMU_NORETURN G_GNUC_PRINTF(1, 2) error_exit(const char *fmt, ...)
     exit(EXIT_FAILURE);
 }
 
-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);
 }
 
-static void QEMU_NORETURN unrecognized_option(const char *option)
+static G_NORETURN
+void unrecognized_option(const char *option)
 {
     error_exit("unrecognized option '%s'", option);
 }
 
 /* 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 =
            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 flags)
 
 /* 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 = env_cpu(env);
 
@@ -524,8 +524,8 @@ void QEMU_NORETURN helper_excp(CPUAlphaState *env, int excp, int error)
 }
 
 /* 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 = env_cpu(env);
 
@@ -539,8 +539,8 @@ void QEMU_NORETURN dynamic_excp(CPUAlphaState *env, uintptr_t retaddr,
     cpu_loop_exit(cs);
 }
 
-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 = exc;
     env->trap_arg1 = 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);
 }
 
-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, ARMMMUFaultInfo *fi,
     return fsr;
 }
 
-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 = &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
 
 /* 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 = 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(CPUHexagonState *env,
     cpu_loop_exit_restore(cs, pc);
 }
 
-void QEMU_NORETURN HELPER(raise_exception)(CPUHexagonState *env, uint32_t excp)
+G_NORETURN void HELPER(raise_exception)(CPUHexagonState *env, uint32_t excp)
 {
     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, disassemble_info *info)
 }
 
 #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 = HPPA_CPU(cs);
     CPUHPPAState *env = &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"
 
-void QEMU_NORETURN HELPER(excp)(CPUHPPAState *env, int excp)
+G_NORETURN void HELPER(excp)(CPUHPPAState *env, int excp)
 {
     CPUState *cs = env_cpu(env);
 
@@ -36,7 +36,7 @@ void QEMU_NORETURN HELPER(excp)(CPUHPPAState *env, int excp)
     cpu_loop_exit(cs);
 }
 
-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 ra)
 {
     CPUState *cs = env_cpu(env);
 
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"
 
-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"
 
-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);
 }
 
-void QEMU_NORETURN helper_raise_exception(CPUX86State *env, int exception_index)
+G_NORETURN void helper_raise_exception(CPUX86State *env, int exception_index)
 {
     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 = env_cpu(env);
 
@@ -111,31 +112,31 @@ static void QEMU_NORETURN raise_interrupt2(CPUX86State *env, int intno,
 
 /* shortcuts to generate exceptions */
 
-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);
 }
 
-void QEMU_NORETURN raise_exception_err(CPUX86State *env, int exception_index,
-                                       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);
 }
 
-void QEMU_NORETURN raise_exception_err_ra(CPUX86State *env, int exception_index,
-                                          int error_code, uintptr_t retaddr)
+G_NORETURN void raise_exception_err_ra(CPUX86State *env, int exception_index,
+                                       int error_code, uintptr_t retaddr)
 {
     raise_interrupt2(env, exception_index, 0, error_code, 0, retaddr);
 }
 
-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);
 }
 
-void QEMU_NORETURN raise_exception_ra(CPUX86State *env, int exception_index,
-                                      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] = (uint32_t)(env->tsc_aux);
 }
 
-void QEMU_NORETURN helper_rdpmc(CPUX86State *env)
+G_NORETURN void helper_rdpmc(CPUX86State *env)
 {
     if (((env->cr[4] & CR4_PCE_MASK) == 0 ) &&
         ((env->hflags & HF_CPL_MASK) != 0)) {
@@ -94,7 +94,7 @@ void QEMU_NORETURN helper_rdpmc(CPUX86State *env)
     raise_exception_err(env, EXCP06_ILLOP, 0);
 }
 
-void QEMU_NORETURN do_pause(CPUX86State *env)
+G_NORETURN void do_pause(CPUX86State *env)
 {
     CPUState *cs = env_cpu(env);
 
@@ -103,7 +103,7 @@ void QEMU_NORETURN do_pause(CPUX86State *env)
     cpu_loop_exit(cs);
 }
 
-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 += 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 addr)
     tlb_flush_page(env_cpu(env), addr);
 }
 
-static void QEMU_NORETURN do_hlt(CPUX86State *env)
+static G_NORETURN
+void do_hlt(CPUX86State *env)
 {
     CPUState *cs = env_cpu(env);
 
@@ -481,7 +482,7 @@ static void QEMU_NORETURN do_hlt(CPUX86State *env)
     cpu_loop_exit(cs);
 }
 
-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 += 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());
 }
 
-void QEMU_NORETURN helper_mwait(CPUX86State *env, int next_eip_addend)
+G_NORETURN void helper_mwait(CPUX86State *env, int next_eip_addend)
 {
     CPUState *cs = env_cpu(env);
 
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"
 
-void QEMU_NORETURN raise_exception(OpenRISCCPU *cpu, uint32_t excp)
+G_NORETURN void raise_exception(OpenRISCCPU *cpu, uint32_t excp)
 {
     CPUState *cs = CPU(cpu);
 
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 excp)
     raise_exception(cpu, excp);
 }
 
-static void QEMU_NORETURN do_range(CPUOpenRISCState *env, uintptr_t pc)
+static G_NORETURN
+void do_range(CPUOpenRISCState *env, uintptr_t pc)
 {
     CPUState *cs = env_cpu(env);
 
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"
 
 /* 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 = env_cpu(env);
     cs->exception_index = 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"
 
-static inline void QEMU_NORETURN raise_exception(CPURXState *env, int index,
-                                                 uintptr_t retaddr);
+static inline G_NORETURN
+void raise_exception(CPURXState *env, int index,
+                     uintptr_t retaddr);
 
 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, uint32_t den)
 }
 
 /* exception */
-static inline void QEMU_NORETURN raise_exception(CPURXState *env, int index,
-                                                 uintptr_t retaddr)
+static inline G_NORETURN
+void raise_exception(CPURXState *env, int index,
+                     uintptr_t retaddr)
 {
     CPUState *cs = env_cpu(env);
 
@@ -427,22 +429,22 @@ static inline void QEMU_NORETURN raise_exception(CPURXState *env, int index,
     cpu_loop_exit_restore(cs, retaddr);
 }
 
-void QEMU_NORETURN helper_raise_privilege_violation(CPURXState *env)
+G_NORETURN void helper_raise_privilege_violation(CPURXState *env)
 {
     raise_exception(env, 20, GETPC());
 }
 
-void QEMU_NORETURN helper_raise_access_fault(CPURXState *env)
+G_NORETURN void helper_raise_access_fault(CPURXState *env)
 {
     raise_exception(env, 21, GETPC());
 }
 
-void QEMU_NORETURN helper_raise_illegal_instruction(CPURXState *env)
+G_NORETURN void helper_raise_illegal_instruction(CPURXState *env)
 {
     raise_exception(env, 23, GETPC());
 }
 
-void QEMU_NORETURN helper_wait(CPURXState *env)
+G_NORETURN void helper_wait(CPURXState *env)
 {
     CPUState *cs = env_cpu(env);
 
@@ -451,12 +453,12 @@ void QEMU_NORETURN helper_wait(CPURXState *env)
     raise_exception(env, EXCP_HLT, 0);
 }
 
-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);
 }
 
-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
 
-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 = env_cpu(env);
 
@@ -46,8 +46,8 @@ void QEMU_NORETURN tcg_s390_program_interrupt(CPUS390XState *env,
     cpu_loop_exit(cs);
 }
 
-void QEMU_NORETURN tcg_s390_data_exception(CPUS390XState *env, uint32_t dxc,
-                                           uintptr_t ra)
+G_NORETURN void tcg_s390_data_exception(CPUS390XState *env, uint32_t dxc,
+                                        uintptr_t ra)
 {
     g_assert(dxc <= 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);
 }
 
-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 <= 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 retaddr)
+static G_NORETURN
+void do_unaligned_access(CPUState *cs, uintptr_t retaddr)
 {
     S390CPU *cpu = S390_CPU(cs);
     CPUS390XState *env = &cpu->env;
@@ -620,9 +621,10 @@ void s390x_cpu_do_unaligned_access(CPUState *cs, vaddr addr,
     do_unaligned_access(cs, retaddr);
 }
 
-static void QEMU_NORETURN monitor_event(CPUS390XState *env,
-                                        uint64_t monitor_code,
-                                        uint8_t monitor_class, uintptr_t ra)
+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 lowcore */
     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
 }
 
-static inline void QEMU_NORETURN raise_exception(CPUSH4State *env, int index,
-                                                 uintptr_t retaddr)
+static inline G_NORETURN
+void raise_exception(CPUSH4State *env, int index,
+                     uintptr_t retaddr)
 {
     CPUState *cs = env_cpu(env);
 
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, vaddr addr)
 }
 
 #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 = SPARC_CPU(cs);
     CPUSPARCState *env = &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 @@
 
 /* Exception helpers */
 
-static void QEMU_NORETURN
-raise_exception_sync_internal(CPUTriCoreState *env, uint32_t class, int tin,
-                              uintptr_t pc, uint32_t fcd_pc)
+static G_NORETURN
+void raise_exception_sync_internal(CPUTriCoreState *env, uint32_t class, int tin,
+                                   uintptr_t pc, uint32_t fcd_pc)
 {
     CPUState *cs = 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 f8542529d030..6196c2ee4124 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -320,7 +320,8 @@ static void set_jmp_reset_offset(TCGContext *s, int which)
 }
 
 /* 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;
 }
 
-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[])
     }
 }
 
-static void QEMU_NORETURN run_test(void)
+static G_NORETURN
+void run_test(void)
 {
     unsigned int i;
 
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	= qr{
 our $Attribute	= qr{
 			const|
 			volatile|
-			QEMU_NORETURN|
+			G_NORETURN|
 			G_GNUC_WARN_UNUSED_RESULT|
 			G_GNUC_NULL_TERMINATED|
 			QEMU_PACKED|
-- 
2.35.1.693.g805e0a68082a



^ permalink raw reply related	[flat|nested] 124+ messages in thread

* [PATCH 20/41] include: move qemu_msync() to osdep
  2022-04-20 13:25 [PATCH 00/41] Misc cleanups marcandre.lureau
                   ` (18 preceding siblings ...)
  2022-04-20 13:26   ` marcandre.lureau
@ 2022-04-20 13:26 ` marcandre.lureau
  2022-04-20 15:33   ` Daniel P. Berrangé
  2022-04-20 13:26 ` [PATCH 21/41] include: move qemu_fdatasync() " marcandre.lureau
                   ` (21 subsequent siblings)
  41 siblings, 1 reply; 124+ messages in thread
From: marcandre.lureau @ 2022-04-20 13:26 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau, Stefan Weil, Paolo Bonzini

From: Marc-André Lureau <marcandre.lureau@redhat.com>

The implementation depends on the OS. (and longer-term goal is to move
cutils to a common subproject)

Signed-off-by: Marc-André Lureau <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
 }
 
+/**
+ * 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
 }
 
-/**
- * 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 = ~(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 += ((uintptr_t)addr & (qemu_real_host_page_size() - 1));
-    length = (length + ~align_mask) & align_mask;
-
-    addr = (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 = ~(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 += ((uintptr_t)addr & (qemu_real_host_page_size() - 1));
+    length = (length + ~align_mask) & align_mask;
+
+    addr = (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);
+}
-- 
2.35.1.693.g805e0a68082a



^ permalink raw reply related	[flat|nested] 124+ messages in thread

* [PATCH 21/41] include: move qemu_fdatasync() to osdep
  2022-04-20 13:25 [PATCH 00/41] Misc cleanups marcandre.lureau
                   ` (19 preceding siblings ...)
  2022-04-20 13:26 ` [PATCH 20/41] include: move qemu_msync() to osdep marcandre.lureau
@ 2022-04-20 13:26 ` marcandre.lureau
  2022-04-20 15:34   ` Daniel P. Berrangé
  2022-04-20 13:26 ` [PATCH 22/41] include: move qemu_*_exec_dir() to cutils marcandre.lureau
                   ` (20 subsequent siblings)
  41 siblings, 1 reply; 124+ messages in thread
From: marcandre.lureau @ 2022-04-20 13:26 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Move QEMU-specific code to util/osdep.c, so cutils can become a common
subproject.

Signed-off-by: Marc-André Lureau <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
 }
 
+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;
 }
 
-/*
- * 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
+}
-- 
2.35.1.693.g805e0a68082a



^ permalink raw reply related	[flat|nested] 124+ messages in thread

* [PATCH 22/41] include: move qemu_*_exec_dir() to cutils
  2022-04-20 13:25 [PATCH 00/41] Misc cleanups marcandre.lureau
                   ` (20 preceding siblings ...)
  2022-04-20 13:26 ` [PATCH 21/41] include: move qemu_fdatasync() " marcandre.lureau
@ 2022-04-20 13:26 ` marcandre.lureau
  2022-04-20 15:36   ` Daniel P. Berrangé
  2022-04-20 13:26 ` [PATCH 23/41] include: add qemu/keyval.h marcandre.lureau
                   ` (19 subsequent siblings)
  41 siblings, 1 reply; 124+ messages in thread
From: marcandre.lureau @ 2022-04-20 13:26 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Laurent Vivier, Thomas Huth,
	open list:Block layer core, Darren Kenny, Stefan Weil,
	Bandan Das, Qiuhao Li, Alexander Bulekov, Hanna Reitz,
	Stefan Hajnoczi, Paolo Bonzini, Marc-André Lureau

From: Marc-André Lureau <marcandre.lureau@redhat.com>

The function is required by get_relocated_path(), which is used by
qemu-ga and may be generally useful.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 include/qemu/cutils.h                |   7 ++
 include/qemu/osdep.h                 |   8 --
 qemu-io.c                            |   1 +
 storage-daemon/qemu-storage-daemon.c |   1 +
 tests/qtest/fuzz/fuzz.c              |   1 +
 util/cutils.c                        | 109 +++++++++++++++++++++++++++
 util/oslib-posix.c                   |  81 --------------------
 util/oslib-win32.c                   |  36 ---------
 8 files changed, 119 insertions(+), 125 deletions(-)

diff --git a/include/qemu/cutils.h b/include/qemu/cutils.h
index 5c6572d44422..40e10e19a7ed 100644
--- a/include/qemu/cutils.h
+++ b/include/qemu/cutils.h
@@ -193,6 +193,13 @@ int uleb128_decode_small(const uint8_t *in, uint32_t *n);
  */
 int qemu_pstrcmp0(const char **str1, const char **str2);
 
+/* Find program directory, and save it for later usage with
+ * qemu_get_exec_dir().
+ * Try OS specific API first, if not working, parse from argv0. */
+void qemu_init_exec_dir(const char *argv0);
+
+/* Get the saved exec dir.  */
+const char *qemu_get_exec_dir(void);
 
 /**
  * get_relocated_path:
diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
index a87f1b7f32e6..9fd52d6a33a7 100644
--- a/include/qemu/osdep.h
+++ b/include/qemu/osdep.h
@@ -567,14 +567,6 @@ bool fips_get_state(void);
  */
 char *qemu_get_local_state_pathname(const char *relative_pathname);
 
-/* Find program directory, and save it for later usage with
- * qemu_get_exec_dir().
- * Try OS specific API first, if not working, parse from argv0. */
-void qemu_init_exec_dir(const char *argv0);
-
-/* Get the saved exec dir.  */
-const char *qemu_get_exec_dir(void);
-
 /**
  * qemu_getauxval:
  * @type: the auxiliary vector key to lookup
diff --git a/qemu-io.c b/qemu-io.c
index 952a36643b0c..458fadd99a92 100644
--- a/qemu-io.c
+++ b/qemu-io.c
@@ -16,6 +16,7 @@
 #endif
 
 #include "qemu/copyright.h"
+#include "qemu/cutils.h"
 #include "qapi/error.h"
 #include "qemu-io.h"
 #include "qemu/error-report.h"
diff --git a/storage-daemon/qemu-storage-daemon.c b/storage-daemon/qemu-storage-daemon.c
index a4415e8c995b..63b155013ed7 100644
--- a/storage-daemon/qemu-storage-daemon.c
+++ b/storage-daemon/qemu-storage-daemon.c
@@ -44,6 +44,7 @@
 
 #include "qemu/copyright.h"
 #include "qemu-version.h"
+#include "qemu/cutils.h"
 #include "qemu/config-file.h"
 #include "qemu/error-report.h"
 #include "qemu/help_option.h"
diff --git a/tests/qtest/fuzz/fuzz.c b/tests/qtest/fuzz/fuzz.c
index 5f77c849837f..d3afd294db24 100644
--- a/tests/qtest/fuzz/fuzz.c
+++ b/tests/qtest/fuzz/fuzz.c
@@ -15,6 +15,7 @@
 
 #include <wordexp.h>
 
+#include "qemu/cutils.h"
 #include "qemu/datadir.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/qtest.h"
diff --git a/util/cutils.c b/util/cutils.c
index b2777210e7da..443927275fdb 100644
--- a/util/cutils.c
+++ b/util/cutils.c
@@ -931,6 +931,115 @@ static inline const char *next_component(const char *dir, int *p_len)
     return dir;
 }
 
+static const char *exec_dir;
+
+void qemu_init_exec_dir(const char *argv0)
+{
+#ifdef G_OS_WIN32
+    char *p;
+    char buf[MAX_PATH];
+    DWORD len;
+
+    if (exec_dir) {
+        return;
+    }
+
+    len = GetModuleFileName(NULL, buf, sizeof(buf) - 1);
+    if (len == 0) {
+        return;
+    }
+
+    buf[len] = 0;
+    p = buf + len - 1;
+    while (p != buf && *p != '\\') {
+        p--;
+    }
+    *p = 0;
+    if (access(buf, R_OK) == 0) {
+        exec_dir = g_strdup(buf);
+    } else {
+        exec_dir = CONFIG_BINDIR;
+    }
+#else
+    char *p = NULL;
+    char buf[PATH_MAX];
+
+    if (exec_dir) {
+        return;
+    }
+
+#if defined(__linux__)
+    {
+        int len;
+        len = readlink("/proc/self/exe", buf, sizeof(buf) - 1);
+        if (len > 0) {
+            buf[len] = 0;
+            p = buf;
+        }
+    }
+#elif defined(__FreeBSD__) \
+      || (defined(__NetBSD__) && defined(KERN_PROC_PATHNAME))
+    {
+#if defined(__FreeBSD__)
+        static int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1};
+#else
+        static int mib[4] = {CTL_KERN, KERN_PROC_ARGS, -1, KERN_PROC_PATHNAME};
+#endif
+        size_t len = sizeof(buf) - 1;
+
+        *buf = '\0';
+        if (!sysctl(mib, ARRAY_SIZE(mib), buf, &len, NULL, 0) &&
+            *buf) {
+            buf[sizeof(buf) - 1] = '\0';
+            p = buf;
+        }
+    }
+#elif defined(__APPLE__)
+    {
+        char fpath[PATH_MAX];
+        uint32_t len = sizeof(fpath);
+        if (_NSGetExecutablePath(fpath, &len) == 0) {
+            p = realpath(fpath, buf);
+            if (!p) {
+                return;
+            }
+        }
+    }
+#elif defined(__HAIKU__)
+    {
+        image_info ii;
+        int32_t c = 0;
+
+        *buf = '\0';
+        while (get_next_image_info(0, &c, &ii) == B_OK) {
+            if (ii.type == B_APP_IMAGE) {
+                strncpy(buf, ii.name, sizeof(buf));
+                buf[sizeof(buf) - 1] = 0;
+                p = buf;
+                break;
+            }
+        }
+    }
+#endif
+    /* If we don't have any way of figuring out the actual executable
+       location then try argv[0].  */
+    if (!p && argv0) {
+        p = realpath(argv0, buf);
+    }
+    if (p) {
+        exec_dir = g_path_get_dirname(p);
+    } else {
+        exec_dir = CONFIG_BINDIR;
+    }
+#endif
+}
+
+const char *qemu_get_exec_dir(void)
+{
+    return exec_dir;
+}
+
+
 char *get_relocated_path(const char *dir)
 {
     size_t prefix_len = strlen(CONFIG_PREFIX);
diff --git a/util/oslib-posix.c b/util/oslib-posix.c
index 161f1123259f..4f18cc612850 100644
--- a/util/oslib-posix.c
+++ b/util/oslib-posix.c
@@ -321,87 +321,6 @@ void qemu_set_tty_echo(int fd, bool echo)
     tcsetattr(fd, TCSANOW, &tty);
 }
 
-static const char *exec_dir;
-
-void qemu_init_exec_dir(const char *argv0)
-{
-    char *p = NULL;
-    char buf[PATH_MAX];
-
-    if (exec_dir) {
-        return;
-    }
-
-#if defined(__linux__)
-    {
-        int len;
-        len = readlink("/proc/self/exe", buf, sizeof(buf) - 1);
-        if (len > 0) {
-            buf[len] = 0;
-            p = buf;
-        }
-    }
-#elif defined(__FreeBSD__) \
-      || (defined(__NetBSD__) && defined(KERN_PROC_PATHNAME))
-    {
-#if defined(__FreeBSD__)
-        static int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1};
-#else
-        static int mib[4] = {CTL_KERN, KERN_PROC_ARGS, -1, KERN_PROC_PATHNAME};
-#endif
-        size_t len = sizeof(buf) - 1;
-
-        *buf = '\0';
-        if (!sysctl(mib, ARRAY_SIZE(mib), buf, &len, NULL, 0) &&
-            *buf) {
-            buf[sizeof(buf) - 1] = '\0';
-            p = buf;
-        }
-    }
-#elif defined(__APPLE__)
-    {
-        char fpath[PATH_MAX];
-        uint32_t len = sizeof(fpath);
-        if (_NSGetExecutablePath(fpath, &len) == 0) {
-            p = realpath(fpath, buf);
-            if (!p) {
-                return;
-            }
-        }
-    }
-#elif defined(__HAIKU__)
-    {
-        image_info ii;
-        int32_t c = 0;
-
-        *buf = '\0';
-        while (get_next_image_info(0, &c, &ii) == B_OK) {
-            if (ii.type == B_APP_IMAGE) {
-                strncpy(buf, ii.name, sizeof(buf));
-                buf[sizeof(buf) - 1] = 0;
-                p = buf;
-                break;
-            }
-        }
-    }
-#endif
-    /* If we don't have any way of figuring out the actual executable
-       location then try argv[0].  */
-    if (!p && argv0) {
-        p = realpath(argv0, buf);
-    }
-    if (p) {
-        exec_dir = g_path_get_dirname(p);
-    } else {
-        exec_dir = CONFIG_BINDIR;
-    }
-}
-
-const char *qemu_get_exec_dir(void)
-{
-    return exec_dir;
-}
-
 #ifdef CONFIG_LINUX
 static void sigbus_handler(int signal, siginfo_t *siginfo, void *ctx)
 #else /* CONFIG_LINUX */
diff --git a/util/oslib-win32.c b/util/oslib-win32.c
index 1e05c316b311..0371082d23b3 100644
--- a/util/oslib-win32.c
+++ b/util/oslib-win32.c
@@ -270,42 +270,6 @@ void qemu_set_tty_echo(int fd, bool echo)
     }
 }
 
-static const char *exec_dir;
-
-void qemu_init_exec_dir(const char *argv0)
-{
-
-    char *p;
-    char buf[MAX_PATH];
-    DWORD len;
-
-    if (exec_dir) {
-        return;
-    }
-
-    len = GetModuleFileName(NULL, buf, sizeof(buf) - 1);
-    if (len == 0) {
-        return;
-    }
-
-    buf[len] = 0;
-    p = buf + len - 1;
-    while (p != buf && *p != '\\') {
-        p--;
-    }
-    *p = 0;
-    if (access(buf, R_OK) == 0) {
-        exec_dir = g_strdup(buf);
-    } else {
-        exec_dir = CONFIG_BINDIR;
-    }
-}
-
-const char *qemu_get_exec_dir(void)
-{
-    return exec_dir;
-}
-
 int getpagesize(void)
 {
     SYSTEM_INFO system_info;
-- 
2.35.1.693.g805e0a68082a



^ permalink raw reply related	[flat|nested] 124+ messages in thread

* [PATCH 23/41] include: add qemu/keyval.h
  2022-04-20 13:25 [PATCH 00/41] Misc cleanups marcandre.lureau
                   ` (21 preceding siblings ...)
  2022-04-20 13:26 ` [PATCH 22/41] include: move qemu_*_exec_dir() to cutils marcandre.lureau
@ 2022-04-20 13:26 ` marcandre.lureau
  2022-04-20 15:38   ` Daniel P. Berrangé
  2022-04-20 13:26 ` [PATCH 24/41] include: move qdict_{crumple,flatten} declarations marcandre.lureau
                   ` (18 subsequent siblings)
  41 siblings, 1 reply; 124+ messages in thread
From: marcandre.lureau @ 2022-04-20 13:26 UTC (permalink / raw)
  To: qemu-devel
  Cc: Eduardo Habkost, Daniel P. Berrangé,
	Michael Roth, Markus Armbruster, Paolo Bonzini,
	Marc-André Lureau

From: Marc-André Lureau <marcandre.lureau@redhat.com>

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é Lureau <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 later.
+ * 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 *implied_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 print_caption);
 void qemu_opts_free(QemuOptsList *list);
 QemuOptsList *qemu_opts_append(QemuOptsList *dst, QemuOptsList *list);
 
-QDict *keyval_parse_into(QDict *qdict, const char *params, const char *implied_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)
 
 #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"
 
 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"
 
 bool user_creatable_complete(UserCreatable *uc, Error **errp)
 {
diff --git a/softmmu/vl.c b/softmmu/vl.c
index b0bf16e16aaa..8e3163a09233 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"
 
 #include "config-host.h"
 
diff --git a/tests/unit/check-qom-proplist.c b/tests/unit/check-qom-proplist.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"
 
diff --git a/tests/unit/test-forward-visitor.c b/tests/unit/test-forward-visitor.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"
 
 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"
 
 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"
 
 /*
  * Convert @key to a list index.
-- 
2.35.1.693.g805e0a68082a



^ permalink raw reply related	[flat|nested] 124+ messages in thread

* [PATCH 24/41] include: move qdict_{crumple,flatten} declarations
  2022-04-20 13:25 [PATCH 00/41] Misc cleanups marcandre.lureau
                   ` (22 preceding siblings ...)
  2022-04-20 13:26 ` [PATCH 23/41] include: add qemu/keyval.h marcandre.lureau
@ 2022-04-20 13:26 ` marcandre.lureau
  2022-04-20 15:39   ` Daniel P. Berrangé
  2022-04-20 13:26 ` [PATCH 25/41] tests: remove block/qdict checks from check-qobject.c marcandre.lureau
                   ` (17 subsequent siblings)
  41 siblings, 1 reply; 124+ messages in thread
From: marcandre.lureau @ 2022-04-20 13:26 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, open list:Block layer core, Markus Armbruster,
	Hanna Reitz, Paolo Bonzini, Marc-André Lureau

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Move them where they belong, since the functions are implemented in block-qdict.c.

Signed-off-by: Marc-André Lureau <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 @@
 
 #include "qapi/qmp/qdict.h"
 
+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);
 
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 char *key);
 
 QDict *qdict_clone_shallow(const QDict *src);
 
-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 8e3163a09233..b20d470b62a5 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"
 
 #include <math.h>
 
-- 
2.35.1.693.g805e0a68082a



^ permalink raw reply related	[flat|nested] 124+ messages in thread

* [PATCH 25/41] tests: remove block/qdict checks from check-qobject.c
  2022-04-20 13:25 [PATCH 00/41] Misc cleanups marcandre.lureau
                   ` (23 preceding siblings ...)
  2022-04-20 13:26 ` [PATCH 24/41] include: move qdict_{crumple,flatten} declarations marcandre.lureau
@ 2022-04-20 13:26 ` marcandre.lureau
  2022-04-20 15:39   ` Daniel P. Berrangé
  2022-04-20 13:26 ` [PATCH 26/41] compiler.h: add QEMU_SANITIZE_{ADDRESS,THREAD} marcandre.lureau
                   ` (16 subsequent siblings)
  41 siblings, 1 reply; 124+ messages in thread
From: marcandre.lureau @ 2022-04-20 13:26 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau, Markus Armbruster

From: Marc-André Lureau <marcandre.lureau@redhat.com>

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é Lureau <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"
 
 #include <math.h>
 
@@ -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 = NULL;
-    g_autoptr(QDict) dict_crumpled = NULL;
     g_autoptr(QDict) dict_0 = qdict_new();
     g_autoptr(QDict) dict_1 = qdict_new();
     g_autoptr(QDict) dict_different_key = qdict_new();
@@ -237,12 +235,6 @@ static void qobject_is_equal_dict_test(void)
                   dict_different_null_key, dict_longer, dict_shorter,
                   dict_nested);
 
-    dict_crumpled = 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));
-- 
2.35.1.693.g805e0a68082a



^ permalink raw reply related	[flat|nested] 124+ messages in thread

* [PATCH 26/41] compiler.h: add QEMU_SANITIZE_{ADDRESS,THREAD}
  2022-04-20 13:25 [PATCH 00/41] Misc cleanups marcandre.lureau
                   ` (24 preceding siblings ...)
  2022-04-20 13:26 ` [PATCH 25/41] tests: remove block/qdict checks from check-qobject.c marcandre.lureau
@ 2022-04-20 13:26 ` marcandre.lureau
  2022-04-21 13:34   ` Daniel P. Berrangé
  2022-04-20 13:26 ` [PATCH 27/41] Use QEMU_SANITIZE_THREAD marcandre.lureau
                   ` (15 subsequent siblings)
  41 siblings, 1 reply; 124+ messages in thread
From: marcandre.lureau @ 2022-04-20 13:26 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau

From: Marc-André Lureau <marcandre.lureau@redhat.com>

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é Lureau <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
 
+#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
-- 
2.35.1.693.g805e0a68082a



^ permalink raw reply related	[flat|nested] 124+ messages in thread

* [PATCH 27/41] Use QEMU_SANITIZE_THREAD
  2022-04-20 13:25 [PATCH 00/41] Misc cleanups marcandre.lureau
                   ` (25 preceding siblings ...)
  2022-04-20 13:26 ` [PATCH 26/41] compiler.h: add QEMU_SANITIZE_{ADDRESS,THREAD} marcandre.lureau
@ 2022-04-20 13:26 ` marcandre.lureau
  2022-04-21 13:43   ` Daniel P. Berrangé
  2022-04-20 13:26 ` [PATCH 28/41] Use QEMU_SANITIZE_ADDRESS marcandre.lureau
                   ` (14 subsequent siblings)
  41 siblings, 1 reply; 124+ messages in thread
From: marcandre.lureau @ 2022-04-20 13:26 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 include/qemu/atomic.h                        | 8 +++++---
 subprojects/libvhost-user/include/compiler.h | 1 +
 2 files changed, 6 insertions(+), 3 deletions(-)
 create mode 120000 subprojects/libvhost-user/include/compiler.h

diff --git a/include/qemu/atomic.h b/include/qemu/atomic.h
index 112a29910bea..7e8fc8e7cde2 100644
--- a/include/qemu/atomic.h
+++ b/include/qemu/atomic.h
@@ -15,6 +15,8 @@
 #ifndef QEMU_ATOMIC_H
 #define QEMU_ATOMIC_H
 
+#include "compiler.h"
+
 /* Compiler barrier */
 #define barrier()   ({ asm volatile("" ::: "memory"); (void)0; })
 
@@ -81,7 +83,7 @@
  * no processors except Alpha need a barrier here.  Leave it in if
  * using Thread Sanitizer to avoid warnings, otherwise optimize it away.
  */
-#if defined(__SANITIZE_THREAD__)
+#ifdef QEMU_SANITIZE_THREAD
 #define smp_read_barrier_depends()   ({ barrier(); __atomic_thread_fence(__ATOMIC_CONSUME); })
 #elif defined(__alpha__)
 #define smp_read_barrier_depends()   asm volatile("mb":::"memory")
@@ -146,7 +148,7 @@
 /* See above: most compilers currently treat consume and acquire the
  * same, but this slows down qatomic_rcu_read unnecessarily.
  */
-#ifdef __SANITIZE_THREAD__
+#ifdef QEMU_SANITIZE_THREAD
 #define qatomic_rcu_read__nocheck(ptr, valptr)           \
     __atomic_load(ptr, valptr, __ATOMIC_CONSUME);
 #else
@@ -254,7 +256,7 @@
 #define qatomic_mb_read(ptr)                             \
     qatomic_load_acquire(ptr)
 
-#if !defined(__SANITIZE_THREAD__) && \
+#if !defined(QEMU_SANITIZE_THREAD) && \
     (defined(__i386__) || defined(__x86_64__) || defined(__s390x__))
 /* This is more efficient than a store plus a fence.  */
 # define qatomic_mb_set(ptr, i)  ((void)qatomic_xchg(ptr, i))
diff --git a/subprojects/libvhost-user/include/compiler.h b/subprojects/libvhost-user/include/compiler.h
new file mode 120000
index 000000000000..de7b70697cd2
--- /dev/null
+++ b/subprojects/libvhost-user/include/compiler.h
@@ -0,0 +1 @@
+../../../include/qemu/compiler.h
\ No newline at end of file
-- 
2.35.1.693.g805e0a68082a



^ permalink raw reply related	[flat|nested] 124+ messages in thread

* [PATCH 28/41] Use QEMU_SANITIZE_ADDRESS
  2022-04-20 13:25 [PATCH 00/41] Misc cleanups marcandre.lureau
                   ` (26 preceding siblings ...)
  2022-04-20 13:26 ` [PATCH 27/41] Use QEMU_SANITIZE_THREAD marcandre.lureau
@ 2022-04-20 13:26 ` marcandre.lureau
  2022-04-20 14:20   ` Thomas Huth
  2022-04-20 13:26 ` [PATCH 29/41] tests: run-time skip test-qga if TSAN is enabled marcandre.lureau
                   ` (13 subsequent siblings)
  41 siblings, 1 reply; 124+ messages in thread
From: marcandre.lureau @ 2022-04-20 13:26 UTC (permalink / raw)
  To: qemu-devel
  Cc: Laurent Vivier, Kevin Wolf, Thomas Huth, open list:Floppy,
	Stefan Hajnoczi, Paolo Bonzini, Marc-André Lureau,
	John Snow

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 tests/qtest/fdc-test.c    | 2 +-
 util/coroutine-ucontext.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/qtest/fdc-test.c b/tests/qtest/fdc-test.c
index 4aa72f36431f..0b3c2c0d523f 100644
--- a/tests/qtest/fdc-test.c
+++ b/tests/qtest/fdc-test.c
@@ -550,7 +550,7 @@ static void fuzz_registers(void)
 
 static bool qtest_check_clang_sanitizer(void)
 {
-#if defined(__SANITIZE_ADDRESS__) || __has_feature(address_sanitizer)
+#ifdef QEMU_SANITIZE_ADDRESS
     return true;
 #else
     g_test_skip("QEMU not configured using --enable-sanitizers");
diff --git a/util/coroutine-ucontext.c b/util/coroutine-ucontext.c
index 904b375192ca..52725f5344fb 100644
--- a/util/coroutine-ucontext.c
+++ b/util/coroutine-ucontext.c
@@ -30,7 +30,7 @@
 #include <valgrind/valgrind.h>
 #endif
 
-#if defined(__SANITIZE_ADDRESS__) || __has_feature(address_sanitizer)
+#ifdef QEMU_SANITIZE_THREAD
 #ifdef CONFIG_ASAN_IFACE_FIBER
 #define CONFIG_ASAN 1
 #include <sanitizer/asan_interface.h>
-- 
2.35.1.693.g805e0a68082a



^ permalink raw reply related	[flat|nested] 124+ messages in thread

* [PATCH 29/41] tests: run-time skip test-qga if TSAN is enabled
  2022-04-20 13:25 [PATCH 00/41] Misc cleanups marcandre.lureau
                   ` (27 preceding siblings ...)
  2022-04-20 13:26 ` [PATCH 28/41] Use QEMU_SANITIZE_ADDRESS marcandre.lureau
@ 2022-04-20 13:26 ` marcandre.lureau
  2022-04-20 15:41   ` Daniel P. Berrangé
  2022-04-20 13:26 ` [PATCH 30/41] Move error_printf_unless_qmp() with monitor unit marcandre.lureau
                   ` (12 subsequent siblings)
  41 siblings, 1 reply; 124+ messages in thread
From: marcandre.lureau @ 2022-04-20 13:26 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau, Michael Roth

From: Marc-André Lureau <marcandre.lureau@redhat.com>

This allows to make sure the test is still built, and gives more
accurate report details.

Signed-off-by: Marc-André Lureau <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;
 
+#ifdef QEMU_SANITIZE_THREAD
+    {
+        g_test_skip("tsan enabled, https://github.com/google/sanitizers/issues/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
 
-if have_ga and targetos == 'linux' and 'CONFIG_TSAN' not in config_host
+if have_ga and targetos == 'linux'
   tests += {'test-qga': ['../qtest/libqtest.c']}
   test_deps += {'test-qga': qga}
 endif
-- 
2.35.1.693.g805e0a68082a



^ permalink raw reply related	[flat|nested] 124+ messages in thread

* [PATCH 30/41] Move error_printf_unless_qmp() with monitor unit
  2022-04-20 13:25 [PATCH 00/41] Misc cleanups marcandre.lureau
                   ` (28 preceding siblings ...)
  2022-04-20 13:26 ` [PATCH 29/41] tests: run-time skip test-qga if TSAN is enabled marcandre.lureau
@ 2022-04-20 13:26 ` marcandre.lureau
  2022-04-20 15:42   ` Daniel P. Berrangé
  2022-04-20 13:26 ` [PATCH 31/41] qga: move qga_get_host_name() marcandre.lureau
                   ` (11 subsequent siblings)
  41 siblings, 1 reply; 124+ messages in thread
From: marcandre.lureau @ 2022-04-20 13:26 UTC (permalink / raw)
  To: qemu-devel
  Cc: Marc-André Lureau, Paolo Bonzini, Gerd Hoffmann,
	Markus Armbruster, Dr. David Alan Gilbert

From: Marc-André Lureau <marcandre.lureau@redhat.com>

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é Lureau <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 **errp));
 
+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);
 
 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);
 
 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;
 }
 
+int error_printf_unless_qmp(const char *fmt, ...)
+{
+    va_list ap;
+    int ret;
+
+    va_start(ap, fmt);
+    ret = error_vprintf_unless_qmp(fmt, ap);
+    va_end(ap);
+    return ret;
+}
 
 static MonitorQAPIEventConf monitor_qapi_event_conf[QAPI_EVENT__MAX] = {
     /* 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"
 
 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"
 
 #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;
 }
 
-int error_printf_unless_qmp(const char *fmt, ...)
-{
-    va_list ap;
-    int ret;
-
-    va_start(ap, fmt);
-    ret = error_vprintf_unless_qmp(fmt, ap);
-    va_end(ap);
-    return ret;
-}
-
 static Location std_loc = {
     .kind = LOC_NONE
 };
-- 
2.35.1.693.g805e0a68082a



^ permalink raw reply related	[flat|nested] 124+ messages in thread

* [PATCH 31/41] qga: move qga_get_host_name()
  2022-04-20 13:25 [PATCH 00/41] Misc cleanups marcandre.lureau
                   ` (29 preceding siblings ...)
  2022-04-20 13:26 ` [PATCH 30/41] Move error_printf_unless_qmp() with monitor unit marcandre.lureau
@ 2022-04-20 13:26 ` marcandre.lureau
  2022-04-20 13:51   ` Konstantin Kostiuk
  2022-04-20 15:44   ` Daniel P. Berrangé
  2022-04-20 13:26 ` [PATCH 32/41] qtest: simplify socket_send() marcandre.lureau
                   ` (10 subsequent siblings)
  41 siblings, 2 replies; 124+ messages in thread
From: marcandre.lureau @ 2022-04-20 13:26 UTC (permalink / raw)
  To: qemu-devel
  Cc: Marc-André Lureau, Stefan Weil, Paolo Bonzini,
	Konstantin Kostiuk, Michael Roth

From: Marc-André Lureau <marcandre.lureau@redhat.com>

The function is specific to qemu-ga, no need to share it in QEMU.

Signed-off-by: Marc-André Lureau <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 9fd52d6a33a7..ccf10f05f806 100644
--- a/include/qemu/osdep.h
+++ b/include/qemu/osdep.h
@@ -648,16 +648,6 @@ int qemu_fdatasync(int fd);
  */
 int qemu_msync(void *addr, size_t length, int fd);
 
-/**
- * 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, Error **errp);
 GuestFileRead *guest_file_read_unsafe(GuestFileHandle *gfh,
                                       int64_t count, Error **errp);
 
+/**
+ * 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 **errp)
 
     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 = -1;
+    g_autofree char *hostname = NULL;
+
+#ifdef _SC_HOST_NAME_MAX
+    len = sysconf(_SC_HOST_NAME_MAX);
+#endif /* _SC_HOST_NAME_MAX */
+
+    if (len < 0) {
+        len = HOST_NAME_MAX;
+    }
+
+    /* Unfortunately, gethostname() below does not guarantee a
+     * NULL terminated string. Therefore, allocate one byte more
+     * to be sure. */
+    hostname = 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 **errp)
     }
     return head;
 }
+
+char *qga_get_host_name(Error **errp)
+{
+    wchar_t tmp[MAX_COMPUTERNAME_LENGTH + 1];
+    DWORD size = G_N_ELEMENTS(tmp);
+
+    if (GetComputerNameW(tmp, &size) == 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 **errp)
 GuestHostName *qmp_guest_get_host_name(Error **errp)
 {
     GuestHostName *result = NULL;
-    g_autofree char *hostname = qemu_get_host_name(errp);
+    g_autofree char *hostname = qga_get_host_name(errp);
 
     /*
      * We want to avoid using g_get_host_name() because that
diff --git a/util/oslib-posix.c b/util/oslib-posix.c
index 4f18cc612850..63d2c6a76a77 100644
--- a/util/oslib-posix.c
+++ b/util/oslib-posix.c
@@ -805,41 +805,6 @@ void sigaction_invoke(struct sigaction *action,
     action->sa_sigaction(info->ssi_signo, &si, 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 *qemu_get_host_name(Error **errp)
-{
-    long len = -1;
-    g_autofree char *hostname = NULL;
-
-#ifdef _SC_HOST_NAME_MAX
-    len = sysconf(_SC_HOST_NAME_MAX);
-#endif /* _SC_HOST_NAME_MAX */
-
-    if (len < 0) {
-        len = HOST_NAME_MAX;
-    }
-
-    /* Unfortunately, gethostname() below does not guarantee a
-     * NULL terminated string. Therefore, allocate one byte more
-     * to be sure. */
-    hostname = 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 0371082d23b3..41df0a289e28 100644
--- a/util/oslib-win32.c
+++ b/util/oslib-win32.c
@@ -537,19 +537,6 @@ bool qemu_write_pidfile(const char *filename, Error **errp)
     return true;
 }
 
-char *qemu_get_host_name(Error **errp)
-{
-    wchar_t tmp[MAX_COMPUTERNAME_LENGTH + 1];
-    DWORD size = G_N_ELEMENTS(tmp);
-
-    if (GetComputerNameW(tmp, &size) == 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;
-- 
2.35.1.693.g805e0a68082a



^ permalink raw reply related	[flat|nested] 124+ messages in thread

* [PATCH 32/41] qtest: simplify socket_send()
  2022-04-20 13:25 [PATCH 00/41] Misc cleanups marcandre.lureau
                   ` (30 preceding siblings ...)
  2022-04-20 13:26 ` [PATCH 31/41] qga: move qga_get_host_name() marcandre.lureau
@ 2022-04-20 13:26 ` marcandre.lureau
  2022-04-20 14:24   ` Thomas Huth
  2022-04-20 15:45   ` Daniel P. Berrangé
  2022-04-20 13:26 ` [PATCH 33/41] tests: move libqtest.c under libqos/ marcandre.lureau
                   ` (9 subsequent siblings)
  41 siblings, 2 replies; 124+ messages in thread
From: marcandre.lureau @ 2022-04-20 13:26 UTC (permalink / raw)
  To: qemu-devel
  Cc: Laurent Vivier, Marc-André Lureau, Thomas Huth, Paolo Bonzini

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Reuse qemu_write_full().

Signed-off-by: Marc-André Lureau <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)
 
 static void socket_send(int fd, const char *buf, size_t size)
 {
-    size_t offset;
-
-    offset = 0;
-    while (offset < size) {
-        ssize_t len;
+    size_t res = qemu_write_full(fd, buf, size);
 
-        len = write(fd, buf + offset, size - offset);
-        if (len == -1 && errno == EINTR) {
-            continue;
-        }
-
-        g_assert_cmpint(len, >, 0);
-
-        offset += len;
-    }
+    assert(res == size);
 }
 
 static void qtest_client_socket_send(QTestState *s, const char *buf)
-- 
2.35.1.693.g805e0a68082a



^ permalink raw reply related	[flat|nested] 124+ messages in thread

* [PATCH 33/41] tests: move libqtest.c under libqos/
  2022-04-20 13:25 [PATCH 00/41] Misc cleanups marcandre.lureau
                   ` (31 preceding siblings ...)
  2022-04-20 13:26 ` [PATCH 32/41] qtest: simplify socket_send() marcandre.lureau
@ 2022-04-20 13:26 ` marcandre.lureau
  2022-04-20 14:16   ` Thomas Huth
  2022-04-20 15:48   ` Daniel P. Berrangé
  2022-04-20 13:26 ` [PATCH 34/41] libqtest: split QMP part in libqmp marcandre.lureau
                   ` (8 subsequent siblings)
  41 siblings, 2 replies; 124+ messages in thread
From: marcandre.lureau @ 2022-04-20 13:26 UTC (permalink / raw)
  To: qemu-devel
  Cc: Laurent Vivier, Marc-André Lureau, Thomas Huth, Paolo Bonzini

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Since commit a2ce7dbd917 ("meson: convert tests/qtest to meson"),
libqtest.h is under libqos/ directory. Let's move the .c along with it.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 docs/devel/qtest.rst                | 4 ++--
 tests/qtest/{ => libqos}/libqtest.c | 4 ++--
 tests/qtest/libqos/meson.build      | 2 +-
 tests/unit/meson.build              | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)
 rename tests/qtest/{ => libqos}/libqtest.c (99%)

diff --git a/docs/devel/qtest.rst b/docs/devel/qtest.rst
index c3dceb6c8a1d..a9a6b0a7466b 100644
--- a/docs/devel/qtest.rst
+++ b/docs/devel/qtest.rst
@@ -18,8 +18,8 @@ QTest cases can be executed with
 
    make check-qtest
 
-The QTest library is implemented by ``tests/qtest/libqtest.c`` and the API is
-defined in ``tests/qtest/libqtest.h``.
+The QTest library is implemented by ``tests/qtest/libqos/libqtest.c`` and the API is
+defined in ``tests/qtest/libqos/libqtest.h``.
 
 Consider adding a new QTest case when you are introducing a new virtual
 hardware, or extending one if you are adding functionalities to an existing
diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqos/libqtest.c
similarity index 99%
rename from tests/qtest/libqtest.c
rename to tests/qtest/libqos/libqtest.c
index 2b9bdb947d6f..9097329ce435 100644
--- a/tests/qtest/libqtest.c
+++ b/tests/qtest/libqos/libqtest.c
@@ -20,7 +20,7 @@
 #include <sys/wait.h>
 #include <sys/un.h>
 
-#include "libqos/libqtest.h"
+#include "libqtest.h"
 #include "qemu/ctype.h"
 #include "qemu/cutils.h"
 #include "qapi/error.h"
@@ -268,7 +268,7 @@ QTestState *qtest_init_without_qmp_handshake(const char *extra_args)
     /* It's possible that if an earlier test run crashed it might
      * have left a stale unix socket lying around. Delete any
      * stale old socket to avoid spurious test failures with
-     * tests/libqtest.c:70:init_socket: assertion failed (ret != -1): (-1 != -1)
+     * libqtest.c:70:init_socket: assertion failed (ret != -1): (-1 != -1)
      */
     unlink(socket_path);
     unlink(qmp_socket_path);
diff --git a/tests/qtest/libqos/meson.build b/tests/qtest/libqos/meson.build
index e988d1579172..0c172f27533a 100644
--- a/tests/qtest/libqos/meson.build
+++ b/tests/qtest/libqos/meson.build
@@ -1,4 +1,4 @@
-libqos_srcs = files('../libqtest.c',
+libqos_srcs = files('libqtest.c',
         'qgraph.c',
         'qos_external.c',
         'pci.c',
diff --git a/tests/unit/meson.build b/tests/unit/meson.build
index ab01e00f12cf..188b0ea80c37 100644
--- a/tests/unit/meson.build
+++ b/tests/unit/meson.build
@@ -154,7 +154,7 @@ if have_system
 endif
 
 if have_ga and targetos == 'linux'
-  tests += {'test-qga': ['../qtest/libqtest.c']}
+  tests += {'test-qga': ['../qtest/libqos/libqtest.c']}
   test_deps += {'test-qga': qga}
 endif
 
-- 
2.35.1.693.g805e0a68082a



^ permalink raw reply related	[flat|nested] 124+ messages in thread

* [PATCH 34/41] libqtest: split QMP part in libqmp
  2022-04-20 13:25 [PATCH 00/41] Misc cleanups marcandre.lureau
                   ` (32 preceding siblings ...)
  2022-04-20 13:26 ` [PATCH 33/41] tests: move libqtest.c under libqos/ marcandre.lureau
@ 2022-04-20 13:26 ` marcandre.lureau
  2022-04-20 14:29   ` Thomas Huth
  2022-04-20 13:26 ` [PATCH 35/41] util: simplify write in signal handler marcandre.lureau
                   ` (7 subsequent siblings)
  41 siblings, 1 reply; 124+ messages in thread
From: marcandre.lureau @ 2022-04-20 13:26 UTC (permalink / raw)
  To: qemu-devel
  Cc: Laurent Vivier, Marc-André Lureau, Thomas Huth, Paolo Bonzini

From: Marc-André Lureau <marcandre.lureau@redhat.com>

This will help moving QAPI/QMP in a common subproject.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 tests/qtest/libqos/libqmp.h    |  50 +++++++
 tests/qtest/libqos/libqtest.h  |  29 +----
 tests/qtest/libqos/libqmp.c    | 230 +++++++++++++++++++++++++++++++++
 tests/qtest/libqos/libqtest.c  | 202 +----------------------------
 tests/qtest/libqos/meson.build |   5 +-
 tests/unit/meson.build         |   2 +-
 6 files changed, 287 insertions(+), 231 deletions(-)
 create mode 100644 tests/qtest/libqos/libqmp.h
 create mode 100644 tests/qtest/libqos/libqmp.c

diff --git a/tests/qtest/libqos/libqmp.h b/tests/qtest/libqos/libqmp.h
new file mode 100644
index 000000000000..94aa97328a17
--- /dev/null
+++ b/tests/qtest/libqos/libqmp.h
@@ -0,0 +1,50 @@
+/*
+ * libqmp test unit
+ *
+ * Copyright IBM, Corp. 2012
+ * Copyright Red Hat, Inc. 2012
+ * Copyright SUSE LINUX Products GmbH 2013
+ *
+ * Authors:
+ *  Anthony Liguori   <aliguori@us.ibm.com>
+ *  Paolo Bonzini     <pbonzini@redhat.com>
+ *  Andreas Färber    <afaerber@suse.de>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ *
+ */
+#ifndef LIBQMP_H_
+#define LIBQMP_H_
+
+#include "qapi/qmp/qdict.h"
+
+QDict *qmp_fd_receive(int fd);
+void qmp_fd_vsend_fds(int fd, int *fds, size_t fds_num,
+                      const char *fmt, va_list ap) G_GNUC_PRINTF(4, 0);
+void qmp_fd_vsend(int fd, const char *fmt, va_list ap) G_GNUC_PRINTF(2, 0);
+void qmp_fd_send(int fd, const char *fmt, ...) G_GNUC_PRINTF(2, 3);
+void qmp_fd_send_raw(int fd, const char *fmt, ...) G_GNUC_PRINTF(2, 3);
+void qmp_fd_vsend_raw(int fd, const char *fmt, va_list ap) G_GNUC_PRINTF(2, 0);
+QDict *qmp_fdv(int fd, const char *fmt, va_list ap) G_GNUC_PRINTF(2, 0);
+QDict *qmp_fd(int fd, const char *fmt, ...) G_GNUC_PRINTF(2, 3);
+
+/**
+ * qmp_rsp_is_err:
+ * @rsp: QMP response to check for error
+ *
+ * Test @rsp for error and discard @rsp.
+ * Returns 'true' if there is error in @rsp and 'false' otherwise.
+ */
+bool qmp_rsp_is_err(QDict *rsp);
+
+/**
+ * qmp_expect_error_and_unref:
+ * @rsp: QMP response to check for error
+ * @class: an error class
+ *
+ * Assert the response has the given error class and discard @rsp.
+ */
+void qmp_expect_error_and_unref(QDict *rsp, const char *class);
+
+#endif /* LIBQMP_H_ */
diff --git a/tests/qtest/libqos/libqtest.h b/tests/qtest/libqos/libqtest.h
index 552667f17e37..4ab0cad3266d 100644
--- a/tests/qtest/libqos/libqtest.h
+++ b/tests/qtest/libqos/libqtest.h
@@ -19,6 +19,7 @@
 
 #include "qapi/qmp/qobject.h"
 #include "qapi/qmp/qdict.h"
+#include "libqmp.h"
 
 typedef struct QTestState QTestState;
 
@@ -690,16 +691,6 @@ void qtest_remove_abrt_handler(void *data);
 void qtest_qmp_assert_success(QTestState *qts, const char *fmt, ...)
     G_GNUC_PRINTF(2, 3);
 
-QDict *qmp_fd_receive(int fd);
-void qmp_fd_vsend_fds(int fd, int *fds, size_t fds_num,
-                      const char *fmt, va_list ap) G_GNUC_PRINTF(4, 0);
-void qmp_fd_vsend(int fd, const char *fmt, va_list ap) G_GNUC_PRINTF(2, 0);
-void qmp_fd_send(int fd, const char *fmt, ...) G_GNUC_PRINTF(2, 3);
-void qmp_fd_send_raw(int fd, const char *fmt, ...) G_GNUC_PRINTF(2, 3);
-void qmp_fd_vsend_raw(int fd, const char *fmt, va_list ap) G_GNUC_PRINTF(2, 0);
-QDict *qmp_fdv(int fd, const char *fmt, va_list ap) G_GNUC_PRINTF(2, 0);
-QDict *qmp_fd(int fd, const char *fmt, ...) G_GNUC_PRINTF(2, 3);
-
 /**
  * qtest_cb_for_every_machine:
  * @cb: Pointer to the callback function
@@ -771,24 +762,6 @@ void qtest_qmp_add_client(QTestState *qts, const char *protocol, int fd);
  */
 void qtest_qmp_device_del(QTestState *qts, const char *id);
 
-/**
- * qmp_rsp_is_err:
- * @rsp: QMP response to check for error
- *
- * Test @rsp for error and discard @rsp.
- * Returns 'true' if there is error in @rsp and 'false' otherwise.
- */
-bool qmp_rsp_is_err(QDict *rsp);
-
-/**
- * qmp_expect_error_and_unref:
- * @rsp: QMP response to check for error
- * @class: an error class
- *
- * Assert the response has the given error class and discard @rsp.
- */
-void qmp_expect_error_and_unref(QDict *rsp, const char *class);
-
 /**
  * qtest_probe_child:
  * @s: QTestState instance to operate on.
diff --git a/tests/qtest/libqos/libqmp.c b/tests/qtest/libqos/libqmp.c
new file mode 100644
index 000000000000..e6b9df2d7b40
--- /dev/null
+++ b/tests/qtest/libqos/libqmp.c
@@ -0,0 +1,230 @@
+/*
+ * QTest
+ *
+ * Copyright IBM, Corp. 2012
+ * Copyright Red Hat, Inc. 2012
+ * Copyright SUSE LINUX Products GmbH 2013
+ *
+ * Authors:
+ *  Anthony Liguori   <aliguori@us.ibm.com>
+ *  Paolo Bonzini     <pbonzini@redhat.com>
+ *  Andreas Färber    <afaerber@suse.de>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+
+#include "qemu/osdep.h"
+
+#include "libqmp.h"
+
+#include "qapi/error.h"
+#include "qapi/qmp/json-parser.h"
+#include "qapi/qmp/qjson.h"
+
+#define SOCKET_MAX_FDS 16
+
+typedef struct {
+    JSONMessageParser parser;
+    QDict *response;
+} QMPResponseParser;
+
+static void socket_send(int fd, const char *buf, size_t size)
+{
+    size_t res = qemu_write_full(fd, buf, size);
+
+    assert(res == size);
+}
+
+static void qmp_response(void *opaque, QObject *obj, Error *err)
+{
+    QMPResponseParser *qmp = opaque;
+
+    assert(!obj != !err);
+
+    if (err) {
+        error_prepend(&err, "QMP JSON response parsing failed: ");
+        error_report_err(err);
+        abort();
+    }
+
+    g_assert(!qmp->response);
+    qmp->response = qobject_to(QDict, obj);
+    g_assert(qmp->response);
+}
+
+QDict *qmp_fd_receive(int fd)
+{
+    QMPResponseParser qmp;
+    bool log = getenv("QTEST_LOG") != NULL;
+
+    qmp.response = NULL;
+    json_message_parser_init(&qmp.parser, qmp_response, &qmp, NULL);
+    while (!qmp.response) {
+        ssize_t len;
+        char c;
+
+        len = read(fd, &c, 1);
+        if (len == -1 && errno == EINTR) {
+            continue;
+        }
+
+        if (len == -1 || len == 0) {
+            fprintf(stderr, "Broken pipe\n");
+            abort();
+        }
+
+        if (log) {
+            len = write(2, &c, 1);
+        }
+        json_message_parser_feed(&qmp.parser, &c, 1);
+    }
+    json_message_parser_destroy(&qmp.parser);
+
+    return qmp.response;
+}
+
+/* Sends a message and file descriptors to the socket.
+ * It's needed for qmp-commands like getfd/add-fd */
+static void socket_send_fds(int socket_fd, int *fds, size_t fds_num,
+                            const char *buf, size_t buf_size)
+{
+    ssize_t ret;
+    struct msghdr msg = { 0 };
+    char control[CMSG_SPACE(sizeof(int) * SOCKET_MAX_FDS)] = { 0 };
+    size_t fdsize = sizeof(int) * fds_num;
+    struct cmsghdr *cmsg;
+    struct iovec iov = { .iov_base = (char *)buf, .iov_len = buf_size };
+
+    msg.msg_iov = &iov;
+    msg.msg_iovlen = 1;
+
+    if (fds && fds_num > 0) {
+        g_assert_cmpuint(fds_num, <, SOCKET_MAX_FDS);
+
+        msg.msg_control = control;
+        msg.msg_controllen = CMSG_SPACE(fdsize);
+
+        cmsg = CMSG_FIRSTHDR(&msg);
+        cmsg->cmsg_len = CMSG_LEN(fdsize);
+        cmsg->cmsg_level = SOL_SOCKET;
+        cmsg->cmsg_type = SCM_RIGHTS;
+        memcpy(CMSG_DATA(cmsg), fds, fdsize);
+    }
+
+    do {
+        ret = sendmsg(socket_fd, &msg, 0);
+    } while (ret < 0 && errno == EINTR);
+    g_assert_cmpint(ret, >, 0);
+}
+
+/**
+ * Allow users to send a message without waiting for the reply,
+ * in the case that they choose to discard all replies up until
+ * a particular EVENT is received.
+ */
+void qmp_fd_vsend_fds(int fd, int *fds, size_t fds_num,
+                      const char *fmt, va_list ap)
+{
+    QObject *qobj;
+
+    /* Going through qobject ensures we escape strings properly */
+    qobj = qobject_from_vjsonf_nofail(fmt, ap);
+
+    /* No need to send anything for an empty QObject.  */
+    if (qobj) {
+        int log = getenv("QTEST_LOG") != NULL;
+        GString *str = qobject_to_json(qobj);
+
+        /*
+         * BUG: QMP doesn't react to input until it sees a newline, an
+         * object, or an array.  Work-around: give it a newline.
+         */
+        g_string_append_c(str, '\n');
+
+        if (log) {
+            fprintf(stderr, "%s", str->str);
+        }
+        /* Send QMP request */
+        if (fds && fds_num > 0) {
+            socket_send_fds(fd, fds, fds_num, str->str, str->len);
+        } else {
+            socket_send(fd, str->str, str->len);
+        }
+
+        g_string_free(str, true);
+        qobject_unref(qobj);
+    }
+}
+
+void qmp_fd_vsend(int fd, const char *fmt, va_list ap)
+{
+    qmp_fd_vsend_fds(fd, NULL, 0, fmt, ap);
+}
+
+
+QDict *qmp_fdv(int fd, const char *fmt, va_list ap)
+{
+    qmp_fd_vsend_fds(fd, NULL, 0, fmt, ap);
+
+    return qmp_fd_receive(fd);
+}
+
+QDict *qmp_fd(int fd, const char *fmt, ...)
+{
+    va_list ap;
+    QDict *response;
+
+    va_start(ap, fmt);
+    response = qmp_fdv(fd, fmt, ap);
+    va_end(ap);
+    return response;
+}
+
+void qmp_fd_send(int fd, const char *fmt, ...)
+{
+    va_list ap;
+
+    va_start(ap, fmt);
+    qmp_fd_vsend(fd, fmt, ap);
+    va_end(ap);
+}
+
+void qmp_fd_vsend_raw(int fd, const char *fmt, va_list ap)
+{
+    bool log = getenv("QTEST_LOG") != NULL;
+    char *str = g_strdup_vprintf(fmt, ap);
+
+    if (log) {
+        fprintf(stderr, "%s", str);
+    }
+    socket_send(fd, str, strlen(str));
+    g_free(str);
+}
+
+void qmp_fd_send_raw(int fd, const char *fmt, ...)
+{
+    va_list ap;
+
+    va_start(ap, fmt);
+    qmp_fd_vsend_raw(fd, fmt, ap);
+    va_end(ap);
+}
+
+bool qmp_rsp_is_err(QDict *rsp)
+{
+    QDict *error = qdict_get_qdict(rsp, "error");
+    qobject_unref(rsp);
+    return !!error;
+}
+
+void qmp_expect_error_and_unref(QDict *rsp, const char *class)
+{
+    QDict *error = qdict_get_qdict(rsp, "error");
+
+    g_assert_cmpstr(qdict_get_try_str(error, "class"), ==, class);
+    g_assert_nonnull(qdict_get_try_str(error, "desc"));
+    g_assert(!qdict_haskey(rsp, "return"));
+
+    qobject_unref(rsp);
+}
diff --git a/tests/qtest/libqos/libqtest.c b/tests/qtest/libqos/libqtest.c
index 9097329ce435..e7beb136bbc5 100644
--- a/tests/qtest/libqos/libqtest.c
+++ b/tests/qtest/libqos/libqtest.c
@@ -21,10 +21,9 @@
 #include <sys/un.h>
 
 #include "libqtest.h"
+#include "libqmp.h"
 #include "qemu/ctype.h"
 #include "qemu/cutils.h"
-#include "qapi/error.h"
-#include "qapi/qmp/json-parser.h"
 #include "qapi/qmp/qdict.h"
 #include "qapi/qmp/qjson.h"
 #include "qapi/qmp/qlist.h"
@@ -32,8 +31,6 @@
 
 #define MAX_IRQ 256
 #define SOCKET_TIMEOUT 50
-#define SOCKET_MAX_FDS 16
-
 
 typedef void (*QTestSendFn)(QTestState *s, const char *buf);
 typedef void (*ExternalSendFn)(void *s, const char *buf);
@@ -436,40 +433,6 @@ static void G_GNUC_PRINTF(2, 3) qtest_sendf(QTestState *s, const char *fmt, ...)
     g_free(str);
 }
 
-/* Sends a message and file descriptors to the socket.
- * It's needed for qmp-commands like getfd/add-fd */
-static void socket_send_fds(int socket_fd, int *fds, size_t fds_num,
-                            const char *buf, size_t buf_size)
-{
-    ssize_t ret;
-    struct msghdr msg = { 0 };
-    char control[CMSG_SPACE(sizeof(int) * SOCKET_MAX_FDS)] = { 0 };
-    size_t fdsize = sizeof(int) * fds_num;
-    struct cmsghdr *cmsg;
-    struct iovec iov = { .iov_base = (char *)buf, .iov_len = buf_size };
-
-    msg.msg_iov = &iov;
-    msg.msg_iovlen = 1;
-
-    if (fds && fds_num > 0) {
-        g_assert_cmpuint(fds_num, <, SOCKET_MAX_FDS);
-
-        msg.msg_control = control;
-        msg.msg_controllen = CMSG_SPACE(fdsize);
-
-        cmsg = CMSG_FIRSTHDR(&msg);
-        cmsg->cmsg_len = CMSG_LEN(fdsize);
-        cmsg->cmsg_level = SOL_SOCKET;
-        cmsg->cmsg_type = SCM_RIGHTS;
-        memcpy(CMSG_DATA(cmsg), fds, fdsize);
-    }
-
-    do {
-        ret = sendmsg(socket_fd, &msg, 0);
-    } while (ret < 0 && errno == EINTR);
-    g_assert_cmpint(ret, >, 0);
-}
-
 static GString *qtest_client_socket_recv_line(QTestState *s)
 {
     GString *line;
@@ -564,59 +527,6 @@ static int qtest_query_target_endianness(QTestState *s)
     return big_endian;
 }
 
-typedef struct {
-    JSONMessageParser parser;
-    QDict *response;
-} QMPResponseParser;
-
-static void qmp_response(void *opaque, QObject *obj, Error *err)
-{
-    QMPResponseParser *qmp = opaque;
-
-    assert(!obj != !err);
-
-    if (err) {
-        error_prepend(&err, "QMP JSON response parsing failed: ");
-        error_report_err(err);
-        abort();
-    }
-
-    g_assert(!qmp->response);
-    qmp->response = qobject_to(QDict, obj);
-    g_assert(qmp->response);
-}
-
-QDict *qmp_fd_receive(int fd)
-{
-    QMPResponseParser qmp;
-    bool log = getenv("QTEST_LOG") != NULL;
-
-    qmp.response = NULL;
-    json_message_parser_init(&qmp.parser, qmp_response, &qmp, NULL);
-    while (!qmp.response) {
-        ssize_t len;
-        char c;
-
-        len = read(fd, &c, 1);
-        if (len == -1 && errno == EINTR) {
-            continue;
-        }
-
-        if (len == -1 || len == 0) {
-            fprintf(stderr, "Broken pipe\n");
-            abort();
-        }
-
-        if (log) {
-            len = write(2, &c, 1);
-        }
-        json_message_parser_feed(&qmp.parser, &c, 1);
-    }
-    json_message_parser_destroy(&qmp.parser);
-
-    return qmp.response;
-}
-
 QDict *qtest_qmp_receive(QTestState *s)
 {
     while (true) {
@@ -657,50 +567,6 @@ int qtest_socket_server(const char *socket_path)
     return sock;
 }
 
-/**
- * Allow users to send a message without waiting for the reply,
- * in the case that they choose to discard all replies up until
- * a particular EVENT is received.
- */
-void qmp_fd_vsend_fds(int fd, int *fds, size_t fds_num,
-                      const char *fmt, va_list ap)
-{
-    QObject *qobj;
-
-    /* Going through qobject ensures we escape strings properly */
-    qobj = qobject_from_vjsonf_nofail(fmt, ap);
-
-    /* No need to send anything for an empty QObject.  */
-    if (qobj) {
-        int log = getenv("QTEST_LOG") != NULL;
-        GString *str = qobject_to_json(qobj);
-
-        /*
-         * BUG: QMP doesn't react to input until it sees a newline, an
-         * object, or an array.  Work-around: give it a newline.
-         */
-        g_string_append_c(str, '\n');
-
-        if (log) {
-            fprintf(stderr, "%s", str->str);
-        }
-        /* Send QMP request */
-        if (fds && fds_num > 0) {
-            socket_send_fds(fd, fds, fds_num, str->str, str->len);
-        } else {
-            socket_send(fd, str->str, str->len);
-        }
-
-        g_string_free(str, true);
-        qobject_unref(qobj);
-    }
-}
-
-void qmp_fd_vsend(int fd, const char *fmt, va_list ap)
-{
-    qmp_fd_vsend_fds(fd, NULL, 0, fmt, ap);
-}
-
 void qtest_qmp_vsend_fds(QTestState *s, int *fds, size_t fds_num,
                          const char *fmt, va_list ap)
 {
@@ -712,13 +578,6 @@ void qtest_qmp_vsend(QTestState *s, const char *fmt, va_list ap)
     qmp_fd_vsend_fds(s->qmp_fd, NULL, 0, fmt, ap);
 }
 
-QDict *qmp_fdv(int fd, const char *fmt, va_list ap)
-{
-    qmp_fd_vsend_fds(fd, NULL, 0, fmt, ap);
-
-    return qmp_fd_receive(fd);
-}
-
 QDict *qtest_vqmp_fds(QTestState *s, int *fds, size_t fds_num,
                       const char *fmt, va_list ap)
 {
@@ -736,26 +595,6 @@ QDict *qtest_vqmp(QTestState *s, const char *fmt, va_list ap)
     return qtest_qmp_receive(s);
 }
 
-QDict *qmp_fd(int fd, const char *fmt, ...)
-{
-    va_list ap;
-    QDict *response;
-
-    va_start(ap, fmt);
-    response = qmp_fdv(fd, fmt, ap);
-    va_end(ap);
-    return response;
-}
-
-void qmp_fd_send(int fd, const char *fmt, ...)
-{
-    va_list ap;
-
-    va_start(ap, fmt);
-    qmp_fd_vsend(fd, fmt, ap);
-    va_end(ap);
-}
-
 QDict *qtest_qmp_fds(QTestState *s, int *fds, size_t fds_num,
                      const char *fmt, ...)
 {
@@ -788,27 +627,6 @@ void qtest_qmp_send(QTestState *s, const char *fmt, ...)
     va_end(ap);
 }
 
-void qmp_fd_vsend_raw(int fd, const char *fmt, va_list ap)
-{
-    bool log = getenv("QTEST_LOG") != NULL;
-    char *str = g_strdup_vprintf(fmt, ap);
-
-    if (log) {
-        fprintf(stderr, "%s", str);
-    }
-    socket_send(fd, str, strlen(str));
-    g_free(str);
-}
-
-void qmp_fd_send_raw(int fd, const char *fmt, ...)
-{
-    va_list ap;
-
-    va_start(ap, fmt);
-    qmp_fd_vsend_raw(fd, fmt, ap);
-    va_end(ap);
-}
-
 void qtest_qmp_send_raw(QTestState *s, const char *fmt, ...)
 {
     va_list ap;
@@ -1532,24 +1350,6 @@ void qtest_qmp_device_del(QTestState *qts, const char *id)
     qtest_qmp_eventwait(qts, "DEVICE_DELETED");
 }
 
-bool qmp_rsp_is_err(QDict *rsp)
-{
-    QDict *error = qdict_get_qdict(rsp, "error");
-    qobject_unref(rsp);
-    return !!error;
-}
-
-void qmp_expect_error_and_unref(QDict *rsp, const char *class)
-{
-    QDict *error = qdict_get_qdict(rsp, "error");
-
-    g_assert_cmpstr(qdict_get_try_str(error, "class"), ==, class);
-    g_assert_nonnull(qdict_get_try_str(error, "desc"));
-    g_assert(!qdict_haskey(rsp, "return"));
-
-    qobject_unref(rsp);
-}
-
 static void qtest_client_set_tx_handler(QTestState *s,
                     QTestSendFn send)
 {
diff --git a/tests/qtest/libqos/meson.build b/tests/qtest/libqos/meson.build
index 0c172f27533a..93c9e4b69c84 100644
--- a/tests/qtest/libqos/meson.build
+++ b/tests/qtest/libqos/meson.build
@@ -1,4 +1,7 @@
-libqos_srcs = files('libqtest.c',
+libqos_srcs = files(
+        'libqtest.c',
+        'libqmp.c',
+
         'qgraph.c',
         'qos_external.c',
         'pci.c',
diff --git a/tests/unit/meson.build b/tests/unit/meson.build
index 188b0ea80c37..26a26090fe8d 100644
--- a/tests/unit/meson.build
+++ b/tests/unit/meson.build
@@ -154,7 +154,7 @@ if have_system
 endif
 
 if have_ga and targetos == 'linux'
-  tests += {'test-qga': ['../qtest/libqos/libqtest.c']}
+  tests += {'test-qga': ['../qtest/libqos/libqmp.c']}
   test_deps += {'test-qga': qga}
 endif
 
-- 
2.35.1.693.g805e0a68082a



^ permalink raw reply related	[flat|nested] 124+ messages in thread

* [PATCH 35/41] util: simplify write in signal handler
  2022-04-20 13:25 [PATCH 00/41] Misc cleanups marcandre.lureau
                   ` (33 preceding siblings ...)
  2022-04-20 13:26 ` [PATCH 34/41] libqtest: split QMP part in libqmp marcandre.lureau
@ 2022-04-20 13:26 ` marcandre.lureau
  2022-04-20 15:49   ` Daniel P. Berrangé
  2022-04-20 13:26 ` [PATCH 36/41] util: use qemu_write_full() in qemu_write_pidfile() marcandre.lureau
                   ` (6 subsequent siblings)
  41 siblings, 1 reply; 124+ messages in thread
From: marcandre.lureau @ 2022-04-20 13:26 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Use qemu_write_full() instead of open-coding a write loop.

Signed-off-by: Marc-André Lureau <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 = 0;
-
             memset(&buffer, 0, sizeof(buffer));
             buffer.ssi_signo = sig;
 
-            while (offset < sizeof(buffer)) {
-                ssize_t len;
-
-                len = write(info->fd, (char *)&buffer + offset,
-                            sizeof(buffer) - offset);
-                if (len == -1 && errno == EINTR) {
-                    continue;
-                }
-
-                if (len <= 0) {
-                    return NULL;
-                }
-
-                offset += len;
+            if (qemu_write_full(info->fd, &buffer, sizeof(buffer)) != sizeof(buffer)) {
+                return NULL;
             }
         }
     }
-- 
2.35.1.693.g805e0a68082a



^ permalink raw reply related	[flat|nested] 124+ messages in thread

* [PATCH 36/41] util: use qemu_write_full() in qemu_write_pidfile()
  2022-04-20 13:25 [PATCH 00/41] Misc cleanups marcandre.lureau
                   ` (34 preceding siblings ...)
  2022-04-20 13:26 ` [PATCH 35/41] util: simplify write in signal handler marcandre.lureau
@ 2022-04-20 13:26 ` marcandre.lureau
  2022-04-20 15:49   ` Daniel P. Berrangé
  2022-04-20 13:26 ` [PATCH 37/41] util: use qemu_create() " marcandre.lureau
                   ` (5 subsequent siblings)
  41 siblings, 1 reply; 124+ messages in thread
From: marcandre.lureau @ 2022-04-20 13:26 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau, Paolo Bonzini

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Mostly for correctness.

Signed-off-by: Marc-André Lureau <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 63d2c6a76a77..e376f799b47e 100644
--- a/util/oslib-posix.c
+++ b/util/oslib-posix.c
@@ -184,7 +184,7 @@ bool qemu_write_pidfile(const char *path, Error **errp)
     }
 
     snprintf(pidstr, sizeof(pidstr), FMT_pid "\n", getpid());
-    if (write(fd, pidstr, strlen(pidstr)) != strlen(pidstr)) {
+    if (qemu_write_full(fd, pidstr, strlen(pidstr)) != strlen(pidstr)) {
         error_setg(errp, "Failed to write pid file");
         goto fail_unlink;
     }
-- 
2.35.1.693.g805e0a68082a



^ permalink raw reply related	[flat|nested] 124+ messages in thread

* [PATCH 37/41] util: use qemu_create() in qemu_write_pidfile()
  2022-04-20 13:25 [PATCH 00/41] Misc cleanups marcandre.lureau
                   ` (35 preceding siblings ...)
  2022-04-20 13:26 ` [PATCH 36/41] util: use qemu_write_full() in qemu_write_pidfile() marcandre.lureau
@ 2022-04-20 13:26 ` marcandre.lureau
  2022-04-20 15:50   ` Daniel P. Berrangé
  2022-04-20 13:26   ` [Virtio-fs] " marcandre.lureau
                   ` (4 subsequent siblings)
  41 siblings, 1 reply; 124+ messages in thread
From: marcandre.lureau @ 2022-04-20 13:26 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau, Paolo Bonzini

From: Marc-André Lureau <marcandre.lureau@redhat.com>

qemu_open_old(O_CREATE) should be replaced with qemu_create() which
handles Error reporting.

Signed-off-by: Marc-André Lureau <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 e376f799b47e..ed8a2558b14d 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 = 0,
         };
 
-        fd = qemu_open_old(path, O_CREAT | O_WRONLY, S_IRUSR | S_IWUSR);
+        fd = qemu_create(path, O_WRONLY, S_IRUSR | S_IWUSR, errp);
         if (fd == -1) {
-            error_setg_errno(errp, errno, "Cannot open pid file");
             return false;
         }
 
-- 
2.35.1.693.g805e0a68082a



^ permalink raw reply related	[flat|nested] 124+ messages in thread

* [PATCH 38/41] util: replace qemu_get_local_state_pathname()
  2022-04-20 13:25 [PATCH 00/41] Misc cleanups marcandre.lureau
@ 2022-04-20 13:26   ` marcandre.lureau
  2022-04-20 13:25 ` [PATCH 02/41] glib-compat: isolate g_date_time_format_iso8601 version-bypass marcandre.lureau
                     ` (40 subsequent siblings)
  41 siblings, 0 replies; 124+ messages in thread
From: marcandre.lureau @ 2022-04-20 13:26 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, open list:Block SCSI subsystem, Michael Roth,
	Dr. David Alan Gilbert, open list:virtiofs, Stefan Hajnoczi,
	Paolo Bonzini, Marc-André Lureau, Stefan Weil

From: Marc-André Lureau <marcandre.lureau@redhat.com>

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é Lureau <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 ccf10f05f806..220b44f710e5 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);
 
-/* Return a dynamically allocated pathname denoting a file or directory that 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 storing
+ * 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);
 
 /**
  * qemu_getauxval:
diff --git a/qga/main.c b/qga/main.c
index b1dae0659d16..daff9bb024f3 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 = qemu_get_local_state_dir();
+
     g_assert(dfl_pathnames.state_dir == NULL);
     g_assert(dfl_pathnames.pidfile == NULL);
-    dfl_pathnames.state_dir = qemu_get_local_state_pathname(
-      QGA_STATE_RELATIVE_DIR);
-    dfl_pathnames.pidfile   = qemu_get_local_state_pathname(
-      QGA_STATE_RELATIVE_DIR G_DIR_SEPARATOR_S "qemu-ga.pid");
+    dfl_pathnames.state_dir = g_build_filename(state, QGA_STATE_RELATIVE_DIR, NULL);
+    dfl_pathnames.pidfile = g_build_filename(state, QGA_STATE_RELATIVE_DIR, "qemu-ga.pid", NULL);
 }
 
 static void quit_handler(int sig)
diff --git a/scsi/qemu-pr-helper.c b/scsi/qemu-pr-helper.c
index e7549ffb3bc9..c77153392fcd 100644
--- a/scsi/qemu-pr-helper.c
+++ b/scsi/qemu-pr-helper.c
@@ -77,8 +77,10 @@ static int gid = -1;
 
 static void compute_default_paths(void)
 {
-    socket_path = qemu_get_local_state_pathname("run/qemu-pr-helper.sock");
-    pidfile = qemu_get_local_state_pathname("run/qemu-pr-helper.pid");
+    g_autofree char *state = qemu_get_local_state_dir();
+
+    socket_path = g_build_filename(state, "run", "qemu-pr-helper.sock", NULL);
+    pidfile = g_build_filename(state, "run", "qemu-pr-helper.pid", NULL);
 }
 
 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 = NULL;
     g_autofree gchar *pidfile = NULL;
+    g_autofree gchar *state = NULL;
     g_autofree gchar *dir = NULL;
     Error *local_err = NULL;
 
-    dir = qemu_get_local_state_pathname("run/virtiofsd");
+    state = qemu_get_local_state_dir();
+    dir = g_build_filename(state, "run", "virtiofsd", NULL);
 
     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 ed8a2558b14d..03d97741562c 100644
--- a/util/oslib-posix.c
+++ b/util/oslib-posix.c
@@ -297,12 +297,9 @@ int qemu_pipe(int pipefd[2])
 }
 
 char *
-qemu_get_local_state_pathname(const char *relative_pathname)
+qemu_get_local_state_dir(void)
 {
-    g_autofree char *dir = g_strdup_printf("%s/%s",
-                                           CONFIG_QEMU_LOCALSTATEDIR,
-                                           relative_pathname);
-    return get_relocated_path(dir);
+    return get_relocated_path(CONFIG_QEMU_LOCALSTATEDIR);
 }
 
 void qemu_set_tty_echo(int fd, bool echo)
diff --git a/util/oslib-win32.c b/util/oslib-win32.c
index 41df0a289e28..9483c4c1d5de 100644
--- a/util/oslib-win32.c
+++ b/util/oslib-win32.c
@@ -235,7 +235,7 @@ int qemu_get_thread_id(void)
 }
 
 char *
-qemu_get_local_state_pathname(const char *relative_pathname)
+qemu_get_local_state_dir(void)
 {
     HRESULT result;
     char base_path[MAX_PATH+1] = "";
@@ -247,8 +247,7 @@ qemu_get_local_state_pathname(const char *relative_pathname)
         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);
 }
 
 void qemu_set_tty_echo(int fd, bool echo)
-- 
2.35.1.693.g805e0a68082a



^ permalink raw reply related	[flat|nested] 124+ messages in thread

* [Virtio-fs] [PATCH 38/41] util: replace qemu_get_local_state_pathname()
@ 2022-04-20 13:26   ` marcandre.lureau
  0 siblings, 0 replies; 124+ messages in thread
From: marcandre.lureau @ 2022-04-20 13:26 UTC (permalink / raw)
  To: qemu-devel
  Cc: Marc-André Lureau, Michael Roth, Paolo Bonzini, Fam Zheng,
	Dr. David Alan Gilbert, Stefan Hajnoczi, Stefan Weil,
	open list:Block SCSI subsystem, open list:virtiofs

From: Marc-André Lureau <marcandre.lureau@redhat.com>

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é Lureau <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 ccf10f05f806..220b44f710e5 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);
 
-/* Return a dynamically allocated pathname denoting a file or directory that 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 storing
+ * 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);
 
 /**
  * qemu_getauxval:
diff --git a/qga/main.c b/qga/main.c
index b1dae0659d16..daff9bb024f3 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 = qemu_get_local_state_dir();
+
     g_assert(dfl_pathnames.state_dir == NULL);
     g_assert(dfl_pathnames.pidfile == NULL);
-    dfl_pathnames.state_dir = qemu_get_local_state_pathname(
-      QGA_STATE_RELATIVE_DIR);
-    dfl_pathnames.pidfile   = qemu_get_local_state_pathname(
-      QGA_STATE_RELATIVE_DIR G_DIR_SEPARATOR_S "qemu-ga.pid");
+    dfl_pathnames.state_dir = g_build_filename(state, QGA_STATE_RELATIVE_DIR, NULL);
+    dfl_pathnames.pidfile = g_build_filename(state, QGA_STATE_RELATIVE_DIR, "qemu-ga.pid", NULL);
 }
 
 static void quit_handler(int sig)
diff --git a/scsi/qemu-pr-helper.c b/scsi/qemu-pr-helper.c
index e7549ffb3bc9..c77153392fcd 100644
--- a/scsi/qemu-pr-helper.c
+++ b/scsi/qemu-pr-helper.c
@@ -77,8 +77,10 @@ static int gid = -1;
 
 static void compute_default_paths(void)
 {
-    socket_path = qemu_get_local_state_pathname("run/qemu-pr-helper.sock");
-    pidfile = qemu_get_local_state_pathname("run/qemu-pr-helper.pid");
+    g_autofree char *state = qemu_get_local_state_dir();
+
+    socket_path = g_build_filename(state, "run", "qemu-pr-helper.sock", NULL);
+    pidfile = g_build_filename(state, "run", "qemu-pr-helper.pid", NULL);
 }
 
 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 = NULL;
     g_autofree gchar *pidfile = NULL;
+    g_autofree gchar *state = NULL;
     g_autofree gchar *dir = NULL;
     Error *local_err = NULL;
 
-    dir = qemu_get_local_state_pathname("run/virtiofsd");
+    state = qemu_get_local_state_dir();
+    dir = g_build_filename(state, "run", "virtiofsd", NULL);
 
     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 ed8a2558b14d..03d97741562c 100644
--- a/util/oslib-posix.c
+++ b/util/oslib-posix.c
@@ -297,12 +297,9 @@ int qemu_pipe(int pipefd[2])
 }
 
 char *
-qemu_get_local_state_pathname(const char *relative_pathname)
+qemu_get_local_state_dir(void)
 {
-    g_autofree char *dir = g_strdup_printf("%s/%s",
-                                           CONFIG_QEMU_LOCALSTATEDIR,
-                                           relative_pathname);
-    return get_relocated_path(dir);
+    return get_relocated_path(CONFIG_QEMU_LOCALSTATEDIR);
 }
 
 void qemu_set_tty_echo(int fd, bool echo)
diff --git a/util/oslib-win32.c b/util/oslib-win32.c
index 41df0a289e28..9483c4c1d5de 100644
--- a/util/oslib-win32.c
+++ b/util/oslib-win32.c
@@ -235,7 +235,7 @@ int qemu_get_thread_id(void)
 }
 
 char *
-qemu_get_local_state_pathname(const char *relative_pathname)
+qemu_get_local_state_dir(void)
 {
     HRESULT result;
     char base_path[MAX_PATH+1] = "";
@@ -247,8 +247,7 @@ qemu_get_local_state_pathname(const char *relative_pathname)
         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);
 }
 
 void qemu_set_tty_echo(int fd, bool echo)
-- 
2.35.1.693.g805e0a68082a


^ permalink raw reply related	[flat|nested] 124+ messages in thread

* [PATCH 39/41] qga: remove need for QEMU atomic.h
  2022-04-20 13:25 [PATCH 00/41] Misc cleanups marcandre.lureau
                   ` (37 preceding siblings ...)
  2022-04-20 13:26   ` [Virtio-fs] " marcandre.lureau
@ 2022-04-20 13:26 ` marcandre.lureau
  2022-04-20 15:51   ` Daniel P. Berrangé
  2022-04-20 13:26 ` [PATCH 40/41] migration/ram: fix clang warning marcandre.lureau
                   ` (2 subsequent siblings)
  41 siblings, 1 reply; 124+ messages in thread
From: marcandre.lureau @ 2022-04-20 13:26 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau, Michael Roth

From: Marc-André Lureau <marcandre.lureau@redhat.com>

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é Lureau <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"
 
 /* Maximum captured guest-exec out_data/err_data - 16MB */
@@ -162,13 +161,12 @@ GuestExecStatus *qmp_guest_exec_status(int64_t pid, Error **errp)
 
     ges = g_new0(GuestExecStatus, 1);
 
-    bool finished = qatomic_mb_read(&gei->finished);
+    bool finished = gei->finished;
 
     /* need to wait till output channels are closed
      * to be sure we captured all output at this point */
     if (gei->has_output) {
-        finished = finished && qatomic_mb_read(&gei->out.closed);
-        finished = finished && qatomic_mb_read(&gei->err.closed);
+        finished &= gei->out.closed && gei->err.closed;
     }
 
     ges->exited = finished;
@@ -270,7 +268,7 @@ static void guest_exec_child_watch(GPid pid, gint status, gpointer data)
             (int32_t)gpid_to_int64(pid), (uint32_t)status);
 
     gei->status = status;
-    qatomic_mb_set(&gei->finished, true);
+    gei->finished = true;
 
     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 = true;
     g_free(p->data);
 
     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 = true;
     return false;
 }
 
-- 
2.35.1.693.g805e0a68082a



^ permalink raw reply related	[flat|nested] 124+ messages in thread

* [PATCH 40/41] migration/ram: fix clang warning
  2022-04-20 13:25 [PATCH 00/41] Misc cleanups marcandre.lureau
                   ` (38 preceding siblings ...)
  2022-04-20 13:26 ` [PATCH 39/41] qga: remove need for QEMU atomic.h marcandre.lureau
@ 2022-04-20 13:26 ` marcandre.lureau
  2022-04-20 14:10   ` Dr. David Alan Gilbert
  2022-04-20 13:26 ` [PATCH 41/41] tests/fuzz: fix warning marcandre.lureau
  2022-04-20 14:40 ` [PATCH 00/41] Misc cleanups Thomas Huth
  41 siblings, 1 reply; 124+ messages in thread
From: marcandre.lureau @ 2022-04-20 13:26 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau, Dr. David Alan Gilbert, Juan Quintela

From: Marc-André Lureau <marcandre.lureau@redhat.com>

../migration/ram.c:1292:31: warning: use of bitwise '&' with boolean operands [-Wbitwise-instead-of-logical]

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 migration/ram.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/migration/ram.c b/migration/ram.c
index 3532f64ecb98..0ef4bd63ebd5 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -1289,7 +1289,7 @@ static int save_normal_page(RAMState *rs, RAMBlock *block, ram_addr_t offset,
                                          offset | RAM_SAVE_FLAG_PAGE));
     if (async) {
         qemu_put_buffer_async(rs->f, buf, TARGET_PAGE_SIZE,
-                              migrate_release_ram() &
+                              migrate_release_ram() &&
                               migration_in_postcopy());
     } else {
         qemu_put_buffer(rs->f, buf, TARGET_PAGE_SIZE);
-- 
2.35.1.693.g805e0a68082a



^ permalink raw reply related	[flat|nested] 124+ messages in thread

* [PATCH 41/41] tests/fuzz: fix warning
  2022-04-20 13:25 [PATCH 00/41] Misc cleanups marcandre.lureau
                   ` (39 preceding siblings ...)
  2022-04-20 13:26 ` [PATCH 40/41] migration/ram: fix clang warning marcandre.lureau
@ 2022-04-20 13:26 ` marcandre.lureau
  2022-04-20 14:30   ` Thomas Huth
  2022-04-20 14:40 ` [PATCH 00/41] Misc cleanups Thomas Huth
  41 siblings, 1 reply; 124+ messages in thread
From: marcandre.lureau @ 2022-04-20 13:26 UTC (permalink / raw)
  To: qemu-devel
  Cc: Laurent Vivier, Thomas Huth, Darren Kenny, Qiuhao Li,
	Alexander Bulekov, Bandan Das, Stefan Hajnoczi, Paolo Bonzini,
	Marc-André Lureau

From: Marc-André Lureau <marcandre.lureau@redhat.com>

../tests/qtest/fuzz/generic_fuzz.c:746:17: warning: variable 'name' set but not used [-Wunused-but-set-variable]

Signed-off-by: Marc-André Lureau <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_fuzz.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)
 
 static int locate_fuzz_memory_regions(Object *child, void *opaque)
 {
-    const char *name;
     MemoryRegion *mr;
     if (object_dynamic_cast(child, TYPE_MEMORY_REGION)) {
         mr = MEMORY_REGION(child);
         if ((memory_region_is_ram(mr) ||
             memory_region_is_ram_device(mr) ||
             memory_region_is_rom(mr)) == false) {
-            name = 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.
-- 
2.35.1.693.g805e0a68082a



^ permalink raw reply related	[flat|nested] 124+ messages in thread

* Re: [PATCH 08/41] build-sys: simplify MSI's QEMU_GA_MANUFACTURER
  2022-04-20 13:25 ` [PATCH 08/41] build-sys: simplify MSI's QEMU_GA_MANUFACTURER marcandre.lureau
@ 2022-04-20 13:48   ` Konstantin Kostiuk
  2022-04-20 15:14     ` Daniel P. Berrangé
  0 siblings, 1 reply; 124+ messages in thread
From: Konstantin Kostiuk @ 2022-04-20 13:48 UTC (permalink / raw)
  To: Marc-André Lureau, Yan Vugenfirer; +Cc: Michael Roth, QEMU

[-- Attachment #1: Type: text/plain, Size: 4105 bytes --]

Hi Marc-André and Yan,

Currently, we use this for the mingw-qemu-ga-win package in CentOS Stream 9
and RHEL.
https://gitlab.com/redhat/centos-stream/rpms/mingw-qemu-ga-win/-/blob/c9s/build_configure.sh

Yan, do we need this feature or not?

Best Regards,
Konstantin Kostiuk.


On Wed, Apr 20, 2022 at 4:27 PM <marcandre.lureau@redhat.com> wrote:

> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> If there is any reason to allow customization of this variable, we
> should provide a proper configure option.
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  configure                 |  4 ----
>  qga/installer/qemu-ga.wxs | 10 ++++------
>  qga/meson.build           |  1 -
>  3 files changed, 4 insertions(+), 11 deletions(-)
>
> diff --git a/configure b/configure
> index 8cbe55ac82e8..5ac653b21351 100755
> --- a/configure
> +++ b/configure
> @@ -2694,9 +2694,6 @@ fi
>
>  # Guest agent Windows MSI package
>
> -if test "$QEMU_GA_MANUFACTURER" = ""; then
> -  QEMU_GA_MANUFACTURER=QEMU
> -fi
>  if test "$QEMU_GA_DISTRO" = ""; then
>    QEMU_GA_DISTRO=Linux
>  fi
> @@ -2790,7 +2787,6 @@ if test "$debug_tcg" = "yes" ; then
>  fi
>  if test "$mingw32" = "yes" ; then
>    echo "CONFIG_WIN32=y" >> $config_host_mak
> -  echo "QEMU_GA_MANUFACTURER=${QEMU_GA_MANUFACTURER}" >> $config_host_mak
>    echo "QEMU_GA_DISTRO=${QEMU_GA_DISTRO}" >> $config_host_mak
>    echo "QEMU_GA_VERSION=${QEMU_GA_VERSION}" >> $config_host_mak
>  else
> diff --git a/qga/installer/qemu-ga.wxs b/qga/installer/qemu-ga.wxs
> index 0950e8c6becc..53d836c06a96 100644
> --- a/qga/installer/qemu-ga.wxs
> +++ b/qga/installer/qemu-ga.wxs
> @@ -8,9 +8,7 @@
>      <?error Environment variable QEMU_GA_DISTRO undefined?>
>    <?endif?>
>
> -  <?ifndef env.QEMU_GA_MANUFACTURER ?>
> -    <?error Environment variable QEMU_GA_MANUFACTURER undefined?>
> -  <?endif?>
> +  <?define QEMU_GA_MANUFACTURER = "QEMU" ?>
>
>    <?ifndef var.Arch?>
>      <?error Define Arch to 32 or 64?>
> @@ -43,14 +41,14 @@
>      Name="QEMU guest agent"
>      Id="*"
>      UpgradeCode="{EB6B8302-C06E-4BEC-ADAC-932C68A3A98D}"
> -    Manufacturer="$(env.QEMU_GA_MANUFACTURER)"
> +    Manufacturer="$(var.QEMU_GA_MANUFACTURER)"
>      Version="$(env.QEMU_GA_VERSION)"
>      Language="1033">
>      <?if $(var.Arch) = 32 ?>
>      <Condition Message="Error: 32-bit version of Qemu GA can not be
> installed on 64-bit Windows.">NOT VersionNT64</Condition>
>      <?endif?>
>      <Package
> -      Manufacturer="$(env.QEMU_GA_MANUFACTURER)"
> +      Manufacturer="$(var.QEMU_GA_MANUFACTURER)"
>        InstallerVersion="200"
>        Languages="1033"
>        Compressed="yes"
> @@ -133,7 +131,7 @@
>            </Component>
>            <Component Id="registry_entries"
> Guid="{D075D109-51CA-11E3-9F8B-000C29858960}">
>              <RegistryKey Root="HKLM"
> -
>  Key="Software\$(env.QEMU_GA_MANUFACTURER)\$(env.QEMU_GA_DISTRO)\Tools\QemuGA">
> +
>  Key="Software\$(var.QEMU_GA_MANUFACTURER)\$(env.QEMU_GA_DISTRO)\Tools\QemuGA">
>                <RegistryValue Type="string" Name="ProductID"
> Value="fb0a0d66-c7fb-4e2e-a16b-c4a3bfe8d13b" />
>                <RegistryValue Type="string" Name="Version"
> Value="$(env.QEMU_GA_VERSION)" />
>              </RegistryKey>
> diff --git a/qga/meson.build b/qga/meson.build
> index da5e5efb19e8..6e57de430d29 100644
> --- a/qga/meson.build
> +++ b/qga/meson.build
> @@ -123,7 +123,6 @@ if targetos == 'windows'
>                              command: [
>                                find_program('env'),
>                                'QEMU_GA_VERSION=' +
> config_host['QEMU_GA_VERSION'],
> -                              'QEMU_GA_MANUFACTURER=' +
> config_host['QEMU_GA_MANUFACTURER'],
>                                'QEMU_GA_DISTRO=' +
> config_host['QEMU_GA_DISTRO'],
>                                'BUILD_DIR=' + meson.build_root(),
>                                wixl, '-o', '@OUTPUT0@', '@INPUT0@',
> --
> 2.35.1.693.g805e0a68082a
>
>

[-- Attachment #2: Type: text/html, Size: 5950 bytes --]

^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 31/41] qga: move qga_get_host_name()
  2022-04-20 13:26 ` [PATCH 31/41] qga: move qga_get_host_name() marcandre.lureau
@ 2022-04-20 13:51   ` Konstantin Kostiuk
  2022-04-20 15:44   ` Daniel P. Berrangé
  1 sibling, 0 replies; 124+ messages in thread
From: Konstantin Kostiuk @ 2022-04-20 13:51 UTC (permalink / raw)
  To: Marc-André Lureau; +Cc: Michael Roth, Stefan Weil, QEMU, Paolo Bonzini

[-- Attachment #1: Type: text/plain, Size: 6520 bytes --]

Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com>

On Wed, Apr 20, 2022 at 4:30 PM <marcandre.lureau@redhat.com> wrote:

> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> The function is specific to qemu-ga, no need to share it in QEMU.
>
> Signed-off-by: Marc-André Lureau <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 9fd52d6a33a7..ccf10f05f806 100644
> --- a/include/qemu/osdep.h
> +++ b/include/qemu/osdep.h
> @@ -648,16 +648,6 @@ int qemu_fdatasync(int fd);
>   */
>  int qemu_msync(void *addr, size_t length, int fd);
>
> -/**
> - * 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,
> Error **errp);
>  GuestFileRead *guest_file_read_unsafe(GuestFileHandle *gfh,
>                                        int64_t count, Error **errp);
>
> +/**
> + * 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
> **errp)
>
>      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 = -1;
> +    g_autofree char *hostname = NULL;
> +
> +#ifdef _SC_HOST_NAME_MAX
> +    len = sysconf(_SC_HOST_NAME_MAX);
> +#endif /* _SC_HOST_NAME_MAX */
> +
> +    if (len < 0) {
> +        len = HOST_NAME_MAX;
> +    }
> +
> +    /* Unfortunately, gethostname() below does not guarantee a
> +     * NULL terminated string. Therefore, allocate one byte more
> +     * to be sure. */
> +    hostname = 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
> **errp)
>      }
>      return head;
>  }
> +
> +char *qga_get_host_name(Error **errp)
> +{
> +    wchar_t tmp[MAX_COMPUTERNAME_LENGTH + 1];
> +    DWORD size = G_N_ELEMENTS(tmp);
> +
> +    if (GetComputerNameW(tmp, &size) == 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
> **errp)
>  GuestHostName *qmp_guest_get_host_name(Error **errp)
>  {
>      GuestHostName *result = NULL;
> -    g_autofree char *hostname = qemu_get_host_name(errp);
> +    g_autofree char *hostname = qga_get_host_name(errp);
>
>      /*
>       * We want to avoid using g_get_host_name() because that
> diff --git a/util/oslib-posix.c b/util/oslib-posix.c
> index 4f18cc612850..63d2c6a76a77 100644
> --- a/util/oslib-posix.c
> +++ b/util/oslib-posix.c
> @@ -805,41 +805,6 @@ void sigaction_invoke(struct sigaction *action,
>      action->sa_sigaction(info->ssi_signo, &si, 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 *qemu_get_host_name(Error **errp)
> -{
> -    long len = -1;
> -    g_autofree char *hostname = NULL;
> -
> -#ifdef _SC_HOST_NAME_MAX
> -    len = sysconf(_SC_HOST_NAME_MAX);
> -#endif /* _SC_HOST_NAME_MAX */
> -
> -    if (len < 0) {
> -        len = HOST_NAME_MAX;
> -    }
> -
> -    /* Unfortunately, gethostname() below does not guarantee a
> -     * NULL terminated string. Therefore, allocate one byte more
> -     * to be sure. */
> -    hostname = 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 0371082d23b3..41df0a289e28 100644
> --- a/util/oslib-win32.c
> +++ b/util/oslib-win32.c
> @@ -537,19 +537,6 @@ bool qemu_write_pidfile(const char *filename, Error
> **errp)
>      return true;
>  }
>
> -char *qemu_get_host_name(Error **errp)
> -{
> -    wchar_t tmp[MAX_COMPUTERNAME_LENGTH + 1];
> -    DWORD size = G_N_ELEMENTS(tmp);
> -
> -    if (GetComputerNameW(tmp, &size) == 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;
> --
> 2.35.1.693.g805e0a68082a
>
>

[-- Attachment #2: Type: text/html, Size: 7726 bytes --]

^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 40/41] migration/ram: fix clang warning
  2022-04-20 13:26 ` [PATCH 40/41] migration/ram: fix clang warning marcandre.lureau
@ 2022-04-20 14:10   ` Dr. David Alan Gilbert
  0 siblings, 0 replies; 124+ messages in thread
From: Dr. David Alan Gilbert @ 2022-04-20 14:10 UTC (permalink / raw)
  To: marcandre.lureau; +Cc: qemu-devel, Juan Quintela

* marcandre.lureau@redhat.com (marcandre.lureau@redhat.com) wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> ../migration/ram.c:1292:31: warning: use of bitwise '&' with boolean operands [-Wbitwise-instead-of-logical]
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>

Yeh that's the same as:
https://lists.gnu.org/archive/html/qemu-devel/2022-04/msg00640.html

Dave

> ---
>  migration/ram.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/migration/ram.c b/migration/ram.c
> index 3532f64ecb98..0ef4bd63ebd5 100644
> --- a/migration/ram.c
> +++ b/migration/ram.c
> @@ -1289,7 +1289,7 @@ static int save_normal_page(RAMState *rs, RAMBlock *block, ram_addr_t offset,
>                                           offset | RAM_SAVE_FLAG_PAGE));
>      if (async) {
>          qemu_put_buffer_async(rs->f, buf, TARGET_PAGE_SIZE,
> -                              migrate_release_ram() &
> +                              migrate_release_ram() &&
>                                migration_in_postcopy());
>      } else {
>          qemu_put_buffer(rs->f, buf, TARGET_PAGE_SIZE);
> -- 
> 2.35.1.693.g805e0a68082a
> 
-- 
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 17/41] doc/build-platforms: document supported compilers
  2022-04-20 13:26 ` [PATCH 17/41] doc/build-platforms: document supported compilers marcandre.lureau
@ 2022-04-20 14:10   ` Daniel P. Berrangé
  2022-04-20 14:32     ` Marc-André Lureau
  2022-04-20 14:36     ` Thomas Huth
  0 siblings, 2 replies; 124+ messages in thread
From: Daniel P. Berrangé @ 2022-04-20 14:10 UTC (permalink / raw)
  To: marcandre.lureau; +Cc: qemu-devel

On Wed, Apr 20, 2022 at 05:26:00PM +0400, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> According to our configure checks, this is the list of supported
> compilers.
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> Reviewed-by: Damien Hedde <damien.hedde@greensocs.com>
> ---
>  docs/about/build-platforms.rst | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/docs/about/build-platforms.rst b/docs/about/build-platforms.rst
> index c29a4b8fe649..1980c5d2476f 100644
> --- a/docs/about/build-platforms.rst
> +++ b/docs/about/build-platforms.rst
> @@ -92,6 +92,16 @@ hosted on Linux (Debian/Fedora).
>  The version of the Windows API that's currently targeted is Vista / Server
>  2008.
>  
> +Supported compilers
> +-------------------
> +
> +To compile, QEMU requires either:
> +
> +- GCC >= 7.4.0
> +- Clang >= 6.0
> +- XCode Clang >= 10.0

Do we need to spell out the versions explicitly ? These versions are
all derived from what's available in the repos of the supported build
platforms, similar to any other build deps we have. I don't think we
want to start a precedent of duplicating versions in this doc for
build deps we have, and there's nothing particularly special about
compilers in this respect.

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 33/41] tests: move libqtest.c under libqos/
  2022-04-20 13:26 ` [PATCH 33/41] tests: move libqtest.c under libqos/ marcandre.lureau
@ 2022-04-20 14:16   ` Thomas Huth
  2022-04-20 15:48   ` Daniel P. Berrangé
  1 sibling, 0 replies; 124+ messages in thread
From: Thomas Huth @ 2022-04-20 14:16 UTC (permalink / raw)
  To: marcandre.lureau, qemu-devel; +Cc: Laurent Vivier, Paolo Bonzini

On 20/04/2022 15.26, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> Since commit a2ce7dbd917 ("meson: convert tests/qtest to meson"),
> libqtest.h is under libqos/ directory. Let's move the .c along with it.
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>   docs/devel/qtest.rst                | 4 ++--
>   tests/qtest/{ => libqos}/libqtest.c | 4 ++--
>

This is definitely wrong. libqtest.c is the outer framework for the qtests, 
and should certainly not reside within libqos, i.e. the qtests that are not 
using the libqos framework should not depend on files in libqos.

Not sure why libqtest.h got moved there, but that certainly was a mistake, 
too. Please move libqtest.h back to the tests/qtest/ folder instead.

  Thomas



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 28/41] Use QEMU_SANITIZE_ADDRESS
  2022-04-20 13:26 ` [PATCH 28/41] Use QEMU_SANITIZE_ADDRESS marcandre.lureau
@ 2022-04-20 14:20   ` Thomas Huth
  2022-04-20 14:35     ` Marc-André Lureau
  0 siblings, 1 reply; 124+ messages in thread
From: Thomas Huth @ 2022-04-20 14:20 UTC (permalink / raw)
  To: marcandre.lureau, qemu-devel
  Cc: Laurent Vivier, Kevin Wolf, open list:Floppy, Stefan Hajnoczi,
	Paolo Bonzini, John Snow

On 20/04/2022 15.26, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>   tests/qtest/fdc-test.c    | 2 +-
>   util/coroutine-ucontext.c | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/qtest/fdc-test.c b/tests/qtest/fdc-test.c
> index 4aa72f36431f..0b3c2c0d523f 100644
> --- a/tests/qtest/fdc-test.c
> +++ b/tests/qtest/fdc-test.c
> @@ -550,7 +550,7 @@ static void fuzz_registers(void)
>   
>   static bool qtest_check_clang_sanitizer(void)
>   {
> -#if defined(__SANITIZE_ADDRESS__) || __has_feature(address_sanitizer)
> +#ifdef QEMU_SANITIZE_ADDRESS
>       return true;
>   #else
>       g_test_skip("QEMU not configured using --enable-sanitizers");
> diff --git a/util/coroutine-ucontext.c b/util/coroutine-ucontext.c
> index 904b375192ca..52725f5344fb 100644
> --- a/util/coroutine-ucontext.c
> +++ b/util/coroutine-ucontext.c
> @@ -30,7 +30,7 @@
>   #include <valgrind/valgrind.h>
>   #endif
>   
> -#if defined(__SANITIZE_ADDRESS__) || __has_feature(address_sanitizer)
> +#ifdef QEMU_SANITIZE_THREAD

Shouldn't that be QEMU_SANITIZE_ADDRESS instead?

  Thomas




^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 06/41] include: rename qemu-common.h qemu/copyright.h
  2022-04-20 13:25   ` [Virtio-fs] " marcandre.lureau
@ 2022-04-20 14:23     ` Warner Losh
  -1 siblings, 0 replies; 124+ messages in thread
From: Warner Losh @ 2022-04-20 14:23 UTC (permalink / raw)
  To: Marc-André Lureau
  Cc: Kevin Wolf, Fam Zheng, Vladimir Sementsov-Ogievskiy,
	Akihiko Odaki, open list:Block layer core, Peter Maydell,
	Kyle Evans, QEMU Developers, Laurent Vivier, open list:virtiofs,
	Hanna Reitz, Gerd Hoffmann, Stefan Hajnoczi, Michael Roth,
	Paolo Bonzini, Eric Blake, Dr. David Alan Gilbert,
	Philippe Mathieu-Daudé

[-- Attachment #1: Type: text/plain, Size: 5462 bytes --]

On Wed, Apr 20, 2022 at 7:26 AM <marcandre.lureau@redhat.com> wrote:

> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> Suggested-by: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
>

Reviewed-by: Warner Losh <imp@bsdimp.com>


> ---
>  include/{qemu-common.h => qemu/copyright.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 => qemu/copyright.h} (100%)
>
> diff --git a/include/qemu-common.h b/include/qemu/copyright.h
> similarity index 100%
> rename from include/qemu-common.h
> rename to include/qemu/copyright.h
> diff --git a/bsd-user/main.c b/bsd-user/main.c
> index 88d347d05ebf..aaab3f278534 100644
> --- a/bsd-user/main.c
> +++ b/bsd-user/main.c
> @@ -24,7 +24,7 @@
>  #include <sys/sysctl.h>
>
>  #include "qemu/osdep.h"
> -#include "qemu-common.h"
> +#include "qemu/copyright.h"
>  #include "qemu/units.h"
>  #include "qemu/accel.h"
>  #include "sysemu/tcg.h"
> diff --git a/linux-user/main.c b/linux-user/main.c
> index fbc9bcfd5f5f..744d216b1e8e 100644
> --- a/linux-user/main.c
> +++ b/linux-user/main.c
> @@ -18,7 +18,7 @@
>   */
>
>  #include "qemu/osdep.h"
> -#include "qemu-common.h"
> +#include "qemu/copyright.h"
>  #include "qemu/units.h"
>  #include "qemu/accel.h"
>  #include "sysemu/tcg.h"
> diff --git a/qemu-img.c b/qemu-img.c
> index 116e05867558..a2b1d3653a1e 100644
> --- a/qemu-img.c
> +++ b/qemu-img.c
> @@ -25,7 +25,7 @@
>  #include "qemu/osdep.h"
>  #include <getopt.h>
>
> -#include "qemu-common.h"
> +#include "qemu/copyright.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 eb8afc8b413b..952a36643b0c 100644
> --- a/qemu-io.c
> +++ b/qemu-io.c
> @@ -15,7 +15,7 @@
>  #include <termios.h>
>  #endif
>
> -#include "qemu-common.h"
> +#include "qemu/copyright.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 713e7557a9eb..f4d121c0c40e 100644
> --- a/qemu-nbd.c
> +++ b/qemu-nbd.c
> @@ -21,7 +21,7 @@
>  #include <libgen.h>
>  #include <pthread.h>
>
> -#include "qemu-common.h"
> +#include "qemu/copyright.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 ac63d8e47802..8994f73e4735 100644
> --- a/qga/main.c
> +++ b/qga/main.c
> @@ -18,7 +18,7 @@
>  #include <syslog.h>
>  #include <sys/wait.h>
>  #endif
> -#include "qemu-common.h"
> +#include "qemu/copyright.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 f281daeced8d..e7549ffb3bc9 100644
> --- a/scsi/qemu-pr-helper.c
> +++ b/scsi/qemu-pr-helper.c
> @@ -36,7 +36,7 @@
>  #include <mpath_persist.h>
>  #endif
>
> -#include "qemu-common.h"
> +#include "qemu/copyright.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 46aba6a039c4..b0bf16e16aaa 100644
> --- a/softmmu/vl.c
> +++ b/softmmu/vl.c
> @@ -23,7 +23,7 @@
>   */
>
>  #include "qemu/osdep.h"
> -#include "qemu-common.h"
> +#include "qemu/copyright.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-storage-daemon.c
> index eb724072579a..a4415e8c995b 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"
>
> -#include "qemu-common.h"
> +#include "qemu/copyright.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..8af28f5fb823 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/copyright.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..a2a74656fabf 100644
> --- a/ui/cocoa.m
> +++ b/ui/cocoa.m
> @@ -27,7 +27,7 @@
>  #import <Cocoa/Cocoa.h>
>  #include <crt_externs.h>
>
> -#include "qemu-common.h"
> +#include "qemu/copyright.h"
>  #include "qemu-main.h"
>  #include "ui/clipboard.h"
>  #include "ui/console.h"
> --
> 2.35.1.693.g805e0a68082a
>
>

[-- Attachment #2: Type: text/html, Size: 7462 bytes --]

^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [Virtio-fs] [PATCH 06/41] include: rename qemu-common.h qemu/copyright.h
@ 2022-04-20 14:23     ` Warner Losh
  0 siblings, 0 replies; 124+ messages in thread
From: Warner Losh @ 2022-04-20 14:23 UTC (permalink / raw)
  To: Marc-André Lureau
  Cc: QEMU Developers, Kyle Evans, Laurent Vivier, Kevin Wolf,
	Hanna Reitz, Eric Blake, Vladimir Sementsov-Ogievskiy,
	Michael Roth, Paolo Bonzini, Fam Zheng, Dr. David Alan Gilbert,
	Stefan Hajnoczi, Peter Maydell, Philippe Mathieu-Daudé,
	Akihiko Odaki, Gerd Hoffmann, open list:Block layer core,
	open list:virtiofs

[-- Attachment #1: Type: text/plain, Size: 5462 bytes --]

On Wed, Apr 20, 2022 at 7:26 AM <marcandre.lureau@redhat.com> wrote:

> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> Suggested-by: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
>

Reviewed-by: Warner Losh <imp@bsdimp.com>


> ---
>  include/{qemu-common.h => qemu/copyright.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 => qemu/copyright.h} (100%)
>
> diff --git a/include/qemu-common.h b/include/qemu/copyright.h
> similarity index 100%
> rename from include/qemu-common.h
> rename to include/qemu/copyright.h
> diff --git a/bsd-user/main.c b/bsd-user/main.c
> index 88d347d05ebf..aaab3f278534 100644
> --- a/bsd-user/main.c
> +++ b/bsd-user/main.c
> @@ -24,7 +24,7 @@
>  #include <sys/sysctl.h>
>
>  #include "qemu/osdep.h"
> -#include "qemu-common.h"
> +#include "qemu/copyright.h"
>  #include "qemu/units.h"
>  #include "qemu/accel.h"
>  #include "sysemu/tcg.h"
> diff --git a/linux-user/main.c b/linux-user/main.c
> index fbc9bcfd5f5f..744d216b1e8e 100644
> --- a/linux-user/main.c
> +++ b/linux-user/main.c
> @@ -18,7 +18,7 @@
>   */
>
>  #include "qemu/osdep.h"
> -#include "qemu-common.h"
> +#include "qemu/copyright.h"
>  #include "qemu/units.h"
>  #include "qemu/accel.h"
>  #include "sysemu/tcg.h"
> diff --git a/qemu-img.c b/qemu-img.c
> index 116e05867558..a2b1d3653a1e 100644
> --- a/qemu-img.c
> +++ b/qemu-img.c
> @@ -25,7 +25,7 @@
>  #include "qemu/osdep.h"
>  #include <getopt.h>
>
> -#include "qemu-common.h"
> +#include "qemu/copyright.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 eb8afc8b413b..952a36643b0c 100644
> --- a/qemu-io.c
> +++ b/qemu-io.c
> @@ -15,7 +15,7 @@
>  #include <termios.h>
>  #endif
>
> -#include "qemu-common.h"
> +#include "qemu/copyright.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 713e7557a9eb..f4d121c0c40e 100644
> --- a/qemu-nbd.c
> +++ b/qemu-nbd.c
> @@ -21,7 +21,7 @@
>  #include <libgen.h>
>  #include <pthread.h>
>
> -#include "qemu-common.h"
> +#include "qemu/copyright.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 ac63d8e47802..8994f73e4735 100644
> --- a/qga/main.c
> +++ b/qga/main.c
> @@ -18,7 +18,7 @@
>  #include <syslog.h>
>  #include <sys/wait.h>
>  #endif
> -#include "qemu-common.h"
> +#include "qemu/copyright.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 f281daeced8d..e7549ffb3bc9 100644
> --- a/scsi/qemu-pr-helper.c
> +++ b/scsi/qemu-pr-helper.c
> @@ -36,7 +36,7 @@
>  #include <mpath_persist.h>
>  #endif
>
> -#include "qemu-common.h"
> +#include "qemu/copyright.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 46aba6a039c4..b0bf16e16aaa 100644
> --- a/softmmu/vl.c
> +++ b/softmmu/vl.c
> @@ -23,7 +23,7 @@
>   */
>
>  #include "qemu/osdep.h"
> -#include "qemu-common.h"
> +#include "qemu/copyright.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-storage-daemon.c
> index eb724072579a..a4415e8c995b 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"
>
> -#include "qemu-common.h"
> +#include "qemu/copyright.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..8af28f5fb823 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/copyright.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..a2a74656fabf 100644
> --- a/ui/cocoa.m
> +++ b/ui/cocoa.m
> @@ -27,7 +27,7 @@
>  #import <Cocoa/Cocoa.h>
>  #include <crt_externs.h>
>
> -#include "qemu-common.h"
> +#include "qemu/copyright.h"
>  #include "qemu-main.h"
>  #include "ui/clipboard.h"
>  #include "ui/console.h"
> --
> 2.35.1.693.g805e0a68082a
>
>

[-- Attachment #2: Type: text/html, Size: 7462 bytes --]

^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 32/41] qtest: simplify socket_send()
  2022-04-20 13:26 ` [PATCH 32/41] qtest: simplify socket_send() marcandre.lureau
@ 2022-04-20 14:24   ` Thomas Huth
  2022-04-20 15:45   ` Daniel P. Berrangé
  1 sibling, 0 replies; 124+ messages in thread
From: Thomas Huth @ 2022-04-20 14:24 UTC (permalink / raw)
  To: marcandre.lureau, qemu-devel; +Cc: Laurent Vivier, Paolo Bonzini

On 20/04/2022 15.26, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> Reuse qemu_write_full().
> 
> Signed-off-by: Marc-André Lureau <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)
>   
>   static void socket_send(int fd, const char *buf, size_t size)
>   {
> -    size_t offset;
> -
> -    offset = 0;
> -    while (offset < size) {
> -        ssize_t len;
> +    size_t res = qemu_write_full(fd, buf, size);
>   
> -        len = write(fd, buf + offset, size - offset);
> -        if (len == -1 && errno == EINTR) {
> -            continue;
> -        }
> -
> -        g_assert_cmpint(len, >, 0);
> -
> -        offset += len;
> -    }
> +    assert(res == size);
>   }
>   
>   static void qtest_client_socket_send(QTestState *s, const char *buf)

Reviewed-by: Thomas Huth <thuth@redhat.com>



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 19/41] compiler.h: replace QEMU_NORETURN with G_NORETURN
  2022-04-20 13:26   ` marcandre.lureau
@ 2022-04-20 14:24     ` Warner Losh
  -1 siblings, 0 replies; 124+ messages in thread
From: Warner Losh @ 2022-04-20 14:24 UTC (permalink / raw)
  To: Marc-André Lureau
  Cc: Peter Maydell, Cornelia Huck, David Hildenbrand, Bin Meng,
	Mark Cave-Ayland, QEMU Developers, Laurent Vivier, Yanan Wang,
	Max Filippov, Taylor Simpson, Alistair Francis,
	Edgar E. Iglesias, Marek Vasut, Yoshinori Sato,
	Daniel Henrique Barboza, Thomas Huth, open list:PowerPC TCG CPUs,
	Artyom Tarasenko, Kevin Wolf, Aleksandar Rikalo, Kyle Evans,
	Richard Henderson, Dr. David Alan Gilbert, Greg Kurz,
	open list:S390 TCG CPUs, open list:ARM TCG CPUs,
	Cédric Le Goater, Stafford Horne, Alex Bennée,
	David Gibson, Eduardo Habkost, open list:RISC-V TCG CPUs,
	open list:Block layer core, Bastian Koppelmann, Chris Wulff,
	Philippe Mathieu-Daudé,
	Hanna Reitz, Palmer Dabbelt, Paolo Bonzini, Aurelien Jarno

[-- Attachment #1: Type: text/plain, Size: 60352 bytes --]

On Wed, Apr 20, 2022 at 7:28 AM <marcandre.lureau@redhat.com> wrote:

> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> 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é Lureau <marcandre.lureau@redhat.com>
>

Reviewed-by: Warner Losh <imp@bsdimp.com>

Most of this looks mechanical, but I only looked closely at the bsd-user
changes.



> ---
>  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);
>
> 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,
> TranslationBlock *tb,
>   */
>  bool cpu_restore_state(CPUState *cpu, uintptr_t searched_pc, bool
> will_exit);
>
> -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);
>
>  /**
>   * 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);
>
>  /**
>   * 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);
>
>  #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
>
>  #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)
>
>  #pragma GCC diagnostic pop
>
> +#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,
> vaddr addr, vaddr len);
>   */
>  AddressSpace *cpu_get_address_space(CPUState *cpu, int asidx);
>
> -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);
>
>  /* $(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_NORETURN;
> +    G_NORETURN void (*do_unaligned_access)(CPUState *cpu, vaddr addr,
> +                                           MMUAccessType access_type,
> +                                           int mmu_idx, uintptr_t
> retaddr);
>
>      /**
>       * @adjust_watchpoint_address: hack for cpu_check_watchpoint used by
> ARM
> 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
>
> -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);
>
>  #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
>
> -#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);
>
>  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
> addr, uint64_t val,
>
>  #else
>
> -void QEMU_NORETURN helper_unaligned_ld(CPUArchState *env, target_ulong
> addr);
> -void QEMU_NORETURN helper_unaligned_st(CPUArchState *env, target_ulong
> addr);
> +G_NORETURN void helper_unaligned_ld(CPUArchState *env, target_ulong addr);
> +G_NORETURN void helper_unaligned_st(CPUArchState *env, target_ulong addr);
>
>  #endif /* CONFIG_SOFTMMU */
>  #endif /* TCG_LDST_H */
> diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h
> index 73869fd9d04f..688d1fb46077 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
>
>  /* 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 @@
>   */
>
>  /* 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))
>
> 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
>
>  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);
>
>  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
> address,
>  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,
> int 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);
>
>  /*
>   * 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_el,
>                                        uintptr_t ra);
>
> @@ -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);
>
>  /* Raise a data fault alignment exception for the specified virtual
> address */
> -void arm_cpu_do_unaligned_access(CPUState *cs, vaddr vaddr,
> -                                 MMUAccessType access_type,
> -                                 int mmu_idx, uintptr_t retaddr)
> QEMU_NORETURN;
> +G_NORETURN void arm_cpu_do_unaligned_access(CPUState *cs, vaddr vaddr,
> +                                            MMUAccessType access_type,
> +                                            int mmu_idx, uintptr_t
> retaddr);
>
>  /* 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
> ra);
>
>  #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);
>
>  /* excp_helper.c */
> -void QEMU_NORETURN raise_exception(CPUX86State *env, int exception_index);
> -void QEMU_NORETURN raise_exception_ra(CPUX86State *env, int
> exception_index,
> -                                      uintptr_t retaddr);
> -void QEMU_NORETURN raise_exception_err(CPUX86State *env, int
> exception_index,
> -                                       int error_code);
> -void QEMU_NORETURN raise_exception_err_ra(CPUX86State *env, int
> exception_index,
> -                                          int error_code, uintptr_t
> retaddr);
> -void QEMU_NORETURN raise_interrupt(CPUX86State *nenv, int intno, int
> is_int,
> -                                   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_index,
> +                                       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);
>
>  /* cc_helper.c */
>  extern const uint8_t parity_table[256];
>
>  /* 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);
>
>  /* 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
>
> 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_NORETURN;
> +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);
>
>  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,
> int mmu_idx,
> +                                             uintptr_t retaddr);
>
>  const char *mips_exception_name(int32_t exception);
>
> -void QEMU_NORETURN do_raise_exception_err(CPUMIPSState *env, uint32_t
> exception,
> -                                          int error_code, uintptr_t pc);
> +G_NORETURN void do_raise_exception_err(CPUMIPSState *env, uint32_t
> exception,
> +                                       int error_code, uintptr_t pc);
>
> -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,
> int mmu_idx,
> +                                              uintptr_t retaddr);
>
>  void do_nios2_semihosting(CPUNios2State *env);
>
> 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 @@
>
>  #include "cpu.h"
>
> -void QEMU_NORETURN raise_exception(OpenRISCCPU *cpu, uint32_t excp);
> +G_NORETURN void raise_exception(OpenRISCCPU *cpu, uint32_t excp);
>
>  #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
>
> -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
> exception,
> -                                       uint32_t error_code);
> -void QEMU_NORETURN raise_exception_err_ra(CPUPPCState *env, uint32_t
> exception,
> -                                          uint32_t error_code, uintptr_t
> raddr);
> +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
> exception,
> +                                       uint32_t error_code, uintptr_t
> raddr);
>
>  /* 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
>
>  #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,
> bool 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);
>
>  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);
>
>  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,
> int mmu_idx,
> +                                              uintptr_t retaddr);
>  #endif
>
>
> 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
>
>  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
> dxc,
> -                                           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);
>
>  #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);
>
>  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);
>
>  #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);
>
>  #define cpu_list xtensa_cpu_list
>
> 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();
>  }
>
> -void QEMU_NORETURN cpu_loop_exit(CPUState *cpu)
> +G_NORETURN void cpu_loop_exit(CPUState *cpu)
>  {
>      g_assert_not_reached();
>  }
>
> -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)
>  }
>
>  /* 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 = thread_cpu->env_ptr;
>      CPUState *cpu = 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 = 0;
>  }
>
> -static void QEMU_NORETURN block_thread_and_exit(ITCStorageCell *c)
> +static G_NORETURN
> +void block_thread_and_exit(ITCStorageCell *c)
>  {
>      c->blocked_threads |= 1ULL << current_cpu->cpu_index;
>      current_cpu->halted = 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
> addr,
>  }
>
>  /* 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 = thread_cpu;
>      CPUArchState *env = 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;
>
> -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 a2b1d3653a1e..6077c947002d 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);
>  }
>
> -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;
>
> @@ -112,18 +113,21 @@ static void QEMU_NORETURN G_GNUC_PRINTF(1, 2)
> error_exit(const char *fmt, ...)
>      exit(EXIT_FAILURE);
>  }
>
> -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);
>  }
>
> -static void QEMU_NORETURN unrecognized_option(const char *option)
> +static G_NORETURN
> +void unrecognized_option(const char *option)
>  {
>      error_exit("unrecognized option '%s'", option);
>  }
>
>  /* 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 =
>             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
> flags)
>
>  /* 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 = env_cpu(env);
>
> @@ -524,8 +524,8 @@ void QEMU_NORETURN helper_excp(CPUAlphaState *env, int
> excp, int error)
>  }
>
>  /* 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 = env_cpu(env);
>
> @@ -539,8 +539,8 @@ void QEMU_NORETURN dynamic_excp(CPUAlphaState *env,
> uintptr_t retaddr,
>      cpu_loop_exit(cs);
>  }
>
> -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 = exc;
>      env->trap_arg1 = 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);
>  }
>
> -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,
> ARMMMUFaultInfo *fi,
>      return fsr;
>  }
>
> -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 = &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
>
>  /* 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 = 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(CPUHexagonState *env,
>      cpu_loop_exit_restore(cs, pc);
>  }
>
> -void QEMU_NORETURN HELPER(raise_exception)(CPUHexagonState *env, uint32_t
> excp)
> +G_NORETURN void HELPER(raise_exception)(CPUHexagonState *env, uint32_t
> excp)
>  {
>      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,
> disassemble_info *info)
>  }
>
>  #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 = HPPA_CPU(cs);
>      CPUHPPAState *env = &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"
>
> -void QEMU_NORETURN HELPER(excp)(CPUHPPAState *env, int excp)
> +G_NORETURN void HELPER(excp)(CPUHPPAState *env, int excp)
>  {
>      CPUState *cs = env_cpu(env);
>
> @@ -36,7 +36,7 @@ void QEMU_NORETURN HELPER(excp)(CPUHPPAState *env, int
> excp)
>      cpu_loop_exit(cs);
>  }
>
> -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
> ra)
>  {
>      CPUState *cs = env_cpu(env);
>
> 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"
>
> -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"
>
> -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);
>  }
>
> -void QEMU_NORETURN helper_raise_exception(CPUX86State *env, int
> exception_index)
> +G_NORETURN void helper_raise_exception(CPUX86State *env, int
> exception_index)
>  {
>      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 = env_cpu(env);
>
> @@ -111,31 +112,31 @@ static void QEMU_NORETURN
> raise_interrupt2(CPUX86State *env, int intno,
>
>  /* shortcuts to generate exceptions */
>
> -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);
>  }
>
> -void QEMU_NORETURN raise_exception_err(CPUX86State *env, int
> exception_index,
> -                                       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);
>  }
>
> -void QEMU_NORETURN raise_exception_err_ra(CPUX86State *env, int
> exception_index,
> -                                          int error_code, uintptr_t
> retaddr)
> +G_NORETURN void raise_exception_err_ra(CPUX86State *env, int
> exception_index,
> +                                       int error_code, uintptr_t retaddr)
>  {
>      raise_interrupt2(env, exception_index, 0, error_code, 0, retaddr);
>  }
>
> -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);
>  }
>
> -void QEMU_NORETURN raise_exception_ra(CPUX86State *env, int
> exception_index,
> -                                      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] = (uint32_t)(env->tsc_aux);
>  }
>
> -void QEMU_NORETURN helper_rdpmc(CPUX86State *env)
> +G_NORETURN void helper_rdpmc(CPUX86State *env)
>  {
>      if (((env->cr[4] & CR4_PCE_MASK) == 0 ) &&
>          ((env->hflags & HF_CPL_MASK) != 0)) {
> @@ -94,7 +94,7 @@ void QEMU_NORETURN helper_rdpmc(CPUX86State *env)
>      raise_exception_err(env, EXCP06_ILLOP, 0);
>  }
>
> -void QEMU_NORETURN do_pause(CPUX86State *env)
> +G_NORETURN void do_pause(CPUX86State *env)
>  {
>      CPUState *cs = env_cpu(env);
>
> @@ -103,7 +103,7 @@ void QEMU_NORETURN do_pause(CPUX86State *env)
>      cpu_loop_exit(cs);
>  }
>
> -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 += 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
> addr)
>      tlb_flush_page(env_cpu(env), addr);
>  }
>
> -static void QEMU_NORETURN do_hlt(CPUX86State *env)
> +static G_NORETURN
> +void do_hlt(CPUX86State *env)
>  {
>      CPUState *cs = env_cpu(env);
>
> @@ -481,7 +482,7 @@ static void QEMU_NORETURN do_hlt(CPUX86State *env)
>      cpu_loop_exit(cs);
>  }
>
> -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 += 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());
>  }
>
> -void QEMU_NORETURN helper_mwait(CPUX86State *env, int next_eip_addend)
> +G_NORETURN void helper_mwait(CPUX86State *env, int next_eip_addend)
>  {
>      CPUState *cs = env_cpu(env);
>
> 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"
>
> -void QEMU_NORETURN raise_exception(OpenRISCCPU *cpu, uint32_t excp)
> +G_NORETURN void raise_exception(OpenRISCCPU *cpu, uint32_t excp)
>  {
>      CPUState *cs = CPU(cpu);
>
> 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
> excp)
>      raise_exception(cpu, excp);
>  }
>
> -static void QEMU_NORETURN do_range(CPUOpenRISCState *env, uintptr_t pc)
> +static G_NORETURN
> +void do_range(CPUOpenRISCState *env, uintptr_t pc)
>  {
>      CPUState *cs = env_cpu(env);
>
> 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"
>
>  /* 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 = env_cpu(env);
>      cs->exception_index = 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"
>
> -static inline void QEMU_NORETURN raise_exception(CPURXState *env, int
> index,
> -                                                 uintptr_t retaddr);
> +static inline G_NORETURN
> +void raise_exception(CPURXState *env, int index,
> +                     uintptr_t retaddr);
>
>  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,
> uint32_t den)
>  }
>
>  /* exception */
> -static inline void QEMU_NORETURN raise_exception(CPURXState *env, int
> index,
> -                                                 uintptr_t retaddr)
> +static inline G_NORETURN
> +void raise_exception(CPURXState *env, int index,
> +                     uintptr_t retaddr)
>  {
>      CPUState *cs = env_cpu(env);
>
> @@ -427,22 +429,22 @@ static inline void QEMU_NORETURN
> raise_exception(CPURXState *env, int index,
>      cpu_loop_exit_restore(cs, retaddr);
>  }
>
> -void QEMU_NORETURN helper_raise_privilege_violation(CPURXState *env)
> +G_NORETURN void helper_raise_privilege_violation(CPURXState *env)
>  {
>      raise_exception(env, 20, GETPC());
>  }
>
> -void QEMU_NORETURN helper_raise_access_fault(CPURXState *env)
> +G_NORETURN void helper_raise_access_fault(CPURXState *env)
>  {
>      raise_exception(env, 21, GETPC());
>  }
>
> -void QEMU_NORETURN helper_raise_illegal_instruction(CPURXState *env)
> +G_NORETURN void helper_raise_illegal_instruction(CPURXState *env)
>  {
>      raise_exception(env, 23, GETPC());
>  }
>
> -void QEMU_NORETURN helper_wait(CPURXState *env)
> +G_NORETURN void helper_wait(CPURXState *env)
>  {
>      CPUState *cs = env_cpu(env);
>
> @@ -451,12 +453,12 @@ void QEMU_NORETURN helper_wait(CPURXState *env)
>      raise_exception(env, EXCP_HLT, 0);
>  }
>
> -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);
>  }
>
> -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
>
> -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 = env_cpu(env);
>
> @@ -46,8 +46,8 @@ void QEMU_NORETURN
> tcg_s390_program_interrupt(CPUS390XState *env,
>      cpu_loop_exit(cs);
>  }
>
> -void QEMU_NORETURN tcg_s390_data_exception(CPUS390XState *env, uint32_t
> dxc,
> -                                           uintptr_t ra)
> +G_NORETURN void tcg_s390_data_exception(CPUS390XState *env, uint32_t dxc,
> +                                        uintptr_t ra)
>  {
>      g_assert(dxc <= 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);
>  }
>
> -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 <= 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
> retaddr)
> +static G_NORETURN
> +void do_unaligned_access(CPUState *cs, uintptr_t retaddr)
>  {
>      S390CPU *cpu = S390_CPU(cs);
>      CPUS390XState *env = &cpu->env;
> @@ -620,9 +621,10 @@ void s390x_cpu_do_unaligned_access(CPUState *cs,
> vaddr addr,
>      do_unaligned_access(cs, retaddr);
>  }
>
> -static void QEMU_NORETURN monitor_event(CPUS390XState *env,
> -                                        uint64_t monitor_code,
> -                                        uint8_t monitor_class, uintptr_t
> ra)
> +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
> lowcore */
>      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
>  }
>
> -static inline void QEMU_NORETURN raise_exception(CPUSH4State *env, int
> index,
> -                                                 uintptr_t retaddr)
> +static inline G_NORETURN
> +void raise_exception(CPUSH4State *env, int index,
> +                     uintptr_t retaddr)
>  {
>      CPUState *cs = env_cpu(env);
>
> 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,
> vaddr addr)
>  }
>
>  #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 = SPARC_CPU(cs);
>      CPUSPARCState *env = &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 @@
>
>  /* Exception helpers */
>
> -static void QEMU_NORETURN
> -raise_exception_sync_internal(CPUTriCoreState *env, uint32_t class, int
> tin,
> -                              uintptr_t pc, uint32_t fcd_pc)
> +static G_NORETURN
> +void raise_exception_sync_internal(CPUTriCoreState *env, uint32_t class,
> int tin,
> +                                   uintptr_t pc, uint32_t fcd_pc)
>  {
>      CPUState *cs = 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 f8542529d030..6196c2ee4124 100644
> --- a/tcg/tcg.c
> +++ b/tcg/tcg.c
> @@ -320,7 +320,8 @@ static void set_jmp_reset_offset(TCGContext *s, int
> which)
>  }
>
>  /* 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;
>  }
>
> -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[])
>      }
>  }
>
> -static void QEMU_NORETURN run_test(void)
> +static G_NORETURN
> +void run_test(void)
>  {
>      unsigned int i;
>
> 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 = qr{
>  our $Attribute = qr{
>                         const|
>                         volatile|
> -                       QEMU_NORETURN|
> +                       G_NORETURN|
>                         G_GNUC_WARN_UNUSED_RESULT|
>                         G_GNUC_NULL_TERMINATED|
>                         QEMU_PACKED|
> --
> 2.35.1.693.g805e0a68082a
>
>

[-- Attachment #2: Type: text/html, Size: 68620 bytes --]

^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 19/41] compiler.h: replace QEMU_NORETURN with G_NORETURN
@ 2022-04-20 14:24     ` Warner Losh
  0 siblings, 0 replies; 124+ messages in thread
From: Warner Losh @ 2022-04-20 14:24 UTC (permalink / raw)
  To: Marc-André Lureau
  Cc: QEMU Developers, Richard Henderson, Paolo Bonzini, Kyle Evans,
	Philippe Mathieu-Daudé,
	Eduardo Habkost, Marcel Apfelbaum, Yanan Wang, Laurent Vivier,
	Dr. David Alan Gilbert, Kevin Wolf, Hanna Reitz, Peter Maydell,
	Taylor Simpson, Edgar E. Iglesias, Aurelien Jarno, Jiaxun Yang,
	Aleksandar Rikalo, Chris Wulff, Marek Vasut, Stafford Horne,
	Cédric Le Goater, Daniel Henrique Barboza, David Gibson,
	Greg Kurz, Palmer Dabbelt, Alistair Francis, Bin Meng,
	Yoshinori Sato, David Hildenbrand, Cornelia Huck, Thomas Huth,
	Mark Cave-Ayland, Artyom Tarasenko, Bastian Koppelmann,
	Max Filippov, Alex Bennée, open list:Block layer core,
	open list:ARM TCG CPUs, open list:PowerPC TCG CPUs,
	open list:RISC-V TCG CPUs, open list:S390 TCG CPUs

[-- Attachment #1: Type: text/plain, Size: 60352 bytes --]

On Wed, Apr 20, 2022 at 7:28 AM <marcandre.lureau@redhat.com> wrote:

> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> 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é Lureau <marcandre.lureau@redhat.com>
>

Reviewed-by: Warner Losh <imp@bsdimp.com>

Most of this looks mechanical, but I only looked closely at the bsd-user
changes.



> ---
>  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);
>
> 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,
> TranslationBlock *tb,
>   */
>  bool cpu_restore_state(CPUState *cpu, uintptr_t searched_pc, bool
> will_exit);
>
> -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);
>
>  /**
>   * 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);
>
>  /**
>   * 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);
>
>  #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
>
>  #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)
>
>  #pragma GCC diagnostic pop
>
> +#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,
> vaddr addr, vaddr len);
>   */
>  AddressSpace *cpu_get_address_space(CPUState *cpu, int asidx);
>
> -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);
>
>  /* $(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_NORETURN;
> +    G_NORETURN void (*do_unaligned_access)(CPUState *cpu, vaddr addr,
> +                                           MMUAccessType access_type,
> +                                           int mmu_idx, uintptr_t
> retaddr);
>
>      /**
>       * @adjust_watchpoint_address: hack for cpu_check_watchpoint used by
> ARM
> 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
>
> -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);
>
>  #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
>
> -#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);
>
>  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
> addr, uint64_t val,
>
>  #else
>
> -void QEMU_NORETURN helper_unaligned_ld(CPUArchState *env, target_ulong
> addr);
> -void QEMU_NORETURN helper_unaligned_st(CPUArchState *env, target_ulong
> addr);
> +G_NORETURN void helper_unaligned_ld(CPUArchState *env, target_ulong addr);
> +G_NORETURN void helper_unaligned_st(CPUArchState *env, target_ulong addr);
>
>  #endif /* CONFIG_SOFTMMU */
>  #endif /* TCG_LDST_H */
> diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h
> index 73869fd9d04f..688d1fb46077 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
>
>  /* 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 @@
>   */
>
>  /* 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))
>
> 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
>
>  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);
>
>  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
> address,
>  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,
> int 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);
>
>  /*
>   * 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_el,
>                                        uintptr_t ra);
>
> @@ -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);
>
>  /* Raise a data fault alignment exception for the specified virtual
> address */
> -void arm_cpu_do_unaligned_access(CPUState *cs, vaddr vaddr,
> -                                 MMUAccessType access_type,
> -                                 int mmu_idx, uintptr_t retaddr)
> QEMU_NORETURN;
> +G_NORETURN void arm_cpu_do_unaligned_access(CPUState *cs, vaddr vaddr,
> +                                            MMUAccessType access_type,
> +                                            int mmu_idx, uintptr_t
> retaddr);
>
>  /* 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
> ra);
>
>  #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);
>
>  /* excp_helper.c */
> -void QEMU_NORETURN raise_exception(CPUX86State *env, int exception_index);
> -void QEMU_NORETURN raise_exception_ra(CPUX86State *env, int
> exception_index,
> -                                      uintptr_t retaddr);
> -void QEMU_NORETURN raise_exception_err(CPUX86State *env, int
> exception_index,
> -                                       int error_code);
> -void QEMU_NORETURN raise_exception_err_ra(CPUX86State *env, int
> exception_index,
> -                                          int error_code, uintptr_t
> retaddr);
> -void QEMU_NORETURN raise_interrupt(CPUX86State *nenv, int intno, int
> is_int,
> -                                   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_index,
> +                                       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);
>
>  /* cc_helper.c */
>  extern const uint8_t parity_table[256];
>
>  /* 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);
>
>  /* 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
>
> 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_NORETURN;
> +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);
>
>  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,
> int mmu_idx,
> +                                             uintptr_t retaddr);
>
>  const char *mips_exception_name(int32_t exception);
>
> -void QEMU_NORETURN do_raise_exception_err(CPUMIPSState *env, uint32_t
> exception,
> -                                          int error_code, uintptr_t pc);
> +G_NORETURN void do_raise_exception_err(CPUMIPSState *env, uint32_t
> exception,
> +                                       int error_code, uintptr_t pc);
>
> -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,
> int mmu_idx,
> +                                              uintptr_t retaddr);
>
>  void do_nios2_semihosting(CPUNios2State *env);
>
> 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 @@
>
>  #include "cpu.h"
>
> -void QEMU_NORETURN raise_exception(OpenRISCCPU *cpu, uint32_t excp);
> +G_NORETURN void raise_exception(OpenRISCCPU *cpu, uint32_t excp);
>
>  #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
>
> -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
> exception,
> -                                       uint32_t error_code);
> -void QEMU_NORETURN raise_exception_err_ra(CPUPPCState *env, uint32_t
> exception,
> -                                          uint32_t error_code, uintptr_t
> raddr);
> +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
> exception,
> +                                       uint32_t error_code, uintptr_t
> raddr);
>
>  /* 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
>
>  #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,
> bool 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);
>
>  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);
>
>  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,
> int mmu_idx,
> +                                              uintptr_t retaddr);
>  #endif
>
>
> 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
>
>  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
> dxc,
> -                                           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);
>
>  #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);
>
>  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);
>
>  #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);
>
>  #define cpu_list xtensa_cpu_list
>
> 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();
>  }
>
> -void QEMU_NORETURN cpu_loop_exit(CPUState *cpu)
> +G_NORETURN void cpu_loop_exit(CPUState *cpu)
>  {
>      g_assert_not_reached();
>  }
>
> -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)
>  }
>
>  /* 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 = thread_cpu->env_ptr;
>      CPUState *cpu = 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 = 0;
>  }
>
> -static void QEMU_NORETURN block_thread_and_exit(ITCStorageCell *c)
> +static G_NORETURN
> +void block_thread_and_exit(ITCStorageCell *c)
>  {
>      c->blocked_threads |= 1ULL << current_cpu->cpu_index;
>      current_cpu->halted = 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
> addr,
>  }
>
>  /* 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 = thread_cpu;
>      CPUArchState *env = 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;
>
> -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 a2b1d3653a1e..6077c947002d 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);
>  }
>
> -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;
>
> @@ -112,18 +113,21 @@ static void QEMU_NORETURN G_GNUC_PRINTF(1, 2)
> error_exit(const char *fmt, ...)
>      exit(EXIT_FAILURE);
>  }
>
> -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);
>  }
>
> -static void QEMU_NORETURN unrecognized_option(const char *option)
> +static G_NORETURN
> +void unrecognized_option(const char *option)
>  {
>      error_exit("unrecognized option '%s'", option);
>  }
>
>  /* 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 =
>             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
> flags)
>
>  /* 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 = env_cpu(env);
>
> @@ -524,8 +524,8 @@ void QEMU_NORETURN helper_excp(CPUAlphaState *env, int
> excp, int error)
>  }
>
>  /* 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 = env_cpu(env);
>
> @@ -539,8 +539,8 @@ void QEMU_NORETURN dynamic_excp(CPUAlphaState *env,
> uintptr_t retaddr,
>      cpu_loop_exit(cs);
>  }
>
> -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 = exc;
>      env->trap_arg1 = 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);
>  }
>
> -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,
> ARMMMUFaultInfo *fi,
>      return fsr;
>  }
>
> -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 = &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
>
>  /* 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 = 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(CPUHexagonState *env,
>      cpu_loop_exit_restore(cs, pc);
>  }
>
> -void QEMU_NORETURN HELPER(raise_exception)(CPUHexagonState *env, uint32_t
> excp)
> +G_NORETURN void HELPER(raise_exception)(CPUHexagonState *env, uint32_t
> excp)
>  {
>      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,
> disassemble_info *info)
>  }
>
>  #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 = HPPA_CPU(cs);
>      CPUHPPAState *env = &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"
>
> -void QEMU_NORETURN HELPER(excp)(CPUHPPAState *env, int excp)
> +G_NORETURN void HELPER(excp)(CPUHPPAState *env, int excp)
>  {
>      CPUState *cs = env_cpu(env);
>
> @@ -36,7 +36,7 @@ void QEMU_NORETURN HELPER(excp)(CPUHPPAState *env, int
> excp)
>      cpu_loop_exit(cs);
>  }
>
> -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
> ra)
>  {
>      CPUState *cs = env_cpu(env);
>
> 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"
>
> -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"
>
> -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);
>  }
>
> -void QEMU_NORETURN helper_raise_exception(CPUX86State *env, int
> exception_index)
> +G_NORETURN void helper_raise_exception(CPUX86State *env, int
> exception_index)
>  {
>      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 = env_cpu(env);
>
> @@ -111,31 +112,31 @@ static void QEMU_NORETURN
> raise_interrupt2(CPUX86State *env, int intno,
>
>  /* shortcuts to generate exceptions */
>
> -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);
>  }
>
> -void QEMU_NORETURN raise_exception_err(CPUX86State *env, int
> exception_index,
> -                                       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);
>  }
>
> -void QEMU_NORETURN raise_exception_err_ra(CPUX86State *env, int
> exception_index,
> -                                          int error_code, uintptr_t
> retaddr)
> +G_NORETURN void raise_exception_err_ra(CPUX86State *env, int
> exception_index,
> +                                       int error_code, uintptr_t retaddr)
>  {
>      raise_interrupt2(env, exception_index, 0, error_code, 0, retaddr);
>  }
>
> -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);
>  }
>
> -void QEMU_NORETURN raise_exception_ra(CPUX86State *env, int
> exception_index,
> -                                      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] = (uint32_t)(env->tsc_aux);
>  }
>
> -void QEMU_NORETURN helper_rdpmc(CPUX86State *env)
> +G_NORETURN void helper_rdpmc(CPUX86State *env)
>  {
>      if (((env->cr[4] & CR4_PCE_MASK) == 0 ) &&
>          ((env->hflags & HF_CPL_MASK) != 0)) {
> @@ -94,7 +94,7 @@ void QEMU_NORETURN helper_rdpmc(CPUX86State *env)
>      raise_exception_err(env, EXCP06_ILLOP, 0);
>  }
>
> -void QEMU_NORETURN do_pause(CPUX86State *env)
> +G_NORETURN void do_pause(CPUX86State *env)
>  {
>      CPUState *cs = env_cpu(env);
>
> @@ -103,7 +103,7 @@ void QEMU_NORETURN do_pause(CPUX86State *env)
>      cpu_loop_exit(cs);
>  }
>
> -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 += 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
> addr)
>      tlb_flush_page(env_cpu(env), addr);
>  }
>
> -static void QEMU_NORETURN do_hlt(CPUX86State *env)
> +static G_NORETURN
> +void do_hlt(CPUX86State *env)
>  {
>      CPUState *cs = env_cpu(env);
>
> @@ -481,7 +482,7 @@ static void QEMU_NORETURN do_hlt(CPUX86State *env)
>      cpu_loop_exit(cs);
>  }
>
> -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 += 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());
>  }
>
> -void QEMU_NORETURN helper_mwait(CPUX86State *env, int next_eip_addend)
> +G_NORETURN void helper_mwait(CPUX86State *env, int next_eip_addend)
>  {
>      CPUState *cs = env_cpu(env);
>
> 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"
>
> -void QEMU_NORETURN raise_exception(OpenRISCCPU *cpu, uint32_t excp)
> +G_NORETURN void raise_exception(OpenRISCCPU *cpu, uint32_t excp)
>  {
>      CPUState *cs = CPU(cpu);
>
> 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
> excp)
>      raise_exception(cpu, excp);
>  }
>
> -static void QEMU_NORETURN do_range(CPUOpenRISCState *env, uintptr_t pc)
> +static G_NORETURN
> +void do_range(CPUOpenRISCState *env, uintptr_t pc)
>  {
>      CPUState *cs = env_cpu(env);
>
> 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"
>
>  /* 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 = env_cpu(env);
>      cs->exception_index = 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"
>
> -static inline void QEMU_NORETURN raise_exception(CPURXState *env, int
> index,
> -                                                 uintptr_t retaddr);
> +static inline G_NORETURN
> +void raise_exception(CPURXState *env, int index,
> +                     uintptr_t retaddr);
>
>  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,
> uint32_t den)
>  }
>
>  /* exception */
> -static inline void QEMU_NORETURN raise_exception(CPURXState *env, int
> index,
> -                                                 uintptr_t retaddr)
> +static inline G_NORETURN
> +void raise_exception(CPURXState *env, int index,
> +                     uintptr_t retaddr)
>  {
>      CPUState *cs = env_cpu(env);
>
> @@ -427,22 +429,22 @@ static inline void QEMU_NORETURN
> raise_exception(CPURXState *env, int index,
>      cpu_loop_exit_restore(cs, retaddr);
>  }
>
> -void QEMU_NORETURN helper_raise_privilege_violation(CPURXState *env)
> +G_NORETURN void helper_raise_privilege_violation(CPURXState *env)
>  {
>      raise_exception(env, 20, GETPC());
>  }
>
> -void QEMU_NORETURN helper_raise_access_fault(CPURXState *env)
> +G_NORETURN void helper_raise_access_fault(CPURXState *env)
>  {
>      raise_exception(env, 21, GETPC());
>  }
>
> -void QEMU_NORETURN helper_raise_illegal_instruction(CPURXState *env)
> +G_NORETURN void helper_raise_illegal_instruction(CPURXState *env)
>  {
>      raise_exception(env, 23, GETPC());
>  }
>
> -void QEMU_NORETURN helper_wait(CPURXState *env)
> +G_NORETURN void helper_wait(CPURXState *env)
>  {
>      CPUState *cs = env_cpu(env);
>
> @@ -451,12 +453,12 @@ void QEMU_NORETURN helper_wait(CPURXState *env)
>      raise_exception(env, EXCP_HLT, 0);
>  }
>
> -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);
>  }
>
> -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
>
> -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 = env_cpu(env);
>
> @@ -46,8 +46,8 @@ void QEMU_NORETURN
> tcg_s390_program_interrupt(CPUS390XState *env,
>      cpu_loop_exit(cs);
>  }
>
> -void QEMU_NORETURN tcg_s390_data_exception(CPUS390XState *env, uint32_t
> dxc,
> -                                           uintptr_t ra)
> +G_NORETURN void tcg_s390_data_exception(CPUS390XState *env, uint32_t dxc,
> +                                        uintptr_t ra)
>  {
>      g_assert(dxc <= 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);
>  }
>
> -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 <= 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
> retaddr)
> +static G_NORETURN
> +void do_unaligned_access(CPUState *cs, uintptr_t retaddr)
>  {
>      S390CPU *cpu = S390_CPU(cs);
>      CPUS390XState *env = &cpu->env;
> @@ -620,9 +621,10 @@ void s390x_cpu_do_unaligned_access(CPUState *cs,
> vaddr addr,
>      do_unaligned_access(cs, retaddr);
>  }
>
> -static void QEMU_NORETURN monitor_event(CPUS390XState *env,
> -                                        uint64_t monitor_code,
> -                                        uint8_t monitor_class, uintptr_t
> ra)
> +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
> lowcore */
>      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
>  }
>
> -static inline void QEMU_NORETURN raise_exception(CPUSH4State *env, int
> index,
> -                                                 uintptr_t retaddr)
> +static inline G_NORETURN
> +void raise_exception(CPUSH4State *env, int index,
> +                     uintptr_t retaddr)
>  {
>      CPUState *cs = env_cpu(env);
>
> 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,
> vaddr addr)
>  }
>
>  #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 = SPARC_CPU(cs);
>      CPUSPARCState *env = &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 @@
>
>  /* Exception helpers */
>
> -static void QEMU_NORETURN
> -raise_exception_sync_internal(CPUTriCoreState *env, uint32_t class, int
> tin,
> -                              uintptr_t pc, uint32_t fcd_pc)
> +static G_NORETURN
> +void raise_exception_sync_internal(CPUTriCoreState *env, uint32_t class,
> int tin,
> +                                   uintptr_t pc, uint32_t fcd_pc)
>  {
>      CPUState *cs = 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 f8542529d030..6196c2ee4124 100644
> --- a/tcg/tcg.c
> +++ b/tcg/tcg.c
> @@ -320,7 +320,8 @@ static void set_jmp_reset_offset(TCGContext *s, int
> which)
>  }
>
>  /* 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;
>  }
>
> -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[])
>      }
>  }
>
> -static void QEMU_NORETURN run_test(void)
> +static G_NORETURN
> +void run_test(void)
>  {
>      unsigned int i;
>
> 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 = qr{
>  our $Attribute = qr{
>                         const|
>                         volatile|
> -                       QEMU_NORETURN|
> +                       G_NORETURN|
>                         G_GNUC_WARN_UNUSED_RESULT|
>                         G_GNUC_NULL_TERMINATED|
>                         QEMU_PACKED|
> --
> 2.35.1.693.g805e0a68082a
>
>

[-- Attachment #2: Type: text/html, Size: 68620 bytes --]

^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 01/41] qga: use fixed-length for usecs formatting
  2022-04-20 13:25 ` [PATCH 01/41] qga: use fixed-length for usecs formatting marcandre.lureau
@ 2022-04-20 14:26   ` Daniel P. Berrangé
  0 siblings, 0 replies; 124+ messages in thread
From: Daniel P. Berrangé @ 2022-04-20 14:26 UTC (permalink / raw)
  To: marcandre.lureau; +Cc: Michael Roth, qemu-devel

On Wed, Apr 20, 2022 at 05:25:44PM +0400, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> 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 int64_t/PRId64 instead of old GLib-style.
> 
> Suggested-by: Markus Armbruster <armbru@redhat.com>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  qga/main.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/qga/main.c b/qga/main.c
> index 1deb0ee2fbfe..ac63d8e47802 100644
> --- a/qga/main.c
> +++ b/qga/main.c
> @@ -328,11 +328,10 @@ static void ga_log(const gchar *domain, GLogLevelFlags level,
>  #else
>      if (level & s->log_level) {
>  #endif
> -        gint64 t = g_get_real_time();
> +        int64_t t = 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);
> +                "%" PRId64 ".%06" PRId64 ": %s: %s\n",
> +                t / G_USEC_PER_SEC, t % G_USEC_PER_SEC, level_str, msg);
>          fflush(s->log_file);

IMHO better to get rid of the manual date formatting entirely and
use GDateTime :

  g_autoptr(GDateTime) now = g_date_time_now_utc();
  g_autofree char *nowstr = g_date_time_format("%s.%f", now)
  fprintf(s->log_file, "%s: %s: %s\n", nowstr, level_str, msg);
  fflush(s->log_file);


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 34/41] libqtest: split QMP part in libqmp
  2022-04-20 13:26 ` [PATCH 34/41] libqtest: split QMP part in libqmp marcandre.lureau
@ 2022-04-20 14:29   ` Thomas Huth
  0 siblings, 0 replies; 124+ messages in thread
From: Thomas Huth @ 2022-04-20 14:29 UTC (permalink / raw)
  To: marcandre.lureau, qemu-devel; +Cc: Laurent Vivier, Paolo Bonzini

On 20/04/2022 15.26, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> This will help moving QAPI/QMP in a common subproject.
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>   tests/qtest/libqos/libqmp.h    |  50 +++++++
>   tests/qtest/libqos/libqtest.h  |  29 +----
>   tests/qtest/libqos/libqmp.c    | 230 +++++++++++++++++++++++++++++++++

Same problem as with libqtest: This should not reside in libqos, please put 
it one level higher instead.

  Thomas




^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 41/41] tests/fuzz: fix warning
  2022-04-20 13:26 ` [PATCH 41/41] tests/fuzz: fix warning marcandre.lureau
@ 2022-04-20 14:30   ` Thomas Huth
  0 siblings, 0 replies; 124+ messages in thread
From: Thomas Huth @ 2022-04-20 14:30 UTC (permalink / raw)
  To: marcandre.lureau, qemu-devel
  Cc: Laurent Vivier, Darren Kenny, Qiuhao Li, Alexander Bulekov,
	Bandan Das, Stefan Hajnoczi, Paolo Bonzini

On 20/04/2022 15.26, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> ../tests/qtest/fuzz/generic_fuzz.c:746:17: warning: variable 'name' set but not used [-Wunused-but-set-variable]
> 
> Signed-off-by: Marc-André Lureau <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_fuzz.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)
>   
>   static int locate_fuzz_memory_regions(Object *child, void *opaque)
>   {
> -    const char *name;
>       MemoryRegion *mr;
>       if (object_dynamic_cast(child, TYPE_MEMORY_REGION)) {
>           mr = MEMORY_REGION(child);
>           if ((memory_region_is_ram(mr) ||
>               memory_region_is_ram_device(mr) ||
>               memory_region_is_rom(mr)) == false) {
> -            name = 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.

Reviewed-by: Thomas Huth <thuth@redhat.com>



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 02/41] glib-compat: isolate g_date_time_format_iso8601 version-bypass
  2022-04-20 13:25 ` [PATCH 02/41] glib-compat: isolate g_date_time_format_iso8601 version-bypass marcandre.lureau
@ 2022-04-20 14:32   ` Daniel P. Berrangé
  0 siblings, 0 replies; 124+ messages in thread
From: Daniel P. Berrangé @ 2022-04-20 14:32 UTC (permalink / raw)
  To: marcandre.lureau; +Cc: qemu-devel

On Wed, Apr 20, 2022 at 05:25:45PM +0400, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> The solution was discussed with Markus Armbruster during the review:
> https://patchew.org/QEMU/20220323155743.1585078-1-marcandre.lureau@redhat.com/20220323155743.1585078-14-marcandre.lureau@redhat.com/
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  include/glib-compat.h | 10 ----------
>  util/error-report.c   |  6 +++++-
>  2 files changed, 5 insertions(+), 11 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 17/41] doc/build-platforms: document supported compilers
  2022-04-20 14:10   ` Daniel P. Berrangé
@ 2022-04-20 14:32     ` Marc-André Lureau
  2022-04-20 14:36     ` Thomas Huth
  1 sibling, 0 replies; 124+ messages in thread
From: Marc-André Lureau @ 2022-04-20 14:32 UTC (permalink / raw)
  To: Daniel P. Berrangé; +Cc: qemu-devel

Hi

On Wed, Apr 20, 2022 at 6:10 PM Daniel P. Berrangé <berrange@redhat.com> wrote:
>
> On Wed, Apr 20, 2022 at 05:26:00PM +0400, marcandre.lureau@redhat.com wrote:
> > From: Marc-André Lureau <marcandre.lureau@redhat.com>
> >
> > According to our configure checks, this is the list of supported
> > compilers.
> >
> > Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> > Reviewed-by: Damien Hedde <damien.hedde@greensocs.com>
> > ---
> >  docs/about/build-platforms.rst | 10 ++++++++++
> >  1 file changed, 10 insertions(+)
> >
> > diff --git a/docs/about/build-platforms.rst b/docs/about/build-platforms.rst
> > index c29a4b8fe649..1980c5d2476f 100644
> > --- a/docs/about/build-platforms.rst
> > +++ b/docs/about/build-platforms.rst
> > @@ -92,6 +92,16 @@ hosted on Linux (Debian/Fedora).
> >  The version of the Windows API that's currently targeted is Vista / Server
> >  2008.
> >
> > +Supported compilers
> > +-------------------
> > +
> > +To compile, QEMU requires either:
> > +
> > +- GCC >= 7.4.0
> > +- Clang >= 6.0
> > +- XCode Clang >= 10.0
>
> Do we need to spell out the versions explicitly ? These versions are
> all derived from what's available in the repos of the supported build
> platforms, similar to any other build deps we have. I don't think we
> want to start a precedent of duplicating versions in this doc for
> build deps we have, and there's nothing particularly special about
> compilers in this respect.

We have checks in configure for those, I wanted a more human-readable
and readily available version.

The set of supported platforms is not rigid, so imho it helps to
document the basic build requirements.

If/when we introduce Rust and/or C++ etc, I would also expect an
explicit doc section about it.

> With regards,
> Daniel
> --
> |: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
> |: https://libvirt.org         -o-            https://fstop138.berrange.com :|
> |: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
>



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 03/41] scripts/analyze-inclusions: drop qemu-common.h from analysis
  2022-04-20 13:25 ` [PATCH 03/41] scripts/analyze-inclusions: drop qemu-common.h from analysis marcandre.lureau
@ 2022-04-20 14:32   ` Daniel P. Berrangé
  0 siblings, 0 replies; 124+ messages in thread
From: Daniel P. Berrangé @ 2022-04-20 14:32 UTC (permalink / raw)
  To: marcandre.lureau; +Cc: qemu-devel

On Wed, Apr 20, 2022 at 05:25:46PM +0400, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> The header is no longer commonly included.
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  scripts/analyze-inclusions | 4 ----
>  1 file changed, 4 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 28/41] Use QEMU_SANITIZE_ADDRESS
  2022-04-20 14:20   ` Thomas Huth
@ 2022-04-20 14:35     ` Marc-André Lureau
  0 siblings, 0 replies; 124+ messages in thread
From: Marc-André Lureau @ 2022-04-20 14:35 UTC (permalink / raw)
  To: Thomas Huth
  Cc: Laurent Vivier, Kevin Wolf, open list:Floppy, qemu-devel,
	Stefan Hajnoczi, Paolo Bonzini, John Snow

On Wed, Apr 20, 2022 at 6:20 PM Thomas Huth <thuth@redhat.com> wrote:
>
> On 20/04/2022 15.26, marcandre.lureau@redhat.com wrote:
> > From: Marc-André Lureau <marcandre.lureau@redhat.com>
> >
> > Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> > ---
> >   tests/qtest/fdc-test.c    | 2 +-
> >   util/coroutine-ucontext.c | 2 +-
> >   2 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/tests/qtest/fdc-test.c b/tests/qtest/fdc-test.c
> > index 4aa72f36431f..0b3c2c0d523f 100644
> > --- a/tests/qtest/fdc-test.c
> > +++ b/tests/qtest/fdc-test.c
> > @@ -550,7 +550,7 @@ static void fuzz_registers(void)
> >
> >   static bool qtest_check_clang_sanitizer(void)
> >   {
> > -#if defined(__SANITIZE_ADDRESS__) || __has_feature(address_sanitizer)
> > +#ifdef QEMU_SANITIZE_ADDRESS
> >       return true;
> >   #else
> >       g_test_skip("QEMU not configured using --enable-sanitizers");
> > diff --git a/util/coroutine-ucontext.c b/util/coroutine-ucontext.c
> > index 904b375192ca..52725f5344fb 100644
> > --- a/util/coroutine-ucontext.c
> > +++ b/util/coroutine-ucontext.c
> > @@ -30,7 +30,7 @@
> >   #include <valgrind/valgrind.h>
> >   #endif
> >
> > -#if defined(__SANITIZE_ADDRESS__) || __has_feature(address_sanitizer)
> > +#ifdef QEMU_SANITIZE_THREAD
>
> Shouldn't that be QEMU_SANITIZE_ADDRESS instead?
>

oops, thanks



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 17/41] doc/build-platforms: document supported compilers
  2022-04-20 14:10   ` Daniel P. Berrangé
  2022-04-20 14:32     ` Marc-André Lureau
@ 2022-04-20 14:36     ` Thomas Huth
  2022-04-20 14:46       ` Marc-André Lureau
  1 sibling, 1 reply; 124+ messages in thread
From: Thomas Huth @ 2022-04-20 14:36 UTC (permalink / raw)
  To: Daniel P. Berrangé, marcandre.lureau; +Cc: qemu-devel

On 20/04/2022 16.10, Daniel P. Berrangé wrote:
> On Wed, Apr 20, 2022 at 05:26:00PM +0400, marcandre.lureau@redhat.com wrote:
>> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>>
>> According to our configure checks, this is the list of supported
>> compilers.
>>
>> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
>> Reviewed-by: Damien Hedde <damien.hedde@greensocs.com>
>> ---
>>   docs/about/build-platforms.rst | 10 ++++++++++
>>   1 file changed, 10 insertions(+)
>>
>> diff --git a/docs/about/build-platforms.rst b/docs/about/build-platforms.rst
>> index c29a4b8fe649..1980c5d2476f 100644
>> --- a/docs/about/build-platforms.rst
>> +++ b/docs/about/build-platforms.rst
>> @@ -92,6 +92,16 @@ hosted on Linux (Debian/Fedora).
>>   The version of the Windows API that's currently targeted is Vista / Server
>>   2008.
>>   
>> +Supported compilers
>> +-------------------
>> +
>> +To compile, QEMU requires either:
>> +
>> +- GCC >= 7.4.0
>> +- Clang >= 6.0
>> +- XCode Clang >= 10.0
> 
> Do we need to spell out the versions explicitly ? These versions are
> all derived from what's available in the repos of the supported build
> platforms, similar to any other build deps we have. I don't think we
> want to start a precedent of duplicating versions in this doc for
> build deps we have, and there's nothing particularly special about
> compilers in this respect.

I agree with Daniel - when I saw this patch, the first thought that I had 
was: "This will be getting out of sync quickly" ...
so I'd also recommend to rather not add this here.

  Thomas



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 00/41] Misc cleanups
  2022-04-20 13:25 [PATCH 00/41] Misc cleanups marcandre.lureau
                   ` (40 preceding siblings ...)
  2022-04-20 13:26 ` [PATCH 41/41] tests/fuzz: fix warning marcandre.lureau
@ 2022-04-20 14:40 ` Thomas Huth
  41 siblings, 0 replies; 124+ messages in thread
From: Thomas Huth @ 2022-04-20 14:40 UTC (permalink / raw)
  To: marcandre.lureau, qemu-devel

On 20/04/2022 15.25, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> Hi,
> 
> Another batch of cleanup patches, mostly while working on moving the common code
> in some future subprojects. (a few patches have been posted and reviewed
> earlier)
> 
> Marc-André Lureau (41):
>    qga: use fixed-length for usecs formatting
>    glib-compat: isolate g_date_time_format_iso8601 version-bypass
>    scripts/analyze-inclusions: drop qemu-common.h from analysis
>    Simplify softmmu/main.c
>    hw/hyperv: remove needless qemu-common.h include
>    include: rename qemu-common.h qemu/copyright.h
>    build-sys: remove MSI's QEMU_GA_MSI_MINGW_DLL_PATH
>    build-sys: simplify MSI's QEMU_GA_MANUFACTURER
>    build-sys: simplify MSI's QEMU_GA_VERSION
>    build-sys: drop MSI's QEMU_GA_DISTRO
>    qga: replace usleep() with g_usleep()
>    docs: trace-events-all is installed without renaming
>    arm/digic: replace snprintf() with g_strdup_printf()
>    arm/allwinner-a10: replace snprintf() with g_strdup_printf()
>    intc/exynos4210_gic: replace snprintf() with g_strdup_printf()
>    doc/style: CLang -> Clang
>    doc/build-platforms: document supported compilers
>    osdep.h: move qemu_build_not_reached()
>    compiler.h: replace QEMU_NORETURN with G_NORETURN
>    include: move qemu_msync() to osdep
>    include: move qemu_fdatasync() to osdep
>    include: move qemu_*_exec_dir() to cutils
>    include: add qemu/keyval.h
>    include: move qdict_{crumple,flatten} declarations
>    tests: remove block/qdict checks from check-qobject.c
>    compiler.h: add QEMU_SANITIZE_{ADDRESS,THREAD}
>    Use QEMU_SANITIZE_THREAD
>    Use QEMU_SANITIZE_ADDRESS
>    tests: run-time skip test-qga if TSAN is enabled
>    Move error_printf_unless_qmp() with monitor unit
>    qga: move qga_get_host_name()
>    qtest: simplify socket_send()
>    tests: move libqtest.c under libqos/
>    libqtest: split QMP part in libqmp
>    util: simplify write in signal handler
>    util: use qemu_write_full() in qemu_write_pidfile()
>    util: use qemu_create() in qemu_write_pidfile()
>    util: replace qemu_get_local_state_pathname()
>    qga: remove need for QEMU atomic.h
>    migration/ram: fix clang warning
>    tests/fuzz: fix warning
> 
>   docs/about/build-platforms.rst               |  10 +
>   docs/devel/qtest.rst                         |   4 +-
>   docs/devel/style.rst                         |   2 +-
>   docs/devel/tracing.rst                       |   2 +-
>   configure                                    |  16 --
>   accel/tcg/internal.h                         |   3 +-
>   include/block/qdict.h                        |   3 +
>   include/exec/exec-all.h                      |  20 +-
>   include/exec/helper-head.h                   |   2 +-
>   include/glib-compat.h                        |  12 +-
>   include/hw/core/cpu.h                        |   2 +-
>   include/hw/core/tcg-cpu-ops.h                |   6 +-
>   include/hw/hw.h                              |   2 +-
>   include/monitor/monitor.h                    |   3 +
>   include/qapi/qmp/qdict.h                     |   3 -
>   include/qemu-main.h                          |  10 +
>   include/qemu/atomic.h                        |   8 +-
>   include/qemu/compiler.h                      |  26 +--
>   include/{qemu-common.h => qemu/copyright.h}  |   5 -
>   include/qemu/cutils.h                        |   9 +-
>   include/qemu/error-report.h                  |   2 -
>   include/qemu/keyval.h                        |  14 ++
>   include/qemu/option.h                        |   6 -
>   include/qemu/osdep.h                         |  51 ++--
>   include/qemu/thread.h                        |   2 +-
>   include/tcg/tcg-ldst.h                       |   4 +-
>   include/tcg/tcg.h                            |   2 +-
>   linux-user/user-internals.h                  |   2 +-
>   qga/commands-common.h                        |  11 +
>   scripts/cocci-macro-file.h                   |   2 +-
>   subprojects/libvhost-user/include/compiler.h |   1 +
>   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 +-
>   tests/qtest/libqos/libqmp.h                  |  50 ++++
>   tests/qtest/libqos/libqtest.h                |  29 +--
>   accel/stubs/tcg-stub.c                       |   4 +-
>   bsd-user/main.c                              |   2 +-
>   bsd-user/signal.c                            |   3 +-
>   hw/arm/allwinner-a10.c                       |   4 +-
>   hw/arm/digic.c                               |   5 +-
>   hw/hyperv/syndbg.c                           |   1 -
>   hw/intc/exynos4210_gic.c                     |   9 +-
>   hw/misc/mips_itu.c                           |   3 +-
>   linux-user/main.c                            |   2 +-
>   linux-user/signal.c                          |   3 +-
>   migration/ram.c                              |   2 +-
>   monitor/hmp.c                                |   4 +-
>   monitor/monitor.c                            |  10 +
>   qapi/qobject-input-visitor.c                 |   2 +-
>   qemu-img.c                                   |  14 +-
>   qemu-io.c                                    |   3 +-
>   qemu-nbd.c                                   |   2 +-
>   qga/commands-posix.c                         |  35 +++
>   qga/commands-win32.c                         |  13 ++
>   qga/commands.c                               |  14 +-
>   qga/main.c                                   |  19 +-
>   qom/object_interfaces.c                      |   1 +
>   scsi/qemu-pr-helper.c                        |   8 +-
>   softmmu/main.c                               |  25 +-
>   softmmu/vl.c                                 |   4 +-
>   storage-daemon/qemu-storage-daemon.c         |   3 +-
>   stubs/error-printf.c                         |   1 +
>   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 +-
>   tests/qtest/fdc-test.c                       |   2 +-
>   tests/qtest/fuzz/fuzz.c                      |   1 +
>   tests/qtest/fuzz/generic_fuzz.c              |   2 -
>   tests/qtest/libqos/libqmp.c                  | 230 +++++++++++++++++++
>   tests/qtest/{ => libqos}/libqtest.c          | 222 +-----------------
>   tests/unit/check-qobject.c                   |   7 -
>   tests/unit/check-qom-proplist.c              |   1 +
>   tests/unit/test-forward-visitor.c            |   2 +-
>   tests/unit/test-keyval.c                     |   2 +-
>   tests/unit/test-qga.c                        |   7 +
>   tools/virtiofsd/fuse_virtio.c                |   4 +-
>   tools/virtiofsd/passthrough_ll.c             |   2 +-
>   ui/vnc.c                                     |   1 +
>   util/compatfd.c                              |  18 +-
>   util/coroutine-ucontext.c                    |   2 +-
>   util/cutils.c                                | 163 ++++++++-----
>   util/error-report.c                          |  17 +-
>   util/keyval.c                                |   2 +-
>   util/osdep.c                                 |  16 ++
>   util/oslib-posix.c                           | 146 ++----------
>   util/oslib-win32.c                           |  64 +-----
>   qga/installer/qemu-ga.wxs                    |  24 +-
>   qga/meson.build                              |   5 +-
>   scripts/analyze-inclusions                   |   4 -
>   scripts/checkpatch.pl                        |   2 +-
>   tests/qtest/libqos/meson.build               |   5 +-
>   tests/unit/meson.build                       |   4 +-
>   ui/cocoa.m                                   |   3 +-

This series has become really too big, touching too many different topics 
... please split it by sub-topics and/or maintenance areas.

  Thomas



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 17/41] doc/build-platforms: document supported compilers
  2022-04-20 14:36     ` Thomas Huth
@ 2022-04-20 14:46       ` Marc-André Lureau
  2022-04-20 14:50         ` Marc-André Lureau
  2022-04-20 14:53         ` Thomas Huth
  0 siblings, 2 replies; 124+ messages in thread
From: Marc-André Lureau @ 2022-04-20 14:46 UTC (permalink / raw)
  To: Thomas Huth; +Cc: Daniel P. Berrangé, qemu-devel

Hi

On Wed, Apr 20, 2022 at 6:37 PM Thomas Huth <thuth@redhat.com> wrote:
>
> On 20/04/2022 16.10, Daniel P. Berrangé wrote:
> > On Wed, Apr 20, 2022 at 05:26:00PM +0400, marcandre.lureau@redhat.com wrote:
> >> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> >>
> >> According to our configure checks, this is the list of supported
> >> compilers.
> >>
> >> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> >> Reviewed-by: Damien Hedde <damien.hedde@greensocs.com>
> >> ---
> >>   docs/about/build-platforms.rst | 10 ++++++++++
> >>   1 file changed, 10 insertions(+)
> >>
> >> diff --git a/docs/about/build-platforms.rst b/docs/about/build-platforms.rst
> >> index c29a4b8fe649..1980c5d2476f 100644
> >> --- a/docs/about/build-platforms.rst
> >> +++ b/docs/about/build-platforms.rst
> >> @@ -92,6 +92,16 @@ hosted on Linux (Debian/Fedora).
> >>   The version of the Windows API that's currently targeted is Vista / Server
> >>   2008.
> >>
> >> +Supported compilers
> >> +-------------------
> >> +
> >> +To compile, QEMU requires either:
> >> +
> >> +- GCC >= 7.4.0
> >> +- Clang >= 6.0
> >> +- XCode Clang >= 10.0
> >
> > Do we need to spell out the versions explicitly ? These versions are
> > all derived from what's available in the repos of the supported build
> > platforms, similar to any other build deps we have. I don't think we
> > want to start a precedent of duplicating versions in this doc for
> > build deps we have, and there's nothing particularly special about
> > compilers in this respect.
>
> I agree with Daniel - when I saw this patch, the first thought that I had
> was: "This will be getting out of sync quickly" ...

I don't have the impression we bump our compiler requirement regularly
or lightly.

> so I'd also recommend to rather not add this here.

Outdated documentation is still better than no documentation. YMMV.



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 17/41] doc/build-platforms: document supported compilers
  2022-04-20 14:46       ` Marc-André Lureau
@ 2022-04-20 14:50         ` Marc-André Lureau
  2022-04-20 15:24           ` Daniel P. Berrangé
  2022-04-20 14:53         ` Thomas Huth
  1 sibling, 1 reply; 124+ messages in thread
From: Marc-André Lureau @ 2022-04-20 14:50 UTC (permalink / raw)
  To: Thomas Huth; +Cc: Daniel P. Berrangé, qemu-devel

Hi

On Wed, Apr 20, 2022 at 6:46 PM Marc-André Lureau
<marcandre.lureau@redhat.com> wrote:
>
> Hi
>
> On Wed, Apr 20, 2022 at 6:37 PM Thomas Huth <thuth@redhat.com> wrote:
> >
> > On 20/04/2022 16.10, Daniel P. Berrangé wrote:
> > > On Wed, Apr 20, 2022 at 05:26:00PM +0400, marcandre.lureau@redhat.com wrote:
> > >> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> > >>
> > >> According to our configure checks, this is the list of supported
> > >> compilers.
> > >>
> > >> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> > >> Reviewed-by: Damien Hedde <damien.hedde@greensocs.com>
> > >> ---
> > >>   docs/about/build-platforms.rst | 10 ++++++++++
> > >>   1 file changed, 10 insertions(+)
> > >>
> > >> diff --git a/docs/about/build-platforms.rst b/docs/about/build-platforms.rst
> > >> index c29a4b8fe649..1980c5d2476f 100644
> > >> --- a/docs/about/build-platforms.rst
> > >> +++ b/docs/about/build-platforms.rst
> > >> @@ -92,6 +92,16 @@ hosted on Linux (Debian/Fedora).
> > >>   The version of the Windows API that's currently targeted is Vista / Server
> > >>   2008.
> > >>
> > >> +Supported compilers
> > >> +-------------------
> > >> +
> > >> +To compile, QEMU requires either:
> > >> +
> > >> +- GCC >= 7.4.0
> > >> +- Clang >= 6.0
> > >> +- XCode Clang >= 10.0
> > >
> > > Do we need to spell out the versions explicitly ? These versions are
> > > all derived from what's available in the repos of the supported build
> > > platforms, similar to any other build deps we have. I don't think we
> > > want to start a precedent of duplicating versions in this doc for
> > > build deps we have, and there's nothing particularly special about
> > > compilers in this respect.
> >
> > I agree with Daniel - when I saw this patch, the first thought that I had
> > was: "This will be getting out of sync quickly" ...
>
> I don't have the impression we bump our compiler requirement regularly
> or lightly.
>
> > so I'd also recommend to rather not add this here.
>
> Outdated documentation is still better than no documentation. YMMV.

Another question that is difficult to answer without being familiar
with QEMU details is whether it can compile with MSVC. This
documentation would, since it is explicit about the requirement.

It is not excluded that subprojects can compile with MSVC in a near
future for example.



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 17/41] doc/build-platforms: document supported compilers
  2022-04-20 14:46       ` Marc-André Lureau
  2022-04-20 14:50         ` Marc-André Lureau
@ 2022-04-20 14:53         ` Thomas Huth
  2022-04-20 14:57           ` Marc-André Lureau
  1 sibling, 1 reply; 124+ messages in thread
From: Thomas Huth @ 2022-04-20 14:53 UTC (permalink / raw)
  To: Marc-André Lureau; +Cc: Daniel P. Berrangé, qemu-devel

On 20/04/2022 16.46, Marc-André Lureau wrote:
> Hi
> 
> On Wed, Apr 20, 2022 at 6:37 PM Thomas Huth <thuth@redhat.com> wrote:
>>
>> On 20/04/2022 16.10, Daniel P. Berrangé wrote:
>>> On Wed, Apr 20, 2022 at 05:26:00PM +0400, marcandre.lureau@redhat.com wrote:
>>>> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>>>>
>>>> According to our configure checks, this is the list of supported
>>>> compilers.
>>>>
>>>> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
>>>> Reviewed-by: Damien Hedde <damien.hedde@greensocs.com>
>>>> ---
>>>>    docs/about/build-platforms.rst | 10 ++++++++++
>>>>    1 file changed, 10 insertions(+)
>>>>
>>>> diff --git a/docs/about/build-platforms.rst b/docs/about/build-platforms.rst
>>>> index c29a4b8fe649..1980c5d2476f 100644
>>>> --- a/docs/about/build-platforms.rst
>>>> +++ b/docs/about/build-platforms.rst
>>>> @@ -92,6 +92,16 @@ hosted on Linux (Debian/Fedora).
>>>>    The version of the Windows API that's currently targeted is Vista / Server
>>>>    2008.
>>>>
>>>> +Supported compilers
>>>> +-------------------
>>>> +
>>>> +To compile, QEMU requires either:
>>>> +
>>>> +- GCC >= 7.4.0
>>>> +- Clang >= 6.0
>>>> +- XCode Clang >= 10.0
>>>
>>> Do we need to spell out the versions explicitly ? These versions are
>>> all derived from what's available in the repos of the supported build
>>> platforms, similar to any other build deps we have. I don't think we
>>> want to start a precedent of duplicating versions in this doc for
>>> build deps we have, and there's nothing particularly special about
>>> compilers in this respect.
>>
>> I agree with Daniel - when I saw this patch, the first thought that I had
>> was: "This will be getting out of sync quickly" ...
> 
> I don't have the impression we bump our compiler requirement regularly
> or lightly.

"quickly" in the sense of that it will be out of sync once somebody bumps 
the version check in the "configure" script - since I doubt that it will be 
remembered to update this document here as well.

>> so I'd also recommend to rather not add this here.
> 
> Outdated documentation is still better than no documentation. YMMV.

Well, no. In this case, it might rather create wrong expectations for the 
users if they read that their compiler is still supported, but the configure 
script refuses it.

Anyway, if you feel like we need more information for the users about 
supported systems and compiler versions, feel free to update this page here 
instead, it has also fallen behind already quite a bit:

  https://wiki.qemu.org/Supported_Build_Platforms

  Thomas



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 04/41] Simplify softmmu/main.c
  2022-04-20 13:25 ` [PATCH 04/41] Simplify softmmu/main.c marcandre.lureau
@ 2022-04-20 14:55   ` Daniel P. Berrangé
  0 siblings, 0 replies; 124+ messages in thread
From: Daniel P. Berrangé @ 2022-04-20 14:55 UTC (permalink / raw)
  To: marcandre.lureau
  Cc: Peter Maydell, qemu-devel, Philippe Mathieu-Daudé,
	Gerd Hoffmann, Akihiko Odaki, Paolo Bonzini

On Wed, Apr 20, 2022 at 05:25:47PM +0400, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> Move qemu_main() declaration to a new header.
> 
> Simplify main.c since both cocoa & sdl cannot be enabled together.
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> Reviewed-by: Akihiko Odaki <akihiko.odaki@gmail.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

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 17/41] doc/build-platforms: document supported compilers
  2022-04-20 14:53         ` Thomas Huth
@ 2022-04-20 14:57           ` Marc-André Lureau
  0 siblings, 0 replies; 124+ messages in thread
From: Marc-André Lureau @ 2022-04-20 14:57 UTC (permalink / raw)
  To: Thomas Huth; +Cc: Daniel P. Berrangé, qemu-devel

Hi

On Wed, Apr 20, 2022 at 6:53 PM Thomas Huth <thuth@redhat.com> wrote:
>
> On 20/04/2022 16.46, Marc-André Lureau wrote:
> > Hi
> >
> > On Wed, Apr 20, 2022 at 6:37 PM Thomas Huth <thuth@redhat.com> wrote:
> >>
> >> On 20/04/2022 16.10, Daniel P. Berrangé wrote:
> >>> On Wed, Apr 20, 2022 at 05:26:00PM +0400, marcandre.lureau@redhat.com wrote:
> >>>> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> >>>>
> >>>> According to our configure checks, this is the list of supported
> >>>> compilers.
> >>>>
> >>>> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> >>>> Reviewed-by: Damien Hedde <damien.hedde@greensocs.com>
> >>>> ---
> >>>>    docs/about/build-platforms.rst | 10 ++++++++++
> >>>>    1 file changed, 10 insertions(+)
> >>>>
> >>>> diff --git a/docs/about/build-platforms.rst b/docs/about/build-platforms.rst
> >>>> index c29a4b8fe649..1980c5d2476f 100644
> >>>> --- a/docs/about/build-platforms.rst
> >>>> +++ b/docs/about/build-platforms.rst
> >>>> @@ -92,6 +92,16 @@ hosted on Linux (Debian/Fedora).
> >>>>    The version of the Windows API that's currently targeted is Vista / Server
> >>>>    2008.
> >>>>
> >>>> +Supported compilers
> >>>> +-------------------
> >>>> +
> >>>> +To compile, QEMU requires either:
> >>>> +
> >>>> +- GCC >= 7.4.0
> >>>> +- Clang >= 6.0
> >>>> +- XCode Clang >= 10.0
> >>>
> >>> Do we need to spell out the versions explicitly ? These versions are
> >>> all derived from what's available in the repos of the supported build
> >>> platforms, similar to any other build deps we have. I don't think we
> >>> want to start a precedent of duplicating versions in this doc for
> >>> build deps we have, and there's nothing particularly special about
> >>> compilers in this respect.
> >>
> >> I agree with Daniel - when I saw this patch, the first thought that I had
> >> was: "This will be getting out of sync quickly" ...
> >
> > I don't have the impression we bump our compiler requirement regularly
> > or lightly.
>
> "quickly" in the sense of that it will be out of sync once somebody bumps
> the version check in the "configure" script - since I doubt that it will be
> remembered to update this document here as well.
>
> >> so I'd also recommend to rather not add this here.
> >
> > Outdated documentation is still better than no documentation. YMMV.
>
> Well, no. In this case, it might rather create wrong expectations for the
> users if they read that their compiler is still supported, but the configure
> script refuses it.
>
> Anyway, if you feel like we need more information for the users about
> supported systems and compiler versions, feel free to update this page here
> instead, it has also fallen behind already quite a bit:
>
>   https://wiki.qemu.org/Supported_Build_Platforms

Unfortunately, that page is not helpful to answer the question which
compiler is required. And given it's construction, it is by nature
always obsolete :)

Furthermore, nowadays, we should have reference documentation in the
repo, not on the wiki.



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 07/41] build-sys: remove MSI's QEMU_GA_MSI_MINGW_DLL_PATH
  2022-04-20 13:25 ` [PATCH 07/41] build-sys: remove MSI's QEMU_GA_MSI_MINGW_DLL_PATH marcandre.lureau
@ 2022-04-20 15:00   ` Konstantin Kostiuk
  2022-04-20 15:10   ` Daniel P. Berrangé
  2022-04-20 15:12   ` Paolo Bonzini
  2 siblings, 0 replies; 124+ messages in thread
From: Konstantin Kostiuk @ 2022-04-20 15:00 UTC (permalink / raw)
  To: Marc-André Lureau; +Cc: Michael Roth, QEMU

[-- Attachment #1: Type: text/plain, Size: 2145 bytes --]

Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com>

On Wed, Apr 20, 2022 at 5:08 PM <marcandre.lureau@redhat.com> wrote:

> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> Since the introduction of the variable in commit 9dacf32d2cb ("qemu-ga:
> Building Windows MSI installation with configure/Makefile"), nothing
> makes use of the Mingw_dlls variable in the .wxs file.
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  configure       | 3 ---
>  qga/meson.build | 1 -
>  2 files changed, 4 deletions(-)
>
> diff --git a/configure b/configure
> index 7c08c18358be..8cbe55ac82e8 100755
> --- a/configure
> +++ b/configure
> @@ -2704,8 +2704,6 @@ if test "$QEMU_GA_VERSION" = ""; then
>      QEMU_GA_VERSION=$(cat $source_path/VERSION)
>  fi
>
> -QEMU_GA_MSI_MINGW_DLL_PATH="$($pkg_config --variable=prefix glib-2.0)/bin"
> -
>  # Mac OS X ships with a broken assembler
>  roms=
>  if { test "$cpu" = "i386" || test "$cpu" = "x86_64"; } && \
> @@ -2792,7 +2790,6 @@ if test "$debug_tcg" = "yes" ; then
>  fi
>  if test "$mingw32" = "yes" ; then
>    echo "CONFIG_WIN32=y" >> $config_host_mak
> -  echo "QEMU_GA_MSI_MINGW_DLL_PATH=${QEMU_GA_MSI_MINGW_DLL_PATH}" >>
> $config_host_mak
>    echo "QEMU_GA_MANUFACTURER=${QEMU_GA_MANUFACTURER}" >> $config_host_mak
>    echo "QEMU_GA_DISTRO=${QEMU_GA_DISTRO}" >> $config_host_mak
>    echo "QEMU_GA_VERSION=${QEMU_GA_VERSION}" >> $config_host_mak
> diff --git a/qga/meson.build b/qga/meson.build
> index 392d56094198..da5e5efb19e8 100644
> --- a/qga/meson.build
> +++ b/qga/meson.build
> @@ -129,7 +129,6 @@ if targetos == 'windows'
>                                wixl, '-o', '@OUTPUT0@', '@INPUT0@',
>                                qemu_ga_msi_arch[cpu],
>                                qemu_ga_msi_vss,
> -                              '-D', 'Mingw_dlls=' +
> config_host['QEMU_GA_MSI_MINGW_DLL_PATH'],
>                              ])
>      all_qga += [qga_msi]
>      alias_target('msi', qga_msi)
> --
> 2.35.1.693.g805e0a68082a
>
>
>

[-- Attachment #2: Type: text/html, Size: 3247 bytes --]

^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 05/41] hw/hyperv: remove needless qemu-common.h include
  2022-04-20 13:25 ` [PATCH 05/41] hw/hyperv: remove needless qemu-common.h include marcandre.lureau
@ 2022-04-20 15:01   ` Daniel P. Berrangé
  0 siblings, 0 replies; 124+ messages in thread
From: Daniel P. Berrangé @ 2022-04-20 15:01 UTC (permalink / raw)
  To: marcandre.lureau; +Cc: qemu-devel

On Wed, Apr 20, 2022 at 05:25:48PM +0400, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  hw/hyperv/syndbg.c | 1 -
>  1 file changed, 1 deletion(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 06/41] include: rename qemu-common.h qemu/copyright.h
  2022-04-20 13:25   ` [Virtio-fs] " marcandre.lureau
@ 2022-04-20 15:04     ` Daniel P. Berrangé
  -1 siblings, 0 replies; 124+ messages in thread
From: Daniel P. Berrangé @ 2022-04-20 15:04 UTC (permalink / raw)
  To: marcandre.lureau
  Cc: Kevin Wolf, Fam Zheng, Vladimir Sementsov-Ogievskiy,
	Stefan Hajnoczi, open list:Block layer core, Peter Maydell,
	Kyle Evans, qemu-devel, Laurent Vivier, open list:virtiofs,
	Hanna Reitz, Gerd Hoffmann, Akihiko Odaki, Michael Roth,
	Paolo Bonzini, Eric Blake, Warner Losh, Dr. David Alan Gilbert,
	Philippe Mathieu-Daudé

On Wed, Apr 20, 2022 at 05:25:49PM +0400, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>

Could use a commit message explaining why this is a good
idea.

I see it contains QEMU_COPYRIGHT macro, but it also then
contains QEMU_HELP_BOTTOM which is about bug reporting
not copyright.

IMHO something like 'qemu-cli.h' could be a better match

> 
> Suggested-by: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  include/{qemu-common.h => qemu/copyright.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 => qemu/copyright.h} (100%)
> 
> diff --git a/include/qemu-common.h b/include/qemu/copyright.h
> similarity index 100%
> rename from include/qemu-common.h
> rename to include/qemu/copyright.h
> diff --git a/bsd-user/main.c b/bsd-user/main.c
> index 88d347d05ebf..aaab3f278534 100644
> --- a/bsd-user/main.c
> +++ b/bsd-user/main.c
> @@ -24,7 +24,7 @@
>  #include <sys/sysctl.h>
>  
>  #include "qemu/osdep.h"
> -#include "qemu-common.h"
> +#include "qemu/copyright.h"
>  #include "qemu/units.h"
>  #include "qemu/accel.h"
>  #include "sysemu/tcg.h"
> diff --git a/linux-user/main.c b/linux-user/main.c
> index fbc9bcfd5f5f..744d216b1e8e 100644
> --- a/linux-user/main.c
> +++ b/linux-user/main.c
> @@ -18,7 +18,7 @@
>   */
>  
>  #include "qemu/osdep.h"
> -#include "qemu-common.h"
> +#include "qemu/copyright.h"
>  #include "qemu/units.h"
>  #include "qemu/accel.h"
>  #include "sysemu/tcg.h"
> diff --git a/qemu-img.c b/qemu-img.c
> index 116e05867558..a2b1d3653a1e 100644
> --- a/qemu-img.c
> +++ b/qemu-img.c
> @@ -25,7 +25,7 @@
>  #include "qemu/osdep.h"
>  #include <getopt.h>
>  
> -#include "qemu-common.h"
> +#include "qemu/copyright.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 eb8afc8b413b..952a36643b0c 100644
> --- a/qemu-io.c
> +++ b/qemu-io.c
> @@ -15,7 +15,7 @@
>  #include <termios.h>
>  #endif
>  
> -#include "qemu-common.h"
> +#include "qemu/copyright.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 713e7557a9eb..f4d121c0c40e 100644
> --- a/qemu-nbd.c
> +++ b/qemu-nbd.c
> @@ -21,7 +21,7 @@
>  #include <libgen.h>
>  #include <pthread.h>
>  
> -#include "qemu-common.h"
> +#include "qemu/copyright.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 ac63d8e47802..8994f73e4735 100644
> --- a/qga/main.c
> +++ b/qga/main.c
> @@ -18,7 +18,7 @@
>  #include <syslog.h>
>  #include <sys/wait.h>
>  #endif
> -#include "qemu-common.h"
> +#include "qemu/copyright.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 f281daeced8d..e7549ffb3bc9 100644
> --- a/scsi/qemu-pr-helper.c
> +++ b/scsi/qemu-pr-helper.c
> @@ -36,7 +36,7 @@
>  #include <mpath_persist.h>
>  #endif
>  
> -#include "qemu-common.h"
> +#include "qemu/copyright.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 46aba6a039c4..b0bf16e16aaa 100644
> --- a/softmmu/vl.c
> +++ b/softmmu/vl.c
> @@ -23,7 +23,7 @@
>   */
>  
>  #include "qemu/osdep.h"
> -#include "qemu-common.h"
> +#include "qemu/copyright.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-storage-daemon.c
> index eb724072579a..a4415e8c995b 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"
>  
> -#include "qemu-common.h"
> +#include "qemu/copyright.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..8af28f5fb823 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/copyright.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..a2a74656fabf 100644
> --- a/ui/cocoa.m
> +++ b/ui/cocoa.m
> @@ -27,7 +27,7 @@
>  #import <Cocoa/Cocoa.h>
>  #include <crt_externs.h>
>  
> -#include "qemu-common.h"
> +#include "qemu/copyright.h"
>  #include "qemu-main.h"
>  #include "ui/clipboard.h"
>  #include "ui/console.h"
> -- 
> 2.35.1.693.g805e0a68082a
> 
> 

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [Virtio-fs] [PATCH 06/41] include: rename qemu-common.h qemu/copyright.h
@ 2022-04-20 15:04     ` Daniel P. Berrangé
  0 siblings, 0 replies; 124+ messages in thread
From: Daniel P. Berrangé @ 2022-04-20 15:04 UTC (permalink / raw)
  To: marcandre.lureau
  Cc: qemu-devel, Kevin Wolf, Fam Zheng, Vladimir Sementsov-Ogievskiy,
	Akihiko Odaki, open list:Block layer core, Peter Maydell,
	Kyle Evans, Laurent Vivier, Dr. David Alan Gilbert,
	open list:virtiofs, Hanna Reitz, Paolo Bonzini, Gerd Hoffmann,
	Stefan Hajnoczi, Michael Roth, Eric Blake, Warner Losh,
	Philippe Mathieu-Daudé

On Wed, Apr 20, 2022 at 05:25:49PM +0400, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>

Could use a commit message explaining why this is a good
idea.

I see it contains QEMU_COPYRIGHT macro, but it also then
contains QEMU_HELP_BOTTOM which is about bug reporting
not copyright.

IMHO something like 'qemu-cli.h' could be a better match

> 
> Suggested-by: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  include/{qemu-common.h => qemu/copyright.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 => qemu/copyright.h} (100%)
> 
> diff --git a/include/qemu-common.h b/include/qemu/copyright.h
> similarity index 100%
> rename from include/qemu-common.h
> rename to include/qemu/copyright.h
> diff --git a/bsd-user/main.c b/bsd-user/main.c
> index 88d347d05ebf..aaab3f278534 100644
> --- a/bsd-user/main.c
> +++ b/bsd-user/main.c
> @@ -24,7 +24,7 @@
>  #include <sys/sysctl.h>
>  
>  #include "qemu/osdep.h"
> -#include "qemu-common.h"
> +#include "qemu/copyright.h"
>  #include "qemu/units.h"
>  #include "qemu/accel.h"
>  #include "sysemu/tcg.h"
> diff --git a/linux-user/main.c b/linux-user/main.c
> index fbc9bcfd5f5f..744d216b1e8e 100644
> --- a/linux-user/main.c
> +++ b/linux-user/main.c
> @@ -18,7 +18,7 @@
>   */
>  
>  #include "qemu/osdep.h"
> -#include "qemu-common.h"
> +#include "qemu/copyright.h"
>  #include "qemu/units.h"
>  #include "qemu/accel.h"
>  #include "sysemu/tcg.h"
> diff --git a/qemu-img.c b/qemu-img.c
> index 116e05867558..a2b1d3653a1e 100644
> --- a/qemu-img.c
> +++ b/qemu-img.c
> @@ -25,7 +25,7 @@
>  #include "qemu/osdep.h"
>  #include <getopt.h>
>  
> -#include "qemu-common.h"
> +#include "qemu/copyright.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 eb8afc8b413b..952a36643b0c 100644
> --- a/qemu-io.c
> +++ b/qemu-io.c
> @@ -15,7 +15,7 @@
>  #include <termios.h>
>  #endif
>  
> -#include "qemu-common.h"
> +#include "qemu/copyright.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 713e7557a9eb..f4d121c0c40e 100644
> --- a/qemu-nbd.c
> +++ b/qemu-nbd.c
> @@ -21,7 +21,7 @@
>  #include <libgen.h>
>  #include <pthread.h>
>  
> -#include "qemu-common.h"
> +#include "qemu/copyright.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 ac63d8e47802..8994f73e4735 100644
> --- a/qga/main.c
> +++ b/qga/main.c
> @@ -18,7 +18,7 @@
>  #include <syslog.h>
>  #include <sys/wait.h>
>  #endif
> -#include "qemu-common.h"
> +#include "qemu/copyright.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 f281daeced8d..e7549ffb3bc9 100644
> --- a/scsi/qemu-pr-helper.c
> +++ b/scsi/qemu-pr-helper.c
> @@ -36,7 +36,7 @@
>  #include <mpath_persist.h>
>  #endif
>  
> -#include "qemu-common.h"
> +#include "qemu/copyright.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 46aba6a039c4..b0bf16e16aaa 100644
> --- a/softmmu/vl.c
> +++ b/softmmu/vl.c
> @@ -23,7 +23,7 @@
>   */
>  
>  #include "qemu/osdep.h"
> -#include "qemu-common.h"
> +#include "qemu/copyright.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-storage-daemon.c
> index eb724072579a..a4415e8c995b 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"
>  
> -#include "qemu-common.h"
> +#include "qemu/copyright.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..8af28f5fb823 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/copyright.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..a2a74656fabf 100644
> --- a/ui/cocoa.m
> +++ b/ui/cocoa.m
> @@ -27,7 +27,7 @@
>  #import <Cocoa/Cocoa.h>
>  #include <crt_externs.h>
>  
> -#include "qemu-common.h"
> +#include "qemu/copyright.h"
>  #include "qemu-main.h"
>  #include "ui/clipboard.h"
>  #include "ui/console.h"
> -- 
> 2.35.1.693.g805e0a68082a
> 
> 

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 07/41] build-sys: remove MSI's QEMU_GA_MSI_MINGW_DLL_PATH
  2022-04-20 13:25 ` [PATCH 07/41] build-sys: remove MSI's QEMU_GA_MSI_MINGW_DLL_PATH marcandre.lureau
  2022-04-20 15:00   ` Konstantin Kostiuk
@ 2022-04-20 15:10   ` Daniel P. Berrangé
  2022-04-20 15:12   ` Paolo Bonzini
  2 siblings, 0 replies; 124+ messages in thread
From: Daniel P. Berrangé @ 2022-04-20 15:10 UTC (permalink / raw)
  To: marcandre.lureau; +Cc: Michael Roth, qemu-devel

On Wed, Apr 20, 2022 at 05:25:50PM +0400, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> Since the introduction of the variable in commit 9dacf32d2cb ("qemu-ga:
> Building Windows MSI installation with configure/Makefile"), nothing
> makes use of the Mingw_dlls variable in the .wxs file.
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  configure       | 3 ---
>  qga/meson.build | 1 -
>  2 files changed, 4 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 07/41] build-sys: remove MSI's QEMU_GA_MSI_MINGW_DLL_PATH
  2022-04-20 13:25 ` [PATCH 07/41] build-sys: remove MSI's QEMU_GA_MSI_MINGW_DLL_PATH marcandre.lureau
  2022-04-20 15:00   ` Konstantin Kostiuk
  2022-04-20 15:10   ` Daniel P. Berrangé
@ 2022-04-20 15:12   ` Paolo Bonzini
  2 siblings, 0 replies; 124+ messages in thread
From: Paolo Bonzini @ 2022-04-20 15:12 UTC (permalink / raw)
  To: marcandre.lureau, qemu-devel; +Cc: Michael Roth

On 4/20/22 15:25, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> Since the introduction of the variable in commit 9dacf32d2cb ("qemu-ga:
> Building Windows MSI installation with configure/Makefile"), nothing
> makes use of the Mingw_dlls variable in the .wxs file.

I think it's a typo for Mingw_bin, i.e.

-                              '-D', 'Mingw_dlls=' + config_host['QEMU_GA_MSI_MINGW_DLL_PATH'],
+                              '-D', 'Mingw_bin=' + config_host['QEMU_GA_MSI_MINGW_DLL_PATH'],

but I am happy to get rid of it.

Paolo

> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>   configure       | 3 ---
>   qga/meson.build | 1 -
>   2 files changed, 4 deletions(-)
> 
> diff --git a/configure b/configure
> index 7c08c18358be..8cbe55ac82e8 100755
> --- a/configure
> +++ b/configure
> @@ -2704,8 +2704,6 @@ if test "$QEMU_GA_VERSION" = ""; then
>       QEMU_GA_VERSION=$(cat $source_path/VERSION)
>   fi
>   
> -QEMU_GA_MSI_MINGW_DLL_PATH="$($pkg_config --variable=prefix glib-2.0)/bin"
> -
>   # Mac OS X ships with a broken assembler
>   roms=
>   if { test "$cpu" = "i386" || test "$cpu" = "x86_64"; } && \
> @@ -2792,7 +2790,6 @@ if test "$debug_tcg" = "yes" ; then
>   fi
>   if test "$mingw32" = "yes" ; then
>     echo "CONFIG_WIN32=y" >> $config_host_mak
> -  echo "QEMU_GA_MSI_MINGW_DLL_PATH=${QEMU_GA_MSI_MINGW_DLL_PATH}" >> $config_host_mak
>     echo "QEMU_GA_MANUFACTURER=${QEMU_GA_MANUFACTURER}" >> $config_host_mak
>     echo "QEMU_GA_DISTRO=${QEMU_GA_DISTRO}" >> $config_host_mak
>     echo "QEMU_GA_VERSION=${QEMU_GA_VERSION}" >> $config_host_mak
> diff --git a/qga/meson.build b/qga/meson.build
> index 392d56094198..da5e5efb19e8 100644
> --- a/qga/meson.build
> +++ b/qga/meson.build
> @@ -129,7 +129,6 @@ if targetos == 'windows'
>                                 wixl, '-o', '@OUTPUT0@', '@INPUT0@',
>                                 qemu_ga_msi_arch[cpu],
>                                 qemu_ga_msi_vss,
> -                              '-D', 'Mingw_dlls=' + config_host['QEMU_GA_MSI_MINGW_DLL_PATH'],
>                               ])
>       all_qga += [qga_msi]
>       alias_target('msi', qga_msi)



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 08/41] build-sys: simplify MSI's QEMU_GA_MANUFACTURER
  2022-04-20 13:48   ` Konstantin Kostiuk
@ 2022-04-20 15:14     ` Daniel P. Berrangé
  2022-04-20 16:36       ` Paolo Bonzini
  0 siblings, 1 reply; 124+ messages in thread
From: Daniel P. Berrangé @ 2022-04-20 15:14 UTC (permalink / raw)
  To: Konstantin Kostiuk
  Cc: Marc-André Lureau, Yan Vugenfirer, QEMU, Michael Roth

On Wed, Apr 20, 2022 at 04:48:54PM +0300, Konstantin Kostiuk wrote:
> Hi Marc-André and Yan,
> 
> Currently, we use this for the mingw-qemu-ga-win package in CentOS Stream 9
> and RHEL.
> https://gitlab.com/redhat/centos-stream/rpms/mingw-qemu-ga-win/-/blob/c9s/build_configure.sh
> 
> Yan, do we need this feature or not?

IMHO the downstream customization makes sense, similar to how
with RPMs we set Red Hat as the vendor.

We neeed  proper meson_options.txt entries and configure --with-qga-...=....
options

> On Wed, Apr 20, 2022 at 4:27 PM <marcandre.lureau@redhat.com> wrote:
> 
> > From: Marc-André Lureau <marcandre.lureau@redhat.com>
> >
> > If there is any reason to allow customization of this variable, we
> > should provide a proper configure option.
> >
> > Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> > ---
> >  configure                 |  4 ----
> >  qga/installer/qemu-ga.wxs | 10 ++++------
> >  qga/meson.build           |  1 -
> >  3 files changed, 4 insertions(+), 11 deletions(-)
> >
> > diff --git a/configure b/configure
> > index 8cbe55ac82e8..5ac653b21351 100755
> > --- a/configure
> > +++ b/configure
> > @@ -2694,9 +2694,6 @@ fi
> >
> >  # Guest agent Windows MSI package
> >
> > -if test "$QEMU_GA_MANUFACTURER" = ""; then
> > -  QEMU_GA_MANUFACTURER=QEMU
> > -fi
> >  if test "$QEMU_GA_DISTRO" = ""; then
> >    QEMU_GA_DISTRO=Linux
> >  fi
> > @@ -2790,7 +2787,6 @@ if test "$debug_tcg" = "yes" ; then
> >  fi
> >  if test "$mingw32" = "yes" ; then
> >    echo "CONFIG_WIN32=y" >> $config_host_mak
> > -  echo "QEMU_GA_MANUFACTURER=${QEMU_GA_MANUFACTURER}" >> $config_host_mak
> >    echo "QEMU_GA_DISTRO=${QEMU_GA_DISTRO}" >> $config_host_mak
> >    echo "QEMU_GA_VERSION=${QEMU_GA_VERSION}" >> $config_host_mak
> >  else
> > diff --git a/qga/installer/qemu-ga.wxs b/qga/installer/qemu-ga.wxs
> > index 0950e8c6becc..53d836c06a96 100644
> > --- a/qga/installer/qemu-ga.wxs
> > +++ b/qga/installer/qemu-ga.wxs
> > @@ -8,9 +8,7 @@
> >      <?error Environment variable QEMU_GA_DISTRO undefined?>
> >    <?endif?>
> >
> > -  <?ifndef env.QEMU_GA_MANUFACTURER ?>
> > -    <?error Environment variable QEMU_GA_MANUFACTURER undefined?>
> > -  <?endif?>
> > +  <?define QEMU_GA_MANUFACTURER = "QEMU" ?>
> >
> >    <?ifndef var.Arch?>
> >      <?error Define Arch to 32 or 64?>
> > @@ -43,14 +41,14 @@
> >      Name="QEMU guest agent"
> >      Id="*"
> >      UpgradeCode="{EB6B8302-C06E-4BEC-ADAC-932C68A3A98D}"
> > -    Manufacturer="$(env.QEMU_GA_MANUFACTURER)"
> > +    Manufacturer="$(var.QEMU_GA_MANUFACTURER)"
> >      Version="$(env.QEMU_GA_VERSION)"
> >      Language="1033">
> >      <?if $(var.Arch) = 32 ?>
> >      <Condition Message="Error: 32-bit version of Qemu GA can not be
> > installed on 64-bit Windows.">NOT VersionNT64</Condition>
> >      <?endif?>
> >      <Package
> > -      Manufacturer="$(env.QEMU_GA_MANUFACTURER)"
> > +      Manufacturer="$(var.QEMU_GA_MANUFACTURER)"
> >        InstallerVersion="200"
> >        Languages="1033"
> >        Compressed="yes"
> > @@ -133,7 +131,7 @@
> >            </Component>
> >            <Component Id="registry_entries"
> > Guid="{D075D109-51CA-11E3-9F8B-000C29858960}">
> >              <RegistryKey Root="HKLM"
> > -
> >  Key="Software\$(env.QEMU_GA_MANUFACTURER)\$(env.QEMU_GA_DISTRO)\Tools\QemuGA">
> > +
> >  Key="Software\$(var.QEMU_GA_MANUFACTURER)\$(env.QEMU_GA_DISTRO)\Tools\QemuGA">
> >                <RegistryValue Type="string" Name="ProductID"
> > Value="fb0a0d66-c7fb-4e2e-a16b-c4a3bfe8d13b" />
> >                <RegistryValue Type="string" Name="Version"
> > Value="$(env.QEMU_GA_VERSION)" />
> >              </RegistryKey>
> > diff --git a/qga/meson.build b/qga/meson.build
> > index da5e5efb19e8..6e57de430d29 100644
> > --- a/qga/meson.build
> > +++ b/qga/meson.build
> > @@ -123,7 +123,6 @@ if targetos == 'windows'
> >                              command: [
> >                                find_program('env'),
> >                                'QEMU_GA_VERSION=' +
> > config_host['QEMU_GA_VERSION'],
> > -                              'QEMU_GA_MANUFACTURER=' +
> > config_host['QEMU_GA_MANUFACTURER'],
> >                                'QEMU_GA_DISTRO=' +
> > config_host['QEMU_GA_DISTRO'],
> >                                'BUILD_DIR=' + meson.build_root(),
> >                                wixl, '-o', '@OUTPUT0@', '@INPUT0@',
> > --
> > 2.35.1.693.g805e0a68082a
> >
> >

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 11/41] qga: replace usleep() with g_usleep()
  2022-04-20 13:25 ` [PATCH 11/41] qga: replace usleep() with g_usleep() marcandre.lureau
@ 2022-04-20 15:16   ` Daniel P. Berrangé
  0 siblings, 0 replies; 124+ messages in thread
From: Daniel P. Berrangé @ 2022-04-20 15:16 UTC (permalink / raw)
  To: marcandre.lureau; +Cc: Michael Roth, qemu-devel

On Wed, Apr 20, 2022 at 05:25:54PM +0400, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> 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é Lureau <marcandre.lureau@redhat.com>
> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  qga/main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 12/41] docs: trace-events-all is installed without renaming
  2022-04-20 13:25 ` [PATCH 12/41] docs: trace-events-all is installed without renaming marcandre.lureau
@ 2022-04-20 15:16   ` Daniel P. Berrangé
  0 siblings, 0 replies; 124+ messages in thread
From: Daniel P. Berrangé @ 2022-04-20 15:16 UTC (permalink / raw)
  To: marcandre.lureau; +Cc: qemu-devel, Stefan Hajnoczi

On Wed, Apr 20, 2022 at 05:25:55PM +0400, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  docs/devel/tracing.rst | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 13/41] arm/digic: replace snprintf() with g_strdup_printf()
  2022-04-20 13:25 ` [PATCH 13/41] arm/digic: replace snprintf() with g_strdup_printf() marcandre.lureau
@ 2022-04-20 15:17   ` Daniel P. Berrangé
  0 siblings, 0 replies; 124+ messages in thread
From: Daniel P. Berrangé @ 2022-04-20 15:17 UTC (permalink / raw)
  To: marcandre.lureau
  Cc: Peter Maydell, open list:Canon DIGIC, qemu-devel, Antony Pavlov

On Wed, Apr 20, 2022 at 05:25:56PM +0400, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> Also fixes a GCC 12.0.1 false-positive:
> ../hw/arm/digic.c: In function ‘digic_init’:
> ../hw/arm/digic.c:45:54: error: ‘%d’ directive output may be truncated writing between 1 and 11 bytes into a region of size 5 [-Werror=format-truncation=]
>    45 |         snprintf(name, DIGIC_TIMER_NAME_MLEN, "timer[%d]", i);
>       |                                                      ^~
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  hw/arm/digic.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 14/41] arm/allwinner-a10: replace snprintf() with g_strdup_printf()
  2022-04-20 13:25 ` [PATCH 14/41] arm/allwinner-a10: " marcandre.lureau
@ 2022-04-20 15:17   ` Daniel P. Berrangé
  0 siblings, 0 replies; 124+ messages in thread
From: Daniel P. Berrangé @ 2022-04-20 15:17 UTC (permalink / raw)
  To: marcandre.lureau
  Cc: Beniamino Galvani, Peter Maydell, open list:Allwinner-a10, qemu-devel

On Wed, Apr 20, 2022 at 05:25:57PM +0400, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> Also fixes a GCC 12.0.1 false-positive:
> ../hw/arm/allwinner-a10.c: In function ‘aw_a10_realize’:
> ../hw/arm/allwinner-a10.c:135:35: error: ‘%d’ directive writing between 1 and 11 bytes into a region of size 8 [-Werror=format-overflow=]
>   135 |             sprintf(bus, "usb-bus.%d", i);
>       |                                   ^~
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  hw/arm/allwinner-a10.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 15/41] intc/exynos4210_gic: replace snprintf() with g_strdup_printf()
  2022-04-20 13:25 ` [PATCH 15/41] intc/exynos4210_gic: " marcandre.lureau
@ 2022-04-20 15:19   ` Daniel P. Berrangé
  0 siblings, 0 replies; 124+ messages in thread
From: Daniel P. Berrangé @ 2022-04-20 15:19 UTC (permalink / raw)
  To: marcandre.lureau
  Cc: Igor Mitsyanko, Peter Maydell, open list:Exynos, qemu-devel

On Wed, Apr 20, 2022 at 05:25:58PM +0400, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> While at it, replace '%x' with '%u' as suggested by Philippe Mathieu-Daudé.
> 
> Also fixes a GCC 12.0.1 -Wformat-overflow false-positive.
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  hw/intc/exynos4210_gic.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 16/41] doc/style: CLang -> Clang
  2022-04-20 13:25 ` [PATCH 16/41] doc/style: CLang -> Clang marcandre.lureau
@ 2022-04-20 15:20   ` Daniel P. Berrangé
  0 siblings, 0 replies; 124+ messages in thread
From: Daniel P. Berrangé @ 2022-04-20 15:20 UTC (permalink / raw)
  To: marcandre.lureau; +Cc: qemu-devel

On Wed, Apr 20, 2022 at 05:25:59PM +0400, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> It's not the way it is usually written (see https://clang.llvm.org/).
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> Reviewed-by: Damien Hedde <damien.hedde@greensocs.com>
> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  docs/devel/style.rst | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 06/41] include: rename qemu-common.h qemu/copyright.h
  2022-04-20 15:04     ` [Virtio-fs] " Daniel P. Berrangé
@ 2022-04-20 15:21       ` Marc-André Lureau
  -1 siblings, 0 replies; 124+ messages in thread
From: Marc-André Lureau @ 2022-04-20 15:21 UTC (permalink / raw)
  To: Daniel P. Berrangé, Peter Maydell
  Cc: Kevin Wolf, Fam Zheng, Dr. David Alan Gilbert,
	Vladimir Sementsov-Ogievskiy, Akihiko Odaki,
	open list:Block layer core, Kyle Evans, QEMU, Laurent Vivier,
	open list:virtiofs, Hanna Reitz, Gerd Hoffmann, Stefan Hajnoczi,
	Michael Roth, Paolo Bonzini, Eric Blake, Warner Losh,
	Philippe Mathieu-Daudé

[-- Attachment #1: Type: text/plain, Size: 6728 bytes --]

Hi

On Wed, Apr 20, 2022 at 7:17 PM Daniel P. Berrangé <berrange@redhat.com>
wrote:

> On Wed, Apr 20, 2022 at 05:25:49PM +0400, marcandre.lureau@redhat.com
> wrote:
> > From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> Could use a commit message explaining why this is a good
> idea.
>
> I see it contains QEMU_COPYRIGHT macro, but it also then
> contains QEMU_HELP_BOTTOM which is about bug reporting
> not copyright.
>
> IMHO something like 'qemu-cli.h' could be a better match
>

That was Peter's suggestion:
https://patchew.org/QEMU/20220323155743.1585078-1-marcandre.lureau@redhat.com/20220323155743.1585078-33-marcandre.lureau@redhat.com/#CAFEAcA9kYweS2zMHjWDuV_y2AxKbgJ5UYNHLK3sASCLVD=yEqg@mail.gmail.com

I don't mind qemu-cli.h or elsewhere

Peter?


> >
> > Suggested-by: Peter Maydell <peter.maydell@linaro.org>
> > Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> > ---
> >  include/{qemu-common.h => qemu/copyright.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 => qemu/copyright.h} (100%)
> >
> > diff --git a/include/qemu-common.h b/include/qemu/copyright.h
> > similarity index 100%
> > rename from include/qemu-common.h
> > rename to include/qemu/copyright.h
> > diff --git a/bsd-user/main.c b/bsd-user/main.c
> > index 88d347d05ebf..aaab3f278534 100644
> > --- a/bsd-user/main.c
> > +++ b/bsd-user/main.c
> > @@ -24,7 +24,7 @@
> >  #include <sys/sysctl.h>
> >
> >  #include "qemu/osdep.h"
> > -#include "qemu-common.h"
> > +#include "qemu/copyright.h"
> >  #include "qemu/units.h"
> >  #include "qemu/accel.h"
> >  #include "sysemu/tcg.h"
> > diff --git a/linux-user/main.c b/linux-user/main.c
> > index fbc9bcfd5f5f..744d216b1e8e 100644
> > --- a/linux-user/main.c
> > +++ b/linux-user/main.c
> > @@ -18,7 +18,7 @@
> >   */
> >
> >  #include "qemu/osdep.h"
> > -#include "qemu-common.h"
> > +#include "qemu/copyright.h"
> >  #include "qemu/units.h"
> >  #include "qemu/accel.h"
> >  #include "sysemu/tcg.h"
> > diff --git a/qemu-img.c b/qemu-img.c
> > index 116e05867558..a2b1d3653a1e 100644
> > --- a/qemu-img.c
> > +++ b/qemu-img.c
> > @@ -25,7 +25,7 @@
> >  #include "qemu/osdep.h"
> >  #include <getopt.h>
> >
> > -#include "qemu-common.h"
> > +#include "qemu/copyright.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 eb8afc8b413b..952a36643b0c 100644
> > --- a/qemu-io.c
> > +++ b/qemu-io.c
> > @@ -15,7 +15,7 @@
> >  #include <termios.h>
> >  #endif
> >
> > -#include "qemu-common.h"
> > +#include "qemu/copyright.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 713e7557a9eb..f4d121c0c40e 100644
> > --- a/qemu-nbd.c
> > +++ b/qemu-nbd.c
> > @@ -21,7 +21,7 @@
> >  #include <libgen.h>
> >  #include <pthread.h>
> >
> > -#include "qemu-common.h"
> > +#include "qemu/copyright.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 ac63d8e47802..8994f73e4735 100644
> > --- a/qga/main.c
> > +++ b/qga/main.c
> > @@ -18,7 +18,7 @@
> >  #include <syslog.h>
> >  #include <sys/wait.h>
> >  #endif
> > -#include "qemu-common.h"
> > +#include "qemu/copyright.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 f281daeced8d..e7549ffb3bc9 100644
> > --- a/scsi/qemu-pr-helper.c
> > +++ b/scsi/qemu-pr-helper.c
> > @@ -36,7 +36,7 @@
> >  #include <mpath_persist.h>
> >  #endif
> >
> > -#include "qemu-common.h"
> > +#include "qemu/copyright.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 46aba6a039c4..b0bf16e16aaa 100644
> > --- a/softmmu/vl.c
> > +++ b/softmmu/vl.c
> > @@ -23,7 +23,7 @@
> >   */
> >
> >  #include "qemu/osdep.h"
> > -#include "qemu-common.h"
> > +#include "qemu/copyright.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-storage-daemon.c
> > index eb724072579a..a4415e8c995b 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"
> >
> > -#include "qemu-common.h"
> > +#include "qemu/copyright.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..8af28f5fb823 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/copyright.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..a2a74656fabf 100644
> > --- a/ui/cocoa.m
> > +++ b/ui/cocoa.m
> > @@ -27,7 +27,7 @@
> >  #import <Cocoa/Cocoa.h>
> >  #include <crt_externs.h>
> >
> > -#include "qemu-common.h"
> > +#include "qemu/copyright.h"
> >  #include "qemu-main.h"
> >  #include "ui/clipboard.h"
> >  #include "ui/console.h"
> > --
> > 2.35.1.693.g805e0a68082a
> >
> >
>
> With regards,
> Daniel
> --
> |: https://berrange.com      -o-
> https://www.flickr.com/photos/dberrange :|
> |: https://libvirt.org         -o-
> https://fstop138.berrange.com :|
> |: https://entangle-photo.org    -o-
> https://www.instagram.com/dberrange :|
>
>
>

-- 
Marc-André Lureau

[-- Attachment #2: Type: text/html, Size: 10171 bytes --]

^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [Virtio-fs] [PATCH 06/41] include: rename qemu-common.h qemu/copyright.h
@ 2022-04-20 15:21       ` Marc-André Lureau
  0 siblings, 0 replies; 124+ messages in thread
From: Marc-André Lureau @ 2022-04-20 15:21 UTC (permalink / raw)
  To: Daniel P. Berrangé, Peter Maydell
  Cc: Kevin Wolf, Fam Zheng, Vladimir Sementsov-Ogievskiy,
	Stefan Hajnoczi, open list:Block layer core, Kyle Evans, QEMU,
	Laurent Vivier, open list:virtiofs, Hanna Reitz, Gerd Hoffmann,
	Akihiko Odaki, Michael Roth, Paolo Bonzini, Eric Blake,
	Warner Losh, Dr. David Alan Gilbert, Philippe Mathieu-Daudé

[-- Attachment #1: Type: text/plain, Size: 6728 bytes --]

Hi

On Wed, Apr 20, 2022 at 7:17 PM Daniel P. Berrangé <berrange@redhat.com>
wrote:

> On Wed, Apr 20, 2022 at 05:25:49PM +0400, marcandre.lureau@redhat.com
> wrote:
> > From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> Could use a commit message explaining why this is a good
> idea.
>
> I see it contains QEMU_COPYRIGHT macro, but it also then
> contains QEMU_HELP_BOTTOM which is about bug reporting
> not copyright.
>
> IMHO something like 'qemu-cli.h' could be a better match
>

That was Peter's suggestion:
https://patchew.org/QEMU/20220323155743.1585078-1-marcandre.lureau@redhat.com/20220323155743.1585078-33-marcandre.lureau@redhat.com/#CAFEAcA9kYweS2zMHjWDuV_y2AxKbgJ5UYNHLK3sASCLVD=yEqg@mail.gmail.com

I don't mind qemu-cli.h or elsewhere

Peter?


> >
> > Suggested-by: Peter Maydell <peter.maydell@linaro.org>
> > Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> > ---
> >  include/{qemu-common.h => qemu/copyright.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 => qemu/copyright.h} (100%)
> >
> > diff --git a/include/qemu-common.h b/include/qemu/copyright.h
> > similarity index 100%
> > rename from include/qemu-common.h
> > rename to include/qemu/copyright.h
> > diff --git a/bsd-user/main.c b/bsd-user/main.c
> > index 88d347d05ebf..aaab3f278534 100644
> > --- a/bsd-user/main.c
> > +++ b/bsd-user/main.c
> > @@ -24,7 +24,7 @@
> >  #include <sys/sysctl.h>
> >
> >  #include "qemu/osdep.h"
> > -#include "qemu-common.h"
> > +#include "qemu/copyright.h"
> >  #include "qemu/units.h"
> >  #include "qemu/accel.h"
> >  #include "sysemu/tcg.h"
> > diff --git a/linux-user/main.c b/linux-user/main.c
> > index fbc9bcfd5f5f..744d216b1e8e 100644
> > --- a/linux-user/main.c
> > +++ b/linux-user/main.c
> > @@ -18,7 +18,7 @@
> >   */
> >
> >  #include "qemu/osdep.h"
> > -#include "qemu-common.h"
> > +#include "qemu/copyright.h"
> >  #include "qemu/units.h"
> >  #include "qemu/accel.h"
> >  #include "sysemu/tcg.h"
> > diff --git a/qemu-img.c b/qemu-img.c
> > index 116e05867558..a2b1d3653a1e 100644
> > --- a/qemu-img.c
> > +++ b/qemu-img.c
> > @@ -25,7 +25,7 @@
> >  #include "qemu/osdep.h"
> >  #include <getopt.h>
> >
> > -#include "qemu-common.h"
> > +#include "qemu/copyright.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 eb8afc8b413b..952a36643b0c 100644
> > --- a/qemu-io.c
> > +++ b/qemu-io.c
> > @@ -15,7 +15,7 @@
> >  #include <termios.h>
> >  #endif
> >
> > -#include "qemu-common.h"
> > +#include "qemu/copyright.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 713e7557a9eb..f4d121c0c40e 100644
> > --- a/qemu-nbd.c
> > +++ b/qemu-nbd.c
> > @@ -21,7 +21,7 @@
> >  #include <libgen.h>
> >  #include <pthread.h>
> >
> > -#include "qemu-common.h"
> > +#include "qemu/copyright.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 ac63d8e47802..8994f73e4735 100644
> > --- a/qga/main.c
> > +++ b/qga/main.c
> > @@ -18,7 +18,7 @@
> >  #include <syslog.h>
> >  #include <sys/wait.h>
> >  #endif
> > -#include "qemu-common.h"
> > +#include "qemu/copyright.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 f281daeced8d..e7549ffb3bc9 100644
> > --- a/scsi/qemu-pr-helper.c
> > +++ b/scsi/qemu-pr-helper.c
> > @@ -36,7 +36,7 @@
> >  #include <mpath_persist.h>
> >  #endif
> >
> > -#include "qemu-common.h"
> > +#include "qemu/copyright.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 46aba6a039c4..b0bf16e16aaa 100644
> > --- a/softmmu/vl.c
> > +++ b/softmmu/vl.c
> > @@ -23,7 +23,7 @@
> >   */
> >
> >  #include "qemu/osdep.h"
> > -#include "qemu-common.h"
> > +#include "qemu/copyright.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-storage-daemon.c
> > index eb724072579a..a4415e8c995b 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"
> >
> > -#include "qemu-common.h"
> > +#include "qemu/copyright.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..8af28f5fb823 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/copyright.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..a2a74656fabf 100644
> > --- a/ui/cocoa.m
> > +++ b/ui/cocoa.m
> > @@ -27,7 +27,7 @@
> >  #import <Cocoa/Cocoa.h>
> >  #include <crt_externs.h>
> >
> > -#include "qemu-common.h"
> > +#include "qemu/copyright.h"
> >  #include "qemu-main.h"
> >  #include "ui/clipboard.h"
> >  #include "ui/console.h"
> > --
> > 2.35.1.693.g805e0a68082a
> >
> >
>
> With regards,
> Daniel
> --
> |: https://berrange.com      -o-
> https://www.flickr.com/photos/dberrange :|
> |: https://libvirt.org         -o-
> https://fstop138.berrange.com :|
> |: https://entangle-photo.org    -o-
> https://www.instagram.com/dberrange :|
>
>
>

-- 
Marc-André Lureau

[-- Attachment #2: Type: text/html, Size: 10171 bytes --]

^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 17/41] doc/build-platforms: document supported compilers
  2022-04-20 14:50         ` Marc-André Lureau
@ 2022-04-20 15:24           ` Daniel P. Berrangé
  2022-04-20 15:32             ` Marc-André Lureau
  0 siblings, 1 reply; 124+ messages in thread
From: Daniel P. Berrangé @ 2022-04-20 15:24 UTC (permalink / raw)
  To: Marc-André Lureau; +Cc: Thomas Huth, qemu-devel

On Wed, Apr 20, 2022 at 06:50:12PM +0400, Marc-André Lureau wrote:
> Hi
> 
> On Wed, Apr 20, 2022 at 6:46 PM Marc-André Lureau
> <marcandre.lureau@redhat.com> wrote:
> >
> > Hi
> >
> > On Wed, Apr 20, 2022 at 6:37 PM Thomas Huth <thuth@redhat.com> wrote:
> > >
> > > On 20/04/2022 16.10, Daniel P. Berrangé wrote:
> > > > On Wed, Apr 20, 2022 at 05:26:00PM +0400, marcandre.lureau@redhat.com wrote:
> > > >> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> > > >>
> > > >> According to our configure checks, this is the list of supported
> > > >> compilers.
> > > >>
> > > >> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> > > >> Reviewed-by: Damien Hedde <damien.hedde@greensocs.com>
> > > >> ---
> > > >>   docs/about/build-platforms.rst | 10 ++++++++++
> > > >>   1 file changed, 10 insertions(+)
> > > >>
> > > >> diff --git a/docs/about/build-platforms.rst b/docs/about/build-platforms.rst
> > > >> index c29a4b8fe649..1980c5d2476f 100644
> > > >> --- a/docs/about/build-platforms.rst
> > > >> +++ b/docs/about/build-platforms.rst
> > > >> @@ -92,6 +92,16 @@ hosted on Linux (Debian/Fedora).
> > > >>   The version of the Windows API that's currently targeted is Vista / Server
> > > >>   2008.
> > > >>
> > > >> +Supported compilers
> > > >> +-------------------
> > > >> +
> > > >> +To compile, QEMU requires either:
> > > >> +
> > > >> +- GCC >= 7.4.0
> > > >> +- Clang >= 6.0
> > > >> +- XCode Clang >= 10.0
> > > >
> > > > Do we need to spell out the versions explicitly ? These versions are
> > > > all derived from what's available in the repos of the supported build
> > > > platforms, similar to any other build deps we have. I don't think we
> > > > want to start a precedent of duplicating versions in this doc for
> > > > build deps we have, and there's nothing particularly special about
> > > > compilers in this respect.
> > >
> > > I agree with Daniel - when I saw this patch, the first thought that I had
> > > was: "This will be getting out of sync quickly" ...
> >
> > I don't have the impression we bump our compiler requirement regularly
> > or lightly.
> >
> > > so I'd also recommend to rather not add this here.
> >
> > Outdated documentation is still better than no documentation. YMMV.
> 
> Another question that is difficult to answer without being familiar
> with QEMU details is whether it can compile with MSVC. This
> documentation would, since it is explicit about the requirement.

Documenting that we mandate GCC or Clang is reasonable. Ideally we could
have a list of all 3rd party deps we have in fact, I'm just not a fan of
copying the version numbers across from configure/meson.

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 18/41] osdep.h: move qemu_build_not_reached()
  2022-04-20 13:26 ` [PATCH 18/41] osdep.h: move qemu_build_not_reached() marcandre.lureau
@ 2022-04-20 15:27   ` Daniel P. Berrangé
  0 siblings, 0 replies; 124+ messages in thread
From: Daniel P. Berrangé @ 2022-04-20 15:27 UTC (permalink / raw)
  To: marcandre.lureau; +Cc: qemu-devel

On Wed, Apr 20, 2022 at 05:26:01PM +0400, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> 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é Lureau <marcandre.lureau@redhat.com>
> ---
>  include/qemu/compiler.h | 16 ----------------
>  include/qemu/osdep.h    | 16 ++++++++++++++++
>  2 files changed, 16 insertions(+), 16 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 19/41] compiler.h: replace QEMU_NORETURN with G_NORETURN
  2022-04-20 13:26   ` marcandre.lureau
@ 2022-04-20 15:29     ` Daniel P. Berrangé
  -1 siblings, 0 replies; 124+ messages in thread
From: Daniel P. Berrangé @ 2022-04-20 15:29 UTC (permalink / raw)
  To: marcandre.lureau
  Cc: Peter Maydell, Chris Wulff, David Hildenbrand, Bin Meng,
	Mark Cave-Ayland, qemu-devel, Philippe Mathieu-Daudé,
	Yanan Wang, Max Filippov, Taylor Simpson, Alistair Francis,
	Edgar E. Iglesias, Warner Losh, Marek Vasut, Yoshinori Sato,
	Daniel Henrique Barboza, Palmer Dabbelt, Artyom Tarasenko,
	Eduardo Habkost, Thomas Huth, Kyle Evans, Richard Henderson,
	Dr. David Alan Gilbert, Greg Kurz, open list:S390 TCG CPUs,
	open list:ARM TCG CPUs, Cédric Le Goater, Stafford Horne,
	Alex Bennée, David Gibson, Kevin Wolf,
	open list:RISC-V TCG CPUs, open list:Block layer core,
	Bastian Koppelmann, Cornelia Huck, Laurent Vivier, Hanna Reitz,
	open list:PowerPC TCG CPUs, Paolo Bonzini, Aleksandar Rikalo,
	Aurelien Jarno

On Wed, Apr 20, 2022 at 05:26:02PM +0400, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> 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é Lureau <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(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 19/41] compiler.h: replace QEMU_NORETURN with G_NORETURN
@ 2022-04-20 15:29     ` Daniel P. Berrangé
  0 siblings, 0 replies; 124+ messages in thread
From: Daniel P. Berrangé @ 2022-04-20 15:29 UTC (permalink / raw)
  To: marcandre.lureau
  Cc: qemu-devel, 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, Artyom Tarasenko, Kevin Wolf,
	Aleksandar Rikalo, Kyle Evans, Richard Henderson,
	Dr. David Alan Gilbert, Greg Kurz, open list:S390 TCG CPUs,
	open list:ARM TCG CPUs, Cédric Le Goater,
	open list:PowerPC TCG CPUs, Stafford Horne, Alex Bennée,
	David Gibson, Eduardo Habkost, open list:RISC-V TCG CPUs,
	open list:Block layer core, Bastian Koppelmann, Chris Wulff,
	Philippe Mathieu-Daudé,
	Hanna Reitz, Palmer Dabbelt, Paolo Bonzini, Aurelien Jarno

On Wed, Apr 20, 2022 at 05:26:02PM +0400, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> 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é Lureau <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(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 17/41] doc/build-platforms: document supported compilers
  2022-04-20 15:24           ` Daniel P. Berrangé
@ 2022-04-20 15:32             ` Marc-André Lureau
  2022-04-20 15:55               ` Daniel P. Berrangé
  2022-04-20 16:11               ` Thomas Huth
  0 siblings, 2 replies; 124+ messages in thread
From: Marc-André Lureau @ 2022-04-20 15:32 UTC (permalink / raw)
  To: Daniel P. Berrangé; +Cc: Thomas Huth, qemu-devel

Hi

On Wed, Apr 20, 2022 at 7:24 PM Daniel P. Berrangé <berrange@redhat.com> wrote:
>
> On Wed, Apr 20, 2022 at 06:50:12PM +0400, Marc-André Lureau wrote:
> > Hi
> >
> > On Wed, Apr 20, 2022 at 6:46 PM Marc-André Lureau
> > <marcandre.lureau@redhat.com> wrote:
> > >
> > > Hi
> > >
> > > On Wed, Apr 20, 2022 at 6:37 PM Thomas Huth <thuth@redhat.com> wrote:
> > > >
> > > > On 20/04/2022 16.10, Daniel P. Berrangé wrote:
> > > > > On Wed, Apr 20, 2022 at 05:26:00PM +0400, marcandre.lureau@redhat.com wrote:
> > > > >> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> > > > >>
> > > > >> According to our configure checks, this is the list of supported
> > > > >> compilers.
> > > > >>
> > > > >> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> > > > >> Reviewed-by: Damien Hedde <damien.hedde@greensocs.com>
> > > > >> ---
> > > > >>   docs/about/build-platforms.rst | 10 ++++++++++
> > > > >>   1 file changed, 10 insertions(+)
> > > > >>
> > > > >> diff --git a/docs/about/build-platforms.rst b/docs/about/build-platforms.rst
> > > > >> index c29a4b8fe649..1980c5d2476f 100644
> > > > >> --- a/docs/about/build-platforms.rst
> > > > >> +++ b/docs/about/build-platforms.rst
> > > > >> @@ -92,6 +92,16 @@ hosted on Linux (Debian/Fedora).
> > > > >>   The version of the Windows API that's currently targeted is Vista / Server
> > > > >>   2008.
> > > > >>
> > > > >> +Supported compilers
> > > > >> +-------------------
> > > > >> +
> > > > >> +To compile, QEMU requires either:
> > > > >> +
> > > > >> +- GCC >= 7.4.0
> > > > >> +- Clang >= 6.0
> > > > >> +- XCode Clang >= 10.0
> > > > >
> > > > > Do we need to spell out the versions explicitly ? These versions are
> > > > > all derived from what's available in the repos of the supported build
> > > > > platforms, similar to any other build deps we have. I don't think we
> > > > > want to start a precedent of duplicating versions in this doc for
> > > > > build deps we have, and there's nothing particularly special about
> > > > > compilers in this respect.
> > > >
> > > > I agree with Daniel - when I saw this patch, the first thought that I had
> > > > was: "This will be getting out of sync quickly" ...
> > >
> > > I don't have the impression we bump our compiler requirement regularly
> > > or lightly.
> > >
> > > > so I'd also recommend to rather not add this here.
> > >
> > > Outdated documentation is still better than no documentation. YMMV.
> >
> > Another question that is difficult to answer without being familiar
> > with QEMU details is whether it can compile with MSVC. This
> > documentation would, since it is explicit about the requirement.
>
> Documenting that we mandate GCC or Clang is reasonable. Ideally we could
> have a list of all 3rd party deps we have in fact, I'm just not a fan of
> copying the version numbers across from configure/meson.
>

I agree, duplicating the version information is not optimal... Yet it
is better than not having it, or having to read or run configure imho.

Sorry (or not) to insist, but it would help having an explicit list of
supported compilers in the human doc (because configure/meson doesn't
rule others out, afaik, nor it really can or should)

> With regards,
> Daniel
> --
> |: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
> |: https://libvirt.org         -o-            https://fstop138.berrange.com :|
> |: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
>



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 20/41] include: move qemu_msync() to osdep
  2022-04-20 13:26 ` [PATCH 20/41] include: move qemu_msync() to osdep marcandre.lureau
@ 2022-04-20 15:33   ` Daniel P. Berrangé
  2022-04-20 15:39     ` Marc-André Lureau
  0 siblings, 1 reply; 124+ messages in thread
From: Daniel P. Berrangé @ 2022-04-20 15:33 UTC (permalink / raw)
  To: marcandre.lureau; +Cc: Stefan Weil, qemu-devel, Paolo Bonzini

On Wed, Apr 20, 2022 at 05:26:03PM +0400, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> The implementation depends on the OS. (and longer-term goal is to move
> cutils to a common subproject)

Common with what other thing(s) ?

IMHO alot of cutils should just go away in favour of using more glib
APIs, and/or be split up, since its a random bag of largely unrelated
bits.



> Signed-off-by: Marc-André Lureau <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(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>

> 
> 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
>  }
>  
> +/**
> + * 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
>  }
>  
> -/**
> - * 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 = ~(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 += ((uintptr_t)addr & (qemu_real_host_page_size() - 1));
> -    length = (length + ~align_mask) & align_mask;
> -
> -    addr = (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 = ~(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 += ((uintptr_t)addr & (qemu_real_host_page_size() - 1));
> +    length = (length + ~align_mask) & align_mask;
> +
> +    addr = (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);
> +}
> -- 
> 2.35.1.693.g805e0a68082a
> 
> 

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 21/41] include: move qemu_fdatasync() to osdep
  2022-04-20 13:26 ` [PATCH 21/41] include: move qemu_fdatasync() " marcandre.lureau
@ 2022-04-20 15:34   ` Daniel P. Berrangé
  0 siblings, 0 replies; 124+ messages in thread
From: Daniel P. Berrangé @ 2022-04-20 15:34 UTC (permalink / raw)
  To: marcandre.lureau; +Cc: qemu-devel

On Wed, Apr 20, 2022 at 05:26:04PM +0400, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> Move QEMU-specific code to util/osdep.c, so cutils can become a common
> subproject.
> 
> Signed-off-by: Marc-André Lureau <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(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 22/41] include: move qemu_*_exec_dir() to cutils
  2022-04-20 13:26 ` [PATCH 22/41] include: move qemu_*_exec_dir() to cutils marcandre.lureau
@ 2022-04-20 15:36   ` Daniel P. Berrangé
  0 siblings, 0 replies; 124+ messages in thread
From: Daniel P. Berrangé @ 2022-04-20 15:36 UTC (permalink / raw)
  To: marcandre.lureau
  Cc: Kevin Wolf, Laurent Vivier, Thomas Huth,
	open list:Block layer core, Alexander Bulekov, Stefan Weil,
	qemu-devel, Qiuhao Li, Darren Kenny, Bandan Das, Stefan Hajnoczi,
	Paolo Bonzini, Hanna Reitz

On Wed, Apr 20, 2022 at 05:26:05PM +0400, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> The function is required by get_relocated_path(), which is used by
> qemu-ga and may be generally useful.

In patch 06 I suggested we have a qemu-cli.h, and perhaps this
qemu_*_exec_dir functionality is also relevant for qemu-cli.{c,h}
since it is specific to command line tool initialization.

> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  include/qemu/cutils.h                |   7 ++
>  include/qemu/osdep.h                 |   8 --
>  qemu-io.c                            |   1 +
>  storage-daemon/qemu-storage-daemon.c |   1 +
>  tests/qtest/fuzz/fuzz.c              |   1 +
>  util/cutils.c                        | 109 +++++++++++++++++++++++++++
>  util/oslib-posix.c                   |  81 --------------------
>  util/oslib-win32.c                   |  36 ---------
>  8 files changed, 119 insertions(+), 125 deletions(-)
> 
> diff --git a/include/qemu/cutils.h b/include/qemu/cutils.h
> index 5c6572d44422..40e10e19a7ed 100644
> --- a/include/qemu/cutils.h
> +++ b/include/qemu/cutils.h
> @@ -193,6 +193,13 @@ int uleb128_decode_small(const uint8_t *in, uint32_t *n);
>   */
>  int qemu_pstrcmp0(const char **str1, const char **str2);
>  
> +/* Find program directory, and save it for later usage with
> + * qemu_get_exec_dir().
> + * Try OS specific API first, if not working, parse from argv0. */
> +void qemu_init_exec_dir(const char *argv0);
> +
> +/* Get the saved exec dir.  */
> +const char *qemu_get_exec_dir(void);
>  
>  /**
>   * get_relocated_path:
> diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
> index a87f1b7f32e6..9fd52d6a33a7 100644
> --- a/include/qemu/osdep.h
> +++ b/include/qemu/osdep.h
> @@ -567,14 +567,6 @@ bool fips_get_state(void);
>   */
>  char *qemu_get_local_state_pathname(const char *relative_pathname);
>  
> -/* Find program directory, and save it for later usage with
> - * qemu_get_exec_dir().
> - * Try OS specific API first, if not working, parse from argv0. */
> -void qemu_init_exec_dir(const char *argv0);
> -
> -/* Get the saved exec dir.  */
> -const char *qemu_get_exec_dir(void);
> -
>  /**
>   * qemu_getauxval:
>   * @type: the auxiliary vector key to lookup
> diff --git a/qemu-io.c b/qemu-io.c
> index 952a36643b0c..458fadd99a92 100644
> --- a/qemu-io.c
> +++ b/qemu-io.c
> @@ -16,6 +16,7 @@
>  #endif
>  
>  #include "qemu/copyright.h"
> +#include "qemu/cutils.h"
>  #include "qapi/error.h"
>  #include "qemu-io.h"
>  #include "qemu/error-report.h"
> diff --git a/storage-daemon/qemu-storage-daemon.c b/storage-daemon/qemu-storage-daemon.c
> index a4415e8c995b..63b155013ed7 100644
> --- a/storage-daemon/qemu-storage-daemon.c
> +++ b/storage-daemon/qemu-storage-daemon.c
> @@ -44,6 +44,7 @@
>  
>  #include "qemu/copyright.h"
>  #include "qemu-version.h"
> +#include "qemu/cutils.h"
>  #include "qemu/config-file.h"
>  #include "qemu/error-report.h"
>  #include "qemu/help_option.h"
> diff --git a/tests/qtest/fuzz/fuzz.c b/tests/qtest/fuzz/fuzz.c
> index 5f77c849837f..d3afd294db24 100644
> --- a/tests/qtest/fuzz/fuzz.c
> +++ b/tests/qtest/fuzz/fuzz.c
> @@ -15,6 +15,7 @@
>  
>  #include <wordexp.h>
>  
> +#include "qemu/cutils.h"
>  #include "qemu/datadir.h"
>  #include "sysemu/sysemu.h"
>  #include "sysemu/qtest.h"
> diff --git a/util/cutils.c b/util/cutils.c
> index b2777210e7da..443927275fdb 100644
> --- a/util/cutils.c
> +++ b/util/cutils.c
> @@ -931,6 +931,115 @@ static inline const char *next_component(const char *dir, int *p_len)
>      return dir;
>  }
>  
> +static const char *exec_dir;
> +
> +void qemu_init_exec_dir(const char *argv0)
> +{
> +#ifdef G_OS_WIN32
> +    char *p;
> +    char buf[MAX_PATH];
> +    DWORD len;
> +
> +    if (exec_dir) {
> +        return;
> +    }
> +
> +    len = GetModuleFileName(NULL, buf, sizeof(buf) - 1);
> +    if (len == 0) {
> +        return;
> +    }
> +
> +    buf[len] = 0;
> +    p = buf + len - 1;
> +    while (p != buf && *p != '\\') {
> +        p--;
> +    }
> +    *p = 0;
> +    if (access(buf, R_OK) == 0) {
> +        exec_dir = g_strdup(buf);
> +    } else {
> +        exec_dir = CONFIG_BINDIR;
> +    }
> +#else
> +    char *p = NULL;
> +    char buf[PATH_MAX];
> +
> +    if (exec_dir) {
> +        return;
> +    }
> +
> +#if defined(__linux__)
> +    {
> +        int len;
> +        len = readlink("/proc/self/exe", buf, sizeof(buf) - 1);
> +        if (len > 0) {
> +            buf[len] = 0;
> +            p = buf;
> +        }
> +    }
> +#elif defined(__FreeBSD__) \
> +      || (defined(__NetBSD__) && defined(KERN_PROC_PATHNAME))
> +    {
> +#if defined(__FreeBSD__)
> +        static int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1};
> +#else
> +        static int mib[4] = {CTL_KERN, KERN_PROC_ARGS, -1, KERN_PROC_PATHNAME};
> +#endif
> +        size_t len = sizeof(buf) - 1;
> +
> +        *buf = '\0';
> +        if (!sysctl(mib, ARRAY_SIZE(mib), buf, &len, NULL, 0) &&
> +            *buf) {
> +            buf[sizeof(buf) - 1] = '\0';
> +            p = buf;
> +        }
> +    }
> +#elif defined(__APPLE__)
> +    {
> +        char fpath[PATH_MAX];
> +        uint32_t len = sizeof(fpath);
> +        if (_NSGetExecutablePath(fpath, &len) == 0) {
> +            p = realpath(fpath, buf);
> +            if (!p) {
> +                return;
> +            }
> +        }
> +    }
> +#elif defined(__HAIKU__)
> +    {
> +        image_info ii;
> +        int32_t c = 0;
> +
> +        *buf = '\0';
> +        while (get_next_image_info(0, &c, &ii) == B_OK) {
> +            if (ii.type == B_APP_IMAGE) {
> +                strncpy(buf, ii.name, sizeof(buf));
> +                buf[sizeof(buf) - 1] = 0;
> +                p = buf;
> +                break;
> +            }
> +        }
> +    }
> +#endif
> +    /* If we don't have any way of figuring out the actual executable
> +       location then try argv[0].  */
> +    if (!p && argv0) {
> +        p = realpath(argv0, buf);
> +    }
> +    if (p) {
> +        exec_dir = g_path_get_dirname(p);
> +    } else {
> +        exec_dir = CONFIG_BINDIR;
> +    }
> +#endif
> +}
> +
> +const char *qemu_get_exec_dir(void)
> +{
> +    return exec_dir;
> +}
> +
> +
>  char *get_relocated_path(const char *dir)
>  {
>      size_t prefix_len = strlen(CONFIG_PREFIX);
> diff --git a/util/oslib-posix.c b/util/oslib-posix.c
> index 161f1123259f..4f18cc612850 100644
> --- a/util/oslib-posix.c
> +++ b/util/oslib-posix.c
> @@ -321,87 +321,6 @@ void qemu_set_tty_echo(int fd, bool echo)
>      tcsetattr(fd, TCSANOW, &tty);
>  }
>  
> -static const char *exec_dir;
> -
> -void qemu_init_exec_dir(const char *argv0)
> -{
> -    char *p = NULL;
> -    char buf[PATH_MAX];
> -
> -    if (exec_dir) {
> -        return;
> -    }
> -
> -#if defined(__linux__)
> -    {
> -        int len;
> -        len = readlink("/proc/self/exe", buf, sizeof(buf) - 1);
> -        if (len > 0) {
> -            buf[len] = 0;
> -            p = buf;
> -        }
> -    }
> -#elif defined(__FreeBSD__) \
> -      || (defined(__NetBSD__) && defined(KERN_PROC_PATHNAME))
> -    {
> -#if defined(__FreeBSD__)
> -        static int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1};
> -#else
> -        static int mib[4] = {CTL_KERN, KERN_PROC_ARGS, -1, KERN_PROC_PATHNAME};
> -#endif
> -        size_t len = sizeof(buf) - 1;
> -
> -        *buf = '\0';
> -        if (!sysctl(mib, ARRAY_SIZE(mib), buf, &len, NULL, 0) &&
> -            *buf) {
> -            buf[sizeof(buf) - 1] = '\0';
> -            p = buf;
> -        }
> -    }
> -#elif defined(__APPLE__)
> -    {
> -        char fpath[PATH_MAX];
> -        uint32_t len = sizeof(fpath);
> -        if (_NSGetExecutablePath(fpath, &len) == 0) {
> -            p = realpath(fpath, buf);
> -            if (!p) {
> -                return;
> -            }
> -        }
> -    }
> -#elif defined(__HAIKU__)
> -    {
> -        image_info ii;
> -        int32_t c = 0;
> -
> -        *buf = '\0';
> -        while (get_next_image_info(0, &c, &ii) == B_OK) {
> -            if (ii.type == B_APP_IMAGE) {
> -                strncpy(buf, ii.name, sizeof(buf));
> -                buf[sizeof(buf) - 1] = 0;
> -                p = buf;
> -                break;
> -            }
> -        }
> -    }
> -#endif
> -    /* If we don't have any way of figuring out the actual executable
> -       location then try argv[0].  */
> -    if (!p && argv0) {
> -        p = realpath(argv0, buf);
> -    }
> -    if (p) {
> -        exec_dir = g_path_get_dirname(p);
> -    } else {
> -        exec_dir = CONFIG_BINDIR;
> -    }
> -}
> -
> -const char *qemu_get_exec_dir(void)
> -{
> -    return exec_dir;
> -}
> -
>  #ifdef CONFIG_LINUX
>  static void sigbus_handler(int signal, siginfo_t *siginfo, void *ctx)
>  #else /* CONFIG_LINUX */
> diff --git a/util/oslib-win32.c b/util/oslib-win32.c
> index 1e05c316b311..0371082d23b3 100644
> --- a/util/oslib-win32.c
> +++ b/util/oslib-win32.c
> @@ -270,42 +270,6 @@ void qemu_set_tty_echo(int fd, bool echo)
>      }
>  }
>  
> -static const char *exec_dir;
> -
> -void qemu_init_exec_dir(const char *argv0)
> -{
> -
> -    char *p;
> -    char buf[MAX_PATH];
> -    DWORD len;
> -
> -    if (exec_dir) {
> -        return;
> -    }
> -
> -    len = GetModuleFileName(NULL, buf, sizeof(buf) - 1);
> -    if (len == 0) {
> -        return;
> -    }
> -
> -    buf[len] = 0;
> -    p = buf + len - 1;
> -    while (p != buf && *p != '\\') {
> -        p--;
> -    }
> -    *p = 0;
> -    if (access(buf, R_OK) == 0) {
> -        exec_dir = g_strdup(buf);
> -    } else {
> -        exec_dir = CONFIG_BINDIR;
> -    }
> -}
> -
> -const char *qemu_get_exec_dir(void)
> -{
> -    return exec_dir;
> -}
> -
>  int getpagesize(void)
>  {
>      SYSTEM_INFO system_info;
> -- 
> 2.35.1.693.g805e0a68082a
> 
> 

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 23/41] include: add qemu/keyval.h
  2022-04-20 13:26 ` [PATCH 23/41] include: add qemu/keyval.h marcandre.lureau
@ 2022-04-20 15:38   ` Daniel P. Berrangé
  0 siblings, 0 replies; 124+ messages in thread
From: Daniel P. Berrangé @ 2022-04-20 15:38 UTC (permalink / raw)
  To: marcandre.lureau
  Cc: Eduardo Habkost, Michael Roth, Paolo Bonzini, qemu-devel,
	Markus Armbruster

On Wed, Apr 20, 2022 at 05:26:06PM +0400, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> 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.

Great, I really dislike it when the .h file name doesn't match the
name where I'll find the .c file impl

> 
> Signed-off-by: Marc-André Lureau <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

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 24/41] include: move qdict_{crumple,flatten} declarations
  2022-04-20 13:26 ` [PATCH 24/41] include: move qdict_{crumple,flatten} declarations marcandre.lureau
@ 2022-04-20 15:39   ` Daniel P. Berrangé
  0 siblings, 0 replies; 124+ messages in thread
From: Daniel P. Berrangé @ 2022-04-20 15:39 UTC (permalink / raw)
  To: marcandre.lureau
  Cc: Kevin Wolf, open list:Block layer core, qemu-devel,
	Markus Armbruster, Hanna Reitz, Paolo Bonzini

On Wed, Apr 20, 2022 at 05:26:07PM +0400, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> Move them where they belong, since the functions are implemented in block-qdict.c.
> 
> Signed-off-by: Marc-André Lureau <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(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 25/41] tests: remove block/qdict checks from check-qobject.c
  2022-04-20 13:26 ` [PATCH 25/41] tests: remove block/qdict checks from check-qobject.c marcandre.lureau
@ 2022-04-20 15:39   ` Daniel P. Berrangé
  0 siblings, 0 replies; 124+ messages in thread
From: Daniel P. Berrangé @ 2022-04-20 15:39 UTC (permalink / raw)
  To: marcandre.lureau; +Cc: qemu-devel, Markus Armbruster

On Wed, Apr 20, 2022 at 05:26:08PM +0400, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> 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é Lureau <marcandre.lureau@redhat.com>
> ---
>  tests/unit/check-qobject.c | 8 --------
>  1 file changed, 8 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 20/41] include: move qemu_msync() to osdep
  2022-04-20 15:33   ` Daniel P. Berrangé
@ 2022-04-20 15:39     ` Marc-André Lureau
  0 siblings, 0 replies; 124+ messages in thread
From: Marc-André Lureau @ 2022-04-20 15:39 UTC (permalink / raw)
  To: Daniel P. Berrangé; +Cc: Stefan Weil, qemu-devel, Paolo Bonzini

Hi

On Wed, Apr 20, 2022 at 7:33 PM Daniel P. Berrangé <berrange@redhat.com> wrote:
>
> On Wed, Apr 20, 2022 at 05:26:03PM +0400, marcandre.lureau@redhat.com wrote:
> > From: Marc-André Lureau <marcandre.lureau@redhat.com>
> >
> > The implementation depends on the OS. (and longer-term goal is to move
> > cutils to a common subproject)
>
> Common with what other thing(s) ?

This is down the line, but my initial focus was to make qemu-ga a
subproject() (I have a wip/poc branch, so it is possible!)

For that I moved all qapi/qmp-related stuff in another subproject().

We could further split the qapi/qmp subproject (qemu-common?). This
"common" subproject could be used by libvhost-user for example.

Various helper binaries could also become subprojects at some point. I
haven't looked at all possibilities, there is already a lot of
preliminary cleanup to take care of :)

thanks

>
> IMHO alot of cutils should just go away in favour of using more glib
> APIs, and/or be split up, since its a random bag of largely unrelated
> bits.
>
>
>
> > Signed-off-by: Marc-André Lureau <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(-)
>
> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
>
> >
> > 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
> >  }
> >
> > +/**
> > + * 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
> >  }
> >
> > -/**
> > - * 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 = ~(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 += ((uintptr_t)addr & (qemu_real_host_page_size() - 1));
> > -    length = (length + ~align_mask) & align_mask;
> > -
> > -    addr = (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 = ~(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 += ((uintptr_t)addr & (qemu_real_host_page_size() - 1));
> > +    length = (length + ~align_mask) & align_mask;
> > +
> > +    addr = (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);
> > +}
> > --
> > 2.35.1.693.g805e0a68082a
> >
> >
>
> With regards,
> Daniel
> --
> |: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
> |: https://libvirt.org         -o-            https://fstop138.berrange.com :|
> |: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
>



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 29/41] tests: run-time skip test-qga if TSAN is enabled
  2022-04-20 13:26 ` [PATCH 29/41] tests: run-time skip test-qga if TSAN is enabled marcandre.lureau
@ 2022-04-20 15:41   ` Daniel P. Berrangé
  2022-04-21 13:02     ` Marc-André Lureau
  0 siblings, 1 reply; 124+ messages in thread
From: Daniel P. Berrangé @ 2022-04-20 15:41 UTC (permalink / raw)
  To: marcandre.lureau; +Cc: Michael Roth, qemu-devel

On Wed, Apr 20, 2022 at 05:26:12PM +0400, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> This allows to make sure the test is still built, and gives more
> accurate report details.
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  tests/unit/test-qga.c  | 7 +++++++
>  tests/unit/meson.build | 2 +-
>  2 files changed, 8 insertions(+), 1 deletion(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 30/41] Move error_printf_unless_qmp() with monitor unit
  2022-04-20 13:26 ` [PATCH 30/41] Move error_printf_unless_qmp() with monitor unit marcandre.lureau
@ 2022-04-20 15:42   ` Daniel P. Berrangé
  0 siblings, 0 replies; 124+ messages in thread
From: Daniel P. Berrangé @ 2022-04-20 15:42 UTC (permalink / raw)
  To: marcandre.lureau
  Cc: Paolo Bonzini, Dr. David Alan Gilbert, qemu-devel,
	Markus Armbruster, Gerd Hoffmann

On Wed, Apr 20, 2022 at 05:26:13PM +0400, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> 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é Lureau <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(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 31/41] qga: move qga_get_host_name()
  2022-04-20 13:26 ` [PATCH 31/41] qga: move qga_get_host_name() marcandre.lureau
  2022-04-20 13:51   ` Konstantin Kostiuk
@ 2022-04-20 15:44   ` Daniel P. Berrangé
  1 sibling, 0 replies; 124+ messages in thread
From: Daniel P. Berrangé @ 2022-04-20 15:44 UTC (permalink / raw)
  To: marcandre.lureau
  Cc: Stefan Weil, Konstantin Kostiuk, qemu-devel, Michael Roth, Paolo Bonzini

On Wed, Apr 20, 2022 at 05:26:14PM +0400, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> The function is specific to qemu-ga, no need to share it in QEMU.
> 
> Signed-off-by: Marc-André Lureau <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(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 32/41] qtest: simplify socket_send()
  2022-04-20 13:26 ` [PATCH 32/41] qtest: simplify socket_send() marcandre.lureau
  2022-04-20 14:24   ` Thomas Huth
@ 2022-04-20 15:45   ` Daniel P. Berrangé
  2022-04-21 13:07     ` Marc-André Lureau
  1 sibling, 1 reply; 124+ messages in thread
From: Daniel P. Berrangé @ 2022-04-20 15:45 UTC (permalink / raw)
  To: marcandre.lureau; +Cc: Laurent Vivier, Paolo Bonzini, Thomas Huth, qemu-devel

On Wed, Apr 20, 2022 at 05:26:15PM +0400, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> Reuse qemu_write_full().
> 
> Signed-off-by: Marc-André Lureau <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)
>  
>  static void socket_send(int fd, const char *buf, size_t size)
>  {
> -    size_t offset;
> -
> -    offset = 0;
> -    while (offset < size) {
> -        ssize_t len;
> +    size_t res = qemu_write_full(fd, buf, size);
>  
> -        len = write(fd, buf + offset, size - offset);
> -        if (len == -1 && errno == EINTR) {
> -            continue;
> -        }
> -
> -        g_assert_cmpint(len, >, 0);
> -
> -        offset += len;
> -    }
> +    assert(res == size);
>  }

IMHO socket_send should jsut be deleted, with the few callers
directly using qemu_write_full

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 33/41] tests: move libqtest.c under libqos/
  2022-04-20 13:26 ` [PATCH 33/41] tests: move libqtest.c under libqos/ marcandre.lureau
  2022-04-20 14:16   ` Thomas Huth
@ 2022-04-20 15:48   ` Daniel P. Berrangé
  1 sibling, 0 replies; 124+ messages in thread
From: Daniel P. Berrangé @ 2022-04-20 15:48 UTC (permalink / raw)
  To: marcandre.lureau; +Cc: Laurent Vivier, Paolo Bonzini, Thomas Huth, qemu-devel

On Wed, Apr 20, 2022 at 05:26:16PM +0400, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> Since commit a2ce7dbd917 ("meson: convert tests/qtest to meson"),
> libqtest.h is under libqos/ directory. Let's move the .c along with it.

It is a bit odd for libqtest.h to be under libqos to begin with
IMHO. The commit doesn't explain why it was moved, so feels like
possibly a mistake.

> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  docs/devel/qtest.rst                | 4 ++--
>  tests/qtest/{ => libqos}/libqtest.c | 4 ++--
>  tests/qtest/libqos/meson.build      | 2 +-
>  tests/unit/meson.build              | 2 +-
>  4 files changed, 6 insertions(+), 6 deletions(-)
>  rename tests/qtest/{ => libqos}/libqtest.c (99%)
> 
> diff --git a/docs/devel/qtest.rst b/docs/devel/qtest.rst
> index c3dceb6c8a1d..a9a6b0a7466b 100644
> --- a/docs/devel/qtest.rst
> +++ b/docs/devel/qtest.rst
> @@ -18,8 +18,8 @@ QTest cases can be executed with
>  
>     make check-qtest
>  
> -The QTest library is implemented by ``tests/qtest/libqtest.c`` and the API is
> -defined in ``tests/qtest/libqtest.h``.
> +The QTest library is implemented by ``tests/qtest/libqos/libqtest.c`` and the API is
> +defined in ``tests/qtest/libqos/libqtest.h``.
>  
>  Consider adding a new QTest case when you are introducing a new virtual
>  hardware, or extending one if you are adding functionalities to an existing
> diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqos/libqtest.c
> similarity index 99%
> rename from tests/qtest/libqtest.c
> rename to tests/qtest/libqos/libqtest.c
> index 2b9bdb947d6f..9097329ce435 100644
> --- a/tests/qtest/libqtest.c
> +++ b/tests/qtest/libqos/libqtest.c
> @@ -20,7 +20,7 @@
>  #include <sys/wait.h>
>  #include <sys/un.h>
>  
> -#include "libqos/libqtest.h"
> +#include "libqtest.h"
>  #include "qemu/ctype.h"
>  #include "qemu/cutils.h"
>  #include "qapi/error.h"
> @@ -268,7 +268,7 @@ QTestState *qtest_init_without_qmp_handshake(const char *extra_args)
>      /* It's possible that if an earlier test run crashed it might
>       * have left a stale unix socket lying around. Delete any
>       * stale old socket to avoid spurious test failures with
> -     * tests/libqtest.c:70:init_socket: assertion failed (ret != -1): (-1 != -1)
> +     * libqtest.c:70:init_socket: assertion failed (ret != -1): (-1 != -1)
>       */
>      unlink(socket_path);
>      unlink(qmp_socket_path);
> diff --git a/tests/qtest/libqos/meson.build b/tests/qtest/libqos/meson.build
> index e988d1579172..0c172f27533a 100644
> --- a/tests/qtest/libqos/meson.build
> +++ b/tests/qtest/libqos/meson.build
> @@ -1,4 +1,4 @@
> -libqos_srcs = files('../libqtest.c',
> +libqos_srcs = files('libqtest.c',
>          'qgraph.c',
>          'qos_external.c',
>          'pci.c',
> diff --git a/tests/unit/meson.build b/tests/unit/meson.build
> index ab01e00f12cf..188b0ea80c37 100644
> --- a/tests/unit/meson.build
> +++ b/tests/unit/meson.build
> @@ -154,7 +154,7 @@ if have_system
>  endif
>  
>  if have_ga and targetos == 'linux'
> -  tests += {'test-qga': ['../qtest/libqtest.c']}
> +  tests += {'test-qga': ['../qtest/libqos/libqtest.c']}
>    test_deps += {'test-qga': qga}
>  endif
>  
> -- 
> 2.35.1.693.g805e0a68082a
> 
> 

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 35/41] util: simplify write in signal handler
  2022-04-20 13:26 ` [PATCH 35/41] util: simplify write in signal handler marcandre.lureau
@ 2022-04-20 15:49   ` Daniel P. Berrangé
  0 siblings, 0 replies; 124+ messages in thread
From: Daniel P. Berrangé @ 2022-04-20 15:49 UTC (permalink / raw)
  To: marcandre.lureau; +Cc: qemu-devel

On Wed, Apr 20, 2022 at 05:26:18PM +0400, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> Use qemu_write_full() instead of open-coding a write loop.
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  util/compatfd.c | 18 ++----------------
>  1 file changed, 2 insertions(+), 16 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 36/41] util: use qemu_write_full() in qemu_write_pidfile()
  2022-04-20 13:26 ` [PATCH 36/41] util: use qemu_write_full() in qemu_write_pidfile() marcandre.lureau
@ 2022-04-20 15:49   ` Daniel P. Berrangé
  0 siblings, 0 replies; 124+ messages in thread
From: Daniel P. Berrangé @ 2022-04-20 15:49 UTC (permalink / raw)
  To: marcandre.lureau; +Cc: Paolo Bonzini, qemu-devel

On Wed, Apr 20, 2022 at 05:26:19PM +0400, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> Mostly for correctness.
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  util/oslib-posix.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 37/41] util: use qemu_create() in qemu_write_pidfile()
  2022-04-20 13:26 ` [PATCH 37/41] util: use qemu_create() " marcandre.lureau
@ 2022-04-20 15:50   ` Daniel P. Berrangé
  0 siblings, 0 replies; 124+ messages in thread
From: Daniel P. Berrangé @ 2022-04-20 15:50 UTC (permalink / raw)
  To: marcandre.lureau; +Cc: Paolo Bonzini, qemu-devel

On Wed, Apr 20, 2022 at 05:26:20PM +0400, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> qemu_open_old(O_CREATE) should be replaced with qemu_create() which
> handles Error reporting.
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  util/oslib-posix.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 38/41] util: replace qemu_get_local_state_pathname()
  2022-04-20 13:26   ` [Virtio-fs] " marcandre.lureau
@ 2022-04-20 15:51     ` Daniel P. Berrangé
  -1 siblings, 0 replies; 124+ messages in thread
From: Daniel P. Berrangé @ 2022-04-20 15:51 UTC (permalink / raw)
  To: marcandre.lureau
  Cc: Fam Zheng, open list:Block SCSI subsystem, Michael Roth,
	qemu-devel, Dr. David Alan Gilbert, open list:virtiofs,
	Stefan Hajnoczi, Stefan Weil, Paolo Bonzini

On Wed, Apr 20, 2022 at 05:26:21PM +0400, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> 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é Lureau <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(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [Virtio-fs] [PATCH 38/41] util: replace qemu_get_local_state_pathname()
@ 2022-04-20 15:51     ` Daniel P. Berrangé
  0 siblings, 0 replies; 124+ messages in thread
From: Daniel P. Berrangé @ 2022-04-20 15:51 UTC (permalink / raw)
  To: marcandre.lureau
  Cc: qemu-devel, Fam Zheng, open list:Block SCSI subsystem,
	Michael Roth, Dr. David Alan Gilbert, open list:virtiofs,
	Stefan Hajnoczi, Paolo Bonzini, Stefan Weil

On Wed, Apr 20, 2022 at 05:26:21PM +0400, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> 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é Lureau <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(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 39/41] qga: remove need for QEMU atomic.h
  2022-04-20 13:26 ` [PATCH 39/41] qga: remove need for QEMU atomic.h marcandre.lureau
@ 2022-04-20 15:51   ` Daniel P. Berrangé
  0 siblings, 0 replies; 124+ messages in thread
From: Daniel P. Berrangé @ 2022-04-20 15:51 UTC (permalink / raw)
  To: marcandre.lureau; +Cc: Michael Roth, qemu-devel

On Wed, Apr 20, 2022 at 05:26:22PM +0400, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> 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é Lureau <marcandre.lureau@redhat.com>
> ---
>  qga/commands.c | 12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 17/41] doc/build-platforms: document supported compilers
  2022-04-20 15:32             ` Marc-André Lureau
@ 2022-04-20 15:55               ` Daniel P. Berrangé
  2022-04-20 16:47                 ` Marc-André Lureau
  2022-04-20 16:11               ` Thomas Huth
  1 sibling, 1 reply; 124+ messages in thread
From: Daniel P. Berrangé @ 2022-04-20 15:55 UTC (permalink / raw)
  To: Marc-André Lureau; +Cc: Thomas Huth, qemu-devel

On Wed, Apr 20, 2022 at 07:32:38PM +0400, Marc-André Lureau wrote:
> Hi
> 
> On Wed, Apr 20, 2022 at 7:24 PM Daniel P. Berrangé <berrange@redhat.com> wrote:
> >
> > On Wed, Apr 20, 2022 at 06:50:12PM +0400, Marc-André Lureau wrote:
> > > Hi
> > >
> > > On Wed, Apr 20, 2022 at 6:46 PM Marc-André Lureau
> > > <marcandre.lureau@redhat.com> wrote:
> > > >
> > > > Hi
> > > >
> > > > On Wed, Apr 20, 2022 at 6:37 PM Thomas Huth <thuth@redhat.com> wrote:
> > > > >
> > > > > On 20/04/2022 16.10, Daniel P. Berrangé wrote:
> > > > > > On Wed, Apr 20, 2022 at 05:26:00PM +0400, marcandre.lureau@redhat.com wrote:
> > > > > >> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> > > > > >>
> > > > > >> According to our configure checks, this is the list of supported
> > > > > >> compilers.
> > > > > >>
> > > > > >> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> > > > > >> Reviewed-by: Damien Hedde <damien.hedde@greensocs.com>
> > > > > >> ---
> > > > > >>   docs/about/build-platforms.rst | 10 ++++++++++
> > > > > >>   1 file changed, 10 insertions(+)
> > > > > >>
> > > > > >> diff --git a/docs/about/build-platforms.rst b/docs/about/build-platforms.rst
> > > > > >> index c29a4b8fe649..1980c5d2476f 100644
> > > > > >> --- a/docs/about/build-platforms.rst
> > > > > >> +++ b/docs/about/build-platforms.rst
> > > > > >> @@ -92,6 +92,16 @@ hosted on Linux (Debian/Fedora).
> > > > > >>   The version of the Windows API that's currently targeted is Vista / Server
> > > > > >>   2008.
> > > > > >>
> > > > > >> +Supported compilers
> > > > > >> +-------------------
> > > > > >> +
> > > > > >> +To compile, QEMU requires either:
> > > > > >> +
> > > > > >> +- GCC >= 7.4.0
> > > > > >> +- Clang >= 6.0
> > > > > >> +- XCode Clang >= 10.0
> > > > > >
> > > > > > Do we need to spell out the versions explicitly ? These versions are
> > > > > > all derived from what's available in the repos of the supported build
> > > > > > platforms, similar to any other build deps we have. I don't think we
> > > > > > want to start a precedent of duplicating versions in this doc for
> > > > > > build deps we have, and there's nothing particularly special about
> > > > > > compilers in this respect.
> > > > >
> > > > > I agree with Daniel - when I saw this patch, the first thought that I had
> > > > > was: "This will be getting out of sync quickly" ...
> > > >
> > > > I don't have the impression we bump our compiler requirement regularly
> > > > or lightly.
> > > >
> > > > > so I'd also recommend to rather not add this here.
> > > >
> > > > Outdated documentation is still better than no documentation. YMMV.
> > >
> > > Another question that is difficult to answer without being familiar
> > > with QEMU details is whether it can compile with MSVC. This
> > > documentation would, since it is explicit about the requirement.
> >
> > Documenting that we mandate GCC or Clang is reasonable. Ideally we could
> > have a list of all 3rd party deps we have in fact, I'm just not a fan of
> > copying the version numbers across from configure/meson.
> >
> 
> I agree, duplicating the version information is not optimal... Yet it
> is better than not having it, or having to read or run configure imho.
> 
> Sorry (or not) to insist, but it would help having an explicit list of
> supported compilers in the human doc (because configure/meson doesn't
> rule others out, afaik, nor it really can or should)

Perhaps I'm misunderstanding what you mean, but configure certainly
does rules out other compilers, giving a clear message:

if ! compile_prog "" "" ; then
    error_exit "You need at least GCC v7.4 or Clang v6.0 (or XCode Clang v10.0)"
fi

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 06/41] include: rename qemu-common.h qemu/copyright.h
  2022-04-20 15:04     ` [Virtio-fs] " Daniel P. Berrangé
@ 2022-04-20 16:10       ` Peter Maydell
  -1 siblings, 0 replies; 124+ messages in thread
From: Peter Maydell @ 2022-04-20 16:10 UTC (permalink / raw)
  To: Daniel P. Berrangé
  Cc: Kevin Wolf, Fam Zheng, Vladimir Sementsov-Ogievskiy,
	Stefan Hajnoczi, open list:Block layer core, Michael Roth,
	Kyle Evans, qemu-devel, Laurent Vivier, open list:virtiofs,
	Hanna Reitz, Gerd Hoffmann, Akihiko Odaki, Paolo Bonzini,
	marcandre.lureau, Eric Blake, Warner Losh,
	Dr. David Alan Gilbert, Philippe Mathieu-Daudé

On Wed, 20 Apr 2022 at 16:04, Daniel P. Berrangé <berrange@redhat.com> wrote:
>
> On Wed, Apr 20, 2022 at 05:25:49PM +0400, marcandre.lureau@redhat.com wrote:
> > From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> Could use a commit message explaining why this is a good
> idea.
>
> I see it contains QEMU_COPYRIGHT macro, but it also then
> contains QEMU_HELP_BOTTOM which is about bug reporting
> not copyright.
>
> IMHO something like 'qemu-cli.h' could be a better match

"-cli" is both too broad and also inaccurate, because we use
these macros in the GUI UI frontends too. It's "macros defining
strings for use in version/usage/help dialogs and output".
Maybe qemu/help-texts.h ?

-- PMM


^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [Virtio-fs] [PATCH 06/41] include: rename qemu-common.h qemu/copyright.h
@ 2022-04-20 16:10       ` Peter Maydell
  0 siblings, 0 replies; 124+ messages in thread
From: Peter Maydell @ 2022-04-20 16:10 UTC (permalink / raw)
  To: Daniel P. Berrangé
  Cc: marcandre.lureau, qemu-devel, Kevin Wolf, Fam Zheng,
	Vladimir Sementsov-Ogievskiy, Akihiko Odaki,
	open list:Block layer core, Kyle Evans, Laurent Vivier,
	Dr. David Alan Gilbert, open list:virtiofs, Hanna Reitz,
	Paolo Bonzini, Gerd Hoffmann, Stefan Hajnoczi, Michael Roth,
	Eric Blake, Warner Losh, Philippe Mathieu-Daudé

On Wed, 20 Apr 2022 at 16:04, Daniel P. Berrangé <berrange@redhat.com> wrote:
>
> On Wed, Apr 20, 2022 at 05:25:49PM +0400, marcandre.lureau@redhat.com wrote:
> > From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> Could use a commit message explaining why this is a good
> idea.
>
> I see it contains QEMU_COPYRIGHT macro, but it also then
> contains QEMU_HELP_BOTTOM which is about bug reporting
> not copyright.
>
> IMHO something like 'qemu-cli.h' could be a better match

"-cli" is both too broad and also inaccurate, because we use
these macros in the GUI UI frontends too. It's "macros defining
strings for use in version/usage/help dialogs and output".
Maybe qemu/help-texts.h ?

-- PMM


^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 17/41] doc/build-platforms: document supported compilers
  2022-04-20 15:32             ` Marc-André Lureau
  2022-04-20 15:55               ` Daniel P. Berrangé
@ 2022-04-20 16:11               ` Thomas Huth
  2022-04-20 16:52                 ` Marc-André Lureau
  1 sibling, 1 reply; 124+ messages in thread
From: Thomas Huth @ 2022-04-20 16:11 UTC (permalink / raw)
  To: Marc-André Lureau, Daniel P. Berrangé; +Cc: qemu-devel

On 20/04/2022 17.32, Marc-André Lureau wrote:
> Hi
> 
> On Wed, Apr 20, 2022 at 7:24 PM Daniel P. Berrangé <berrange@redhat.com> wrote:
>>
>> On Wed, Apr 20, 2022 at 06:50:12PM +0400, Marc-André Lureau wrote:
>>> Hi
>>>
>>> On Wed, Apr 20, 2022 at 6:46 PM Marc-André Lureau
>>> <marcandre.lureau@redhat.com> wrote:
>>>>
>>>> Hi
>>>>
>>>> On Wed, Apr 20, 2022 at 6:37 PM Thomas Huth <thuth@redhat.com> wrote:
>>>>>
>>>>> On 20/04/2022 16.10, Daniel P. Berrangé wrote:
>>>>>> On Wed, Apr 20, 2022 at 05:26:00PM +0400, marcandre.lureau@redhat.com wrote:
>>>>>>> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>>>>>>>
>>>>>>> According to our configure checks, this is the list of supported
>>>>>>> compilers.
>>>>>>>
>>>>>>> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
>>>>>>> Reviewed-by: Damien Hedde <damien.hedde@greensocs.com>
>>>>>>> ---
>>>>>>>    docs/about/build-platforms.rst | 10 ++++++++++
>>>>>>>    1 file changed, 10 insertions(+)
>>>>>>>
>>>>>>> diff --git a/docs/about/build-platforms.rst b/docs/about/build-platforms.rst
>>>>>>> index c29a4b8fe649..1980c5d2476f 100644
>>>>>>> --- a/docs/about/build-platforms.rst
>>>>>>> +++ b/docs/about/build-platforms.rst
>>>>>>> @@ -92,6 +92,16 @@ hosted on Linux (Debian/Fedora).
>>>>>>>    The version of the Windows API that's currently targeted is Vista / Server
>>>>>>>    2008.
>>>>>>>
>>>>>>> +Supported compilers
>>>>>>> +-------------------
>>>>>>> +
>>>>>>> +To compile, QEMU requires either:
>>>>>>> +
>>>>>>> +- GCC >= 7.4.0
>>>>>>> +- Clang >= 6.0
>>>>>>> +- XCode Clang >= 10.0
>>>>>>
>>>>>> Do we need to spell out the versions explicitly ? These versions are
>>>>>> all derived from what's available in the repos of the supported build
>>>>>> platforms, similar to any other build deps we have. I don't think we
>>>>>> want to start a precedent of duplicating versions in this doc for
>>>>>> build deps we have, and there's nothing particularly special about
>>>>>> compilers in this respect.
>>>>>
>>>>> I agree with Daniel - when I saw this patch, the first thought that I had
>>>>> was: "This will be getting out of sync quickly" ...
>>>>
>>>> I don't have the impression we bump our compiler requirement regularly
>>>> or lightly.
>>>>
>>>>> so I'd also recommend to rather not add this here.
>>>>
>>>> Outdated documentation is still better than no documentation. YMMV.
>>>
>>> Another question that is difficult to answer without being familiar
>>> with QEMU details is whether it can compile with MSVC. This
>>> documentation would, since it is explicit about the requirement.
>>
>> Documenting that we mandate GCC or Clang is reasonable. Ideally we could
>> have a list of all 3rd party deps we have in fact, I'm just not a fan of
>> copying the version numbers across from configure/meson.
>>
> 
> I agree, duplicating the version information is not optimal... Yet it
> is better than not having it, or having to read or run configure imho.

Well, no, it's better to have it in the configure script. Every user who 
wants to compile QEMU will run the configure script, but not necessarily 
read the documentation first.

> Sorry (or not) to insist, but it would help having an explicit list of
> supported compilers in the human doc

... and what about necessary libraries ... if you start with the compilers 
here, shouldn't we also list the necessary versions of glib, libfdt, pixman, 
etc. here? ... No, IMHO this really does not scale, you could maybe mention 
that GCC or Clang is necessary, and maybe that you need at least glib to 
compile QEMU, but listing the versions there is just duplicated information 
that will be ugly to maintain, without too much real benefit for the users 
(they already know whether their distro is supported or not), and way too 
much hassle for the developers.

  Thomas



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 06/41] include: rename qemu-common.h qemu/copyright.h
  2022-04-20 16:10       ` [Virtio-fs] " Peter Maydell
@ 2022-04-20 16:13         ` Daniel P. Berrangé
  -1 siblings, 0 replies; 124+ messages in thread
From: Daniel P. Berrangé @ 2022-04-20 16:13 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Kevin Wolf, Fam Zheng, Vladimir Sementsov-Ogievskiy,
	Stefan Hajnoczi, open list:Block layer core, Michael Roth,
	Kyle Evans, qemu-devel, Laurent Vivier, open list:virtiofs,
	Hanna Reitz, Gerd Hoffmann, Akihiko Odaki, Paolo Bonzini,
	marcandre.lureau, Eric Blake, Warner Losh,
	Dr. David Alan Gilbert, Philippe Mathieu-Daudé

On Wed, Apr 20, 2022 at 05:10:51PM +0100, Peter Maydell wrote:
> On Wed, 20 Apr 2022 at 16:04, Daniel P. Berrangé <berrange@redhat.com> wrote:
> >
> > On Wed, Apr 20, 2022 at 05:25:49PM +0400, marcandre.lureau@redhat.com wrote:
> > > From: Marc-André Lureau <marcandre.lureau@redhat.com>
> >
> > Could use a commit message explaining why this is a good
> > idea.
> >
> > I see it contains QEMU_COPYRIGHT macro, but it also then
> > contains QEMU_HELP_BOTTOM which is about bug reporting
> > not copyright.
> >
> > IMHO something like 'qemu-cli.h' could be a better match
> 
> "-cli" is both too broad and also inaccurate, because we use
> these macros in the GUI UI frontends too. It's "macros defining
> strings for use in version/usage/help dialogs and output".
> Maybe qemu/help-texts.h ?

I guess I tend to still view qemu-system-XXX as cli, despite the
possibility of a GUI, since you're passing 10's/100's of CLI
parameters regardless.

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [Virtio-fs] [PATCH 06/41] include: rename qemu-common.h qemu/copyright.h
@ 2022-04-20 16:13         ` Daniel P. Berrangé
  0 siblings, 0 replies; 124+ messages in thread
From: Daniel P. Berrangé @ 2022-04-20 16:13 UTC (permalink / raw)
  To: Peter Maydell
  Cc: marcandre.lureau, qemu-devel, Kevin Wolf, Fam Zheng,
	Vladimir Sementsov-Ogievskiy, Akihiko Odaki,
	open list:Block layer core, Kyle Evans, Laurent Vivier,
	Dr. David Alan Gilbert, open list:virtiofs, Hanna Reitz,
	Paolo Bonzini, Gerd Hoffmann, Stefan Hajnoczi, Michael Roth,
	Eric Blake, Warner Losh, Philippe Mathieu-Daudé

On Wed, Apr 20, 2022 at 05:10:51PM +0100, Peter Maydell wrote:
> On Wed, 20 Apr 2022 at 16:04, Daniel P. Berrangé <berrange@redhat.com> wrote:
> >
> > On Wed, Apr 20, 2022 at 05:25:49PM +0400, marcandre.lureau@redhat.com wrote:
> > > From: Marc-André Lureau <marcandre.lureau@redhat.com>
> >
> > Could use a commit message explaining why this is a good
> > idea.
> >
> > I see it contains QEMU_COPYRIGHT macro, but it also then
> > contains QEMU_HELP_BOTTOM which is about bug reporting
> > not copyright.
> >
> > IMHO something like 'qemu-cli.h' could be a better match
> 
> "-cli" is both too broad and also inaccurate, because we use
> these macros in the GUI UI frontends too. It's "macros defining
> strings for use in version/usage/help dialogs and output".
> Maybe qemu/help-texts.h ?

I guess I tend to still view qemu-system-XXX as cli, despite the
possibility of a GUI, since you're passing 10's/100's of CLI
parameters regardless.

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 08/41] build-sys: simplify MSI's QEMU_GA_MANUFACTURER
  2022-04-20 15:14     ` Daniel P. Berrangé
@ 2022-04-20 16:36       ` Paolo Bonzini
  0 siblings, 0 replies; 124+ messages in thread
From: Paolo Bonzini @ 2022-04-20 16:36 UTC (permalink / raw)
  To: Daniel P. Berrangé, Konstantin Kostiuk
  Cc: Marc-André Lureau, Yan Vugenfirer, QEMU, Michael Roth

On 4/20/22 17:14, Daniel P. Berrangé wrote:
> On Wed, Apr 20, 2022 at 04:48:54PM +0300, Konstantin Kostiuk wrote:
>> Hi Marc-André and Yan,
>>
>> Currently, we use this for the mingw-qemu-ga-win package in CentOS Stream 9
>> and RHEL.
>> https://gitlab.com/redhat/centos-stream/rpms/mingw-qemu-ga-win/-/blob/c9s/build_configure.sh
>>
>> Yan, do we need this feature or not?
> 
> IMHO the downstream customization makes sense, similar to how
> with RPMs we set Red Hat as the vendor.
> 
> We neeed  proper meson_options.txt entries and configure --with-qga-...=....
> options

Let's keep this one for a while more, I am going to add string option 
parsing to parse-buildoptions.py which simplifies things a bit.

Paolo

>> On Wed, Apr 20, 2022 at 4:27 PM <marcandre.lureau@redhat.com> wrote:
>>
>>> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>>>
>>> If there is any reason to allow customization of this variable, we
>>> should provide a proper configure option.
>>>
>>> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
>>> ---
>>>   configure                 |  4 ----
>>>   qga/installer/qemu-ga.wxs | 10 ++++------
>>>   qga/meson.build           |  1 -
>>>   3 files changed, 4 insertions(+), 11 deletions(-)
>>>
>>> diff --git a/configure b/configure
>>> index 8cbe55ac82e8..5ac653b21351 100755
>>> --- a/configure
>>> +++ b/configure
>>> @@ -2694,9 +2694,6 @@ fi
>>>
>>>   # Guest agent Windows MSI package
>>>
>>> -if test "$QEMU_GA_MANUFACTURER" = ""; then
>>> -  QEMU_GA_MANUFACTURER=QEMU
>>> -fi
>>>   if test "$QEMU_GA_DISTRO" = ""; then
>>>     QEMU_GA_DISTRO=Linux
>>>   fi
>>> @@ -2790,7 +2787,6 @@ if test "$debug_tcg" = "yes" ; then
>>>   fi
>>>   if test "$mingw32" = "yes" ; then
>>>     echo "CONFIG_WIN32=y" >> $config_host_mak
>>> -  echo "QEMU_GA_MANUFACTURER=${QEMU_GA_MANUFACTURER}" >> $config_host_mak
>>>     echo "QEMU_GA_DISTRO=${QEMU_GA_DISTRO}" >> $config_host_mak
>>>     echo "QEMU_GA_VERSION=${QEMU_GA_VERSION}" >> $config_host_mak
>>>   else
>>> diff --git a/qga/installer/qemu-ga.wxs b/qga/installer/qemu-ga.wxs
>>> index 0950e8c6becc..53d836c06a96 100644
>>> --- a/qga/installer/qemu-ga.wxs
>>> +++ b/qga/installer/qemu-ga.wxs
>>> @@ -8,9 +8,7 @@
>>>       <?error Environment variable QEMU_GA_DISTRO undefined?>
>>>     <?endif?>
>>>
>>> -  <?ifndef env.QEMU_GA_MANUFACTURER ?>
>>> -    <?error Environment variable QEMU_GA_MANUFACTURER undefined?>
>>> -  <?endif?>
>>> +  <?define QEMU_GA_MANUFACTURER = "QEMU" ?>
>>>
>>>     <?ifndef var.Arch?>
>>>       <?error Define Arch to 32 or 64?>
>>> @@ -43,14 +41,14 @@
>>>       Name="QEMU guest agent"
>>>       Id="*"
>>>       UpgradeCode="{EB6B8302-C06E-4BEC-ADAC-932C68A3A98D}"
>>> -    Manufacturer="$(env.QEMU_GA_MANUFACTURER)"
>>> +    Manufacturer="$(var.QEMU_GA_MANUFACTURER)"
>>>       Version="$(env.QEMU_GA_VERSION)"
>>>       Language="1033">
>>>       <?if $(var.Arch) = 32 ?>
>>>       <Condition Message="Error: 32-bit version of Qemu GA can not be
>>> installed on 64-bit Windows.">NOT VersionNT64</Condition>
>>>       <?endif?>
>>>       <Package
>>> -      Manufacturer="$(env.QEMU_GA_MANUFACTURER)"
>>> +      Manufacturer="$(var.QEMU_GA_MANUFACTURER)"
>>>         InstallerVersion="200"
>>>         Languages="1033"
>>>         Compressed="yes"
>>> @@ -133,7 +131,7 @@
>>>             </Component>
>>>             <Component Id="registry_entries"
>>> Guid="{D075D109-51CA-11E3-9F8B-000C29858960}">
>>>               <RegistryKey Root="HKLM"
>>> -
>>>   Key="Software\$(env.QEMU_GA_MANUFACTURER)\$(env.QEMU_GA_DISTRO)\Tools\QemuGA">
>>> +
>>>   Key="Software\$(var.QEMU_GA_MANUFACTURER)\$(env.QEMU_GA_DISTRO)\Tools\QemuGA">
>>>                 <RegistryValue Type="string" Name="ProductID"
>>> Value="fb0a0d66-c7fb-4e2e-a16b-c4a3bfe8d13b" />
>>>                 <RegistryValue Type="string" Name="Version"
>>> Value="$(env.QEMU_GA_VERSION)" />
>>>               </RegistryKey>
>>> diff --git a/qga/meson.build b/qga/meson.build
>>> index da5e5efb19e8..6e57de430d29 100644
>>> --- a/qga/meson.build
>>> +++ b/qga/meson.build
>>> @@ -123,7 +123,6 @@ if targetos == 'windows'
>>>                               command: [
>>>                                 find_program('env'),
>>>                                 'QEMU_GA_VERSION=' +
>>> config_host['QEMU_GA_VERSION'],
>>> -                              'QEMU_GA_MANUFACTURER=' +
>>> config_host['QEMU_GA_MANUFACTURER'],
>>>                                 'QEMU_GA_DISTRO=' +
>>> config_host['QEMU_GA_DISTRO'],
>>>                                 'BUILD_DIR=' + meson.build_root(),
>>>                                 wixl, '-o', '@OUTPUT0@', '@INPUT0@',
>>> --
>>> 2.35.1.693.g805e0a68082a
>>>
>>>
> 
> With regards,
> Daniel



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 17/41] doc/build-platforms: document supported compilers
  2022-04-20 15:55               ` Daniel P. Berrangé
@ 2022-04-20 16:47                 ` Marc-André Lureau
  2022-04-20 18:53                   ` Daniel P. Berrangé
  0 siblings, 1 reply; 124+ messages in thread
From: Marc-André Lureau @ 2022-04-20 16:47 UTC (permalink / raw)
  To: Daniel P. Berrangé; +Cc: Thomas Huth, qemu-devel

Hi

On Wed, Apr 20, 2022 at 7:55 PM Daniel P. Berrangé <berrange@redhat.com> wrote:
>
> On Wed, Apr 20, 2022 at 07:32:38PM +0400, Marc-André Lureau wrote:
> > Hi
> >
> > On Wed, Apr 20, 2022 at 7:24 PM Daniel P. Berrangé <berrange@redhat.com> wrote:
> > >
> > > On Wed, Apr 20, 2022 at 06:50:12PM +0400, Marc-André Lureau wrote:
> > > > Hi
> > > >
> > > > On Wed, Apr 20, 2022 at 6:46 PM Marc-André Lureau
> > > > <marcandre.lureau@redhat.com> wrote:
> > > > >
> > > > > Hi
> > > > >
> > > > > On Wed, Apr 20, 2022 at 6:37 PM Thomas Huth <thuth@redhat.com> wrote:
> > > > > >
> > > > > > On 20/04/2022 16.10, Daniel P. Berrangé wrote:
> > > > > > > On Wed, Apr 20, 2022 at 05:26:00PM +0400, marcandre.lureau@redhat.com wrote:
> > > > > > >> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> > > > > > >>
> > > > > > >> According to our configure checks, this is the list of supported
> > > > > > >> compilers.
> > > > > > >>
> > > > > > >> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> > > > > > >> Reviewed-by: Damien Hedde <damien.hedde@greensocs.com>
> > > > > > >> ---
> > > > > > >>   docs/about/build-platforms.rst | 10 ++++++++++
> > > > > > >>   1 file changed, 10 insertions(+)
> > > > > > >>
> > > > > > >> diff --git a/docs/about/build-platforms.rst b/docs/about/build-platforms.rst
> > > > > > >> index c29a4b8fe649..1980c5d2476f 100644
> > > > > > >> --- a/docs/about/build-platforms.rst
> > > > > > >> +++ b/docs/about/build-platforms.rst
> > > > > > >> @@ -92,6 +92,16 @@ hosted on Linux (Debian/Fedora).
> > > > > > >>   The version of the Windows API that's currently targeted is Vista / Server
> > > > > > >>   2008.
> > > > > > >>
> > > > > > >> +Supported compilers
> > > > > > >> +-------------------
> > > > > > >> +
> > > > > > >> +To compile, QEMU requires either:
> > > > > > >> +
> > > > > > >> +- GCC >= 7.4.0
> > > > > > >> +- Clang >= 6.0
> > > > > > >> +- XCode Clang >= 10.0
> > > > > > >
> > > > > > > Do we need to spell out the versions explicitly ? These versions are
> > > > > > > all derived from what's available in the repos of the supported build
> > > > > > > platforms, similar to any other build deps we have. I don't think we
> > > > > > > want to start a precedent of duplicating versions in this doc for
> > > > > > > build deps we have, and there's nothing particularly special about
> > > > > > > compilers in this respect.
> > > > > >
> > > > > > I agree with Daniel - when I saw this patch, the first thought that I had
> > > > > > was: "This will be getting out of sync quickly" ...
> > > > >
> > > > > I don't have the impression we bump our compiler requirement regularly
> > > > > or lightly.
> > > > >
> > > > > > so I'd also recommend to rather not add this here.
> > > > >
> > > > > Outdated documentation is still better than no documentation. YMMV.
> > > >
> > > > Another question that is difficult to answer without being familiar
> > > > with QEMU details is whether it can compile with MSVC. This
> > > > documentation would, since it is explicit about the requirement.
> > >
> > > Documenting that we mandate GCC or Clang is reasonable. Ideally we could
> > > have a list of all 3rd party deps we have in fact, I'm just not a fan of
> > > copying the version numbers across from configure/meson.
> > >
> >
> > I agree, duplicating the version information is not optimal... Yet it
> > is better than not having it, or having to read or run configure imho.
> >
> > Sorry (or not) to insist, but it would help having an explicit list of
> > supported compilers in the human doc (because configure/meson doesn't
> > rule others out, afaik, nor it really can or should)
>
> Perhaps I'm misunderstanding what you mean, but configure certainly
> does rules out other compilers, giving a clear message:
>
> if ! compile_prog "" "" ; then
>     error_exit "You need at least GCC v7.4 or Clang v6.0 (or XCode Clang v10.0)"
> fi
>

How can this test fail with other compilers?

> With regards,
> Daniel
> --
> |: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
> |: https://libvirt.org         -o-            https://fstop138.berrange.com :|
> |: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
>



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 17/41] doc/build-platforms: document supported compilers
  2022-04-20 16:11               ` Thomas Huth
@ 2022-04-20 16:52                 ` Marc-André Lureau
  0 siblings, 0 replies; 124+ messages in thread
From: Marc-André Lureau @ 2022-04-20 16:52 UTC (permalink / raw)
  To: Thomas Huth; +Cc: Daniel P. Berrangé, qemu-devel

Hi

On Wed, Apr 20, 2022 at 8:11 PM Thomas Huth <thuth@redhat.com> wrote:
>
> On 20/04/2022 17.32, Marc-André Lureau wrote:
> > Hi
> >
> > On Wed, Apr 20, 2022 at 7:24 PM Daniel P. Berrangé <berrange@redhat.com> wrote:
> >>
> >> On Wed, Apr 20, 2022 at 06:50:12PM +0400, Marc-André Lureau wrote:
> >>> Hi
> >>>
> >>> On Wed, Apr 20, 2022 at 6:46 PM Marc-André Lureau
> >>> <marcandre.lureau@redhat.com> wrote:
> >>>>
> >>>> Hi
> >>>>
> >>>> On Wed, Apr 20, 2022 at 6:37 PM Thomas Huth <thuth@redhat.com> wrote:
> >>>>>
> >>>>> On 20/04/2022 16.10, Daniel P. Berrangé wrote:
> >>>>>> On Wed, Apr 20, 2022 at 05:26:00PM +0400, marcandre.lureau@redhat.com wrote:
> >>>>>>> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> >>>>>>>
> >>>>>>> According to our configure checks, this is the list of supported
> >>>>>>> compilers.
> >>>>>>>
> >>>>>>> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> >>>>>>> Reviewed-by: Damien Hedde <damien.hedde@greensocs.com>
> >>>>>>> ---
> >>>>>>>    docs/about/build-platforms.rst | 10 ++++++++++
> >>>>>>>    1 file changed, 10 insertions(+)
> >>>>>>>
> >>>>>>> diff --git a/docs/about/build-platforms.rst b/docs/about/build-platforms.rst
> >>>>>>> index c29a4b8fe649..1980c5d2476f 100644
> >>>>>>> --- a/docs/about/build-platforms.rst
> >>>>>>> +++ b/docs/about/build-platforms.rst
> >>>>>>> @@ -92,6 +92,16 @@ hosted on Linux (Debian/Fedora).
> >>>>>>>    The version of the Windows API that's currently targeted is Vista / Server
> >>>>>>>    2008.
> >>>>>>>
> >>>>>>> +Supported compilers
> >>>>>>> +-------------------
> >>>>>>> +
> >>>>>>> +To compile, QEMU requires either:
> >>>>>>> +
> >>>>>>> +- GCC >= 7.4.0
> >>>>>>> +- Clang >= 6.0
> >>>>>>> +- XCode Clang >= 10.0
> >>>>>>
> >>>>>> Do we need to spell out the versions explicitly ? These versions are
> >>>>>> all derived from what's available in the repos of the supported build
> >>>>>> platforms, similar to any other build deps we have. I don't think we
> >>>>>> want to start a precedent of duplicating versions in this doc for
> >>>>>> build deps we have, and there's nothing particularly special about
> >>>>>> compilers in this respect.
> >>>>>
> >>>>> I agree with Daniel - when I saw this patch, the first thought that I had
> >>>>> was: "This will be getting out of sync quickly" ...
> >>>>
> >>>> I don't have the impression we bump our compiler requirement regularly
> >>>> or lightly.
> >>>>
> >>>>> so I'd also recommend to rather not add this here.
> >>>>
> >>>> Outdated documentation is still better than no documentation. YMMV.
> >>>
> >>> Another question that is difficult to answer without being familiar
> >>> with QEMU details is whether it can compile with MSVC. This
> >>> documentation would, since it is explicit about the requirement.
> >>
> >> Documenting that we mandate GCC or Clang is reasonable. Ideally we could
> >> have a list of all 3rd party deps we have in fact, I'm just not a fan of
> >> copying the version numbers across from configure/meson.
> >>
> >
> > I agree, duplicating the version information is not optimal... Yet it
> > is better than not having it, or having to read or run configure imho.
>
> Well, no, it's better to have it in the configure script. Every user who
> wants to compile QEMU will run the configure script, but not necessarily
> read the documentation first.

Iirc, I came up with this question because I was modifying some header
(something in compiler.h or atomic.h). My initial reaction was not to
run configure. It would not help answer the question...

>
> > Sorry (or not) to insist, but it would help having an explicit list of
> > supported compilers in the human doc
>
> ... and what about necessary libraries ... if you start with the compilers
> here, shouldn't we also list the necessary versions of glib, libfdt, pixman,
> etc. here? ... No, IMHO this really does not scale, you could maybe mention
> that GCC or Clang is necessary, and maybe that you need at least glib to
> compile QEMU, but listing the versions there is just duplicated information
> that will be ugly to maintain, without too much real benefit for the users
> (they already know whether their distro is supported or not), and way too
> much hassle for the developers.
>

The compilers are (mostly) interchangeable, it's not the case for the
dependencies. But it would be nice to document our strict requirements
imho.



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 17/41] doc/build-platforms: document supported compilers
  2022-04-20 16:47                 ` Marc-André Lureau
@ 2022-04-20 18:53                   ` Daniel P. Berrangé
  0 siblings, 0 replies; 124+ messages in thread
From: Daniel P. Berrangé @ 2022-04-20 18:53 UTC (permalink / raw)
  To: Marc-André Lureau; +Cc: Thomas Huth, qemu-devel

On Wed, Apr 20, 2022 at 08:47:25PM +0400, Marc-André Lureau wrote:
> Hi
> 
> On Wed, Apr 20, 2022 at 7:55 PM Daniel P. Berrangé <berrange@redhat.com> wrote:
> >
> > On Wed, Apr 20, 2022 at 07:32:38PM +0400, Marc-André Lureau wrote:
> > > Hi
> > >
> > > On Wed, Apr 20, 2022 at 7:24 PM Daniel P. Berrangé <berrange@redhat.com> wrote:
> > > >
> > > > On Wed, Apr 20, 2022 at 06:50:12PM +0400, Marc-André Lureau wrote:
> > > > > Hi
> > > > >
> > > > > On Wed, Apr 20, 2022 at 6:46 PM Marc-André Lureau
> > > > > <marcandre.lureau@redhat.com> wrote:
> > > > > >
> > > > > > Hi
> > > > > >
> > > > > > On Wed, Apr 20, 2022 at 6:37 PM Thomas Huth <thuth@redhat.com> wrote:
> > > > > > >
> > > > > > > On 20/04/2022 16.10, Daniel P. Berrangé wrote:
> > > > > > > > On Wed, Apr 20, 2022 at 05:26:00PM +0400, marcandre.lureau@redhat.com wrote:
> > > > > > > >> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> > > > > > > >>
> > > > > > > >> According to our configure checks, this is the list of supported
> > > > > > > >> compilers.
> > > > > > > >>
> > > > > > > >> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> > > > > > > >> Reviewed-by: Damien Hedde <damien.hedde@greensocs.com>
> > > > > > > >> ---
> > > > > > > >>   docs/about/build-platforms.rst | 10 ++++++++++
> > > > > > > >>   1 file changed, 10 insertions(+)
> > > > > > > >>
> > > > > > > >> diff --git a/docs/about/build-platforms.rst b/docs/about/build-platforms.rst
> > > > > > > >> index c29a4b8fe649..1980c5d2476f 100644
> > > > > > > >> --- a/docs/about/build-platforms.rst
> > > > > > > >> +++ b/docs/about/build-platforms.rst
> > > > > > > >> @@ -92,6 +92,16 @@ hosted on Linux (Debian/Fedora).
> > > > > > > >>   The version of the Windows API that's currently targeted is Vista / Server
> > > > > > > >>   2008.
> > > > > > > >>
> > > > > > > >> +Supported compilers
> > > > > > > >> +-------------------
> > > > > > > >> +
> > > > > > > >> +To compile, QEMU requires either:
> > > > > > > >> +
> > > > > > > >> +- GCC >= 7.4.0
> > > > > > > >> +- Clang >= 6.0
> > > > > > > >> +- XCode Clang >= 10.0
> > > > > > > >
> > > > > > > > Do we need to spell out the versions explicitly ? These versions are
> > > > > > > > all derived from what's available in the repos of the supported build
> > > > > > > > platforms, similar to any other build deps we have. I don't think we
> > > > > > > > want to start a precedent of duplicating versions in this doc for
> > > > > > > > build deps we have, and there's nothing particularly special about
> > > > > > > > compilers in this respect.
> > > > > > >
> > > > > > > I agree with Daniel - when I saw this patch, the first thought that I had
> > > > > > > was: "This will be getting out of sync quickly" ...
> > > > > >
> > > > > > I don't have the impression we bump our compiler requirement regularly
> > > > > > or lightly.
> > > > > >
> > > > > > > so I'd also recommend to rather not add this here.
> > > > > >
> > > > > > Outdated documentation is still better than no documentation. YMMV.
> > > > >
> > > > > Another question that is difficult to answer without being familiar
> > > > > with QEMU details is whether it can compile with MSVC. This
> > > > > documentation would, since it is explicit about the requirement.
> > > >
> > > > Documenting that we mandate GCC or Clang is reasonable. Ideally we could
> > > > have a list of all 3rd party deps we have in fact, I'm just not a fan of
> > > > copying the version numbers across from configure/meson.
> > > >
> > >
> > > I agree, duplicating the version information is not optimal... Yet it
> > > is better than not having it, or having to read or run configure imho.
> > >
> > > Sorry (or not) to insist, but it would help having an explicit list of
> > > supported compilers in the human doc (because configure/meson doesn't
> > > rule others out, afaik, nor it really can or should)
> >
> > Perhaps I'm misunderstanding what you mean, but configure certainly
> > does rules out other compilers, giving a clear message:
> >
> > if ! compile_prog "" "" ; then
> >     error_exit "You need at least GCC v7.4 or Clang v6.0 (or XCode Clang v10.0)"
> > fi
> >
> 
> How can this test fail with other compilers?

This is just the error reporting, look at the code above it for the
full compiler check....

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 29/41] tests: run-time skip test-qga if TSAN is enabled
  2022-04-20 15:41   ` Daniel P. Berrangé
@ 2022-04-21 13:02     ` Marc-André Lureau
  0 siblings, 0 replies; 124+ messages in thread
From: Marc-André Lureau @ 2022-04-21 13:02 UTC (permalink / raw)
  To: Daniel P. Berrangé; +Cc: Michael Roth, QEMU

[-- Attachment #1: Type: text/plain, Size: 1042 bytes --]

Hi

On Wed, Apr 20, 2022 at 8:24 PM Daniel P. Berrangé <berrange@redhat.com>
wrote:

> On Wed, Apr 20, 2022 at 05:26:12PM +0400, marcandre.lureau@redhat.com
> wrote:
> > From: Marc-André Lureau <marcandre.lureau@redhat.com>
> >
> > This allows to make sure the test is still built, and gives more
> > accurate report details.
> >
> > Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> > ---
> >  tests/unit/test-qga.c  | 7 +++++++
> >  tests/unit/meson.build | 2 +-
> >  2 files changed, 8 insertions(+), 1 deletion(-)
>
> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
>

Can you review "[PATCH 26/41] compiler.h: add
QEMU_SANITIZE_{ADDRESS,THREAD}", it depends on it.

thanks


>
> With regards,
> Daniel
> --
> |: https://berrange.com      -o-
> https://www.flickr.com/photos/dberrange :|
> |: https://libvirt.org         -o-
> https://fstop138.berrange.com :|
> |: https://entangle-photo.org    -o-
> https://www.instagram.com/dberrange :|
>
>
>

-- 
Marc-André Lureau

[-- Attachment #2: Type: text/html, Size: 2522 bytes --]

^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 32/41] qtest: simplify socket_send()
  2022-04-20 15:45   ` Daniel P. Berrangé
@ 2022-04-21 13:07     ` Marc-André Lureau
  0 siblings, 0 replies; 124+ messages in thread
From: Marc-André Lureau @ 2022-04-21 13:07 UTC (permalink / raw)
  To: Daniel P. Berrangé; +Cc: Laurent Vivier, Paolo Bonzini, Thomas Huth, QEMU

[-- Attachment #1: Type: text/plain, Size: 1530 bytes --]

Hi

On Wed, Apr 20, 2022 at 8:20 PM Daniel P. Berrangé <berrange@redhat.com>
wrote:

> On Wed, Apr 20, 2022 at 05:26:15PM +0400, marcandre.lureau@redhat.com
> wrote:
> > From: Marc-André Lureau <marcandre.lureau@redhat.com>
> >
> > Reuse qemu_write_full().
> >
> > Signed-off-by: Marc-André Lureau <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)
> >
> >  static void socket_send(int fd, const char *buf, size_t size)
> >  {
> > -    size_t offset;
> > -
> > -    offset = 0;
> > -    while (offset < size) {
> > -        ssize_t len;
> > +    size_t res = qemu_write_full(fd, buf, size);
> >
> > -        len = write(fd, buf + offset, size - offset);
> > -        if (len == -1 && errno == EINTR) {
> > -            continue;
> > -        }
> > -
> > -        g_assert_cmpint(len, >, 0);
> > -
> > -        offset += len;
> > -    }
> > +    assert(res == size);
> >  }
>
> IMHO socket_send should jsut be deleted, with the few callers
> directly using qemu_write_full
>

It's not a big deal, it's an internal helper. There is an additional
assert() there, and the socket_send_fds() pair. I'll leave it for now.

thanks

-- 
Marc-André Lureau

[-- Attachment #2: Type: text/html, Size: 2403 bytes --]

^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 26/41] compiler.h: add QEMU_SANITIZE_{ADDRESS,THREAD}
  2022-04-20 13:26 ` [PATCH 26/41] compiler.h: add QEMU_SANITIZE_{ADDRESS,THREAD} marcandre.lureau
@ 2022-04-21 13:34   ` Daniel P. Berrangé
  0 siblings, 0 replies; 124+ messages in thread
From: Daniel P. Berrangé @ 2022-04-21 13:34 UTC (permalink / raw)
  To: marcandre.lureau; +Cc: qemu-devel

On Wed, Apr 20, 2022 at 05:26:09PM +0400, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> 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é Lureau <marcandre.lureau@redhat.com>
> ---
>  include/qemu/compiler.h | 8 ++++++++
>  1 file changed, 8 insertions(+)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 27/41] Use QEMU_SANITIZE_THREAD
  2022-04-20 13:26 ` [PATCH 27/41] Use QEMU_SANITIZE_THREAD marcandre.lureau
@ 2022-04-21 13:43   ` Daniel P. Berrangé
  0 siblings, 0 replies; 124+ messages in thread
From: Daniel P. Berrangé @ 2022-04-21 13:43 UTC (permalink / raw)
  To: marcandre.lureau; +Cc: qemu-devel

On Wed, Apr 20, 2022 at 05:26:10PM +0400, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  include/qemu/atomic.h                        | 8 +++++---
>  subprojects/libvhost-user/include/compiler.h | 1 +
>  2 files changed, 6 insertions(+), 3 deletions(-)
>  create mode 120000 subprojects/libvhost-user/include/compiler.h

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 19/41] compiler.h: replace QEMU_NORETURN with G_NORETURN
  2022-04-20 13:26   ` marcandre.lureau
                     ` (2 preceding siblings ...)
  (?)
@ 2023-04-07 17:01   ` Stefan Weil via
  2023-04-07 17:15     ` Stefan Weil via
  -1 siblings, 1 reply; 124+ messages in thread
From: Stefan Weil via @ 2023-04-07 17:01 UTC (permalink / raw)
  To: qemu-devel

Please excuse the late report, but this old patch causes a build failure 
for me:

Am 20.04.22 um 15:26 schrieb marcandre.lureau@redhat.com:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> 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é Lureau <marcandre.lureau@redhat.com>
> ---
[...]
> 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()

The placement of G_NORETURN causes a compiler error for C++ code in 
cross builds for Windows (see below). C++ expects the attribute 
[[noreturn]] before the extern statement.

I updated my Debian build environment to Debian bookworm and a recent 
cross glib, so maybe the problem was hidden in previous builds because I 
used a rather old glib or an older g++ cross compiler.

Regards,
Stefan


In file included from /mingw64/lib/glib-2.0/include/glibconfig.h:9,
                  from /mingw64/include/glib-2.0/glib/gtypes.h:34,
                  from /mingw64/include/glib-2.0/glib/galloca.h:34,
                  from /mingw64/include/glib-2.0/glib.h:32,
                  from 
/home/stefan/src/qemu/repo.or.cz/qemu/ar7/include/glib-compat.h:32,
                  from 
/home/stefan/src/qemu/repo.or.cz/qemu/ar7/include/qemu/osdep.h:144,
                  from ../../../qga/vss-win32/requester.cpp:13:
/mingw64/include/glib-2.0/glib/gmacros.h:1076:21: error: standard 
attributes in middle of decl-specifiers
  1076 | # define G_NORETURN [[noreturn]]
       |                     ^
/home/stefan/src/qemu/repo.or.cz/qemu/ar7/include/qemu/osdep.h:240:8: 
note: in expansion of macro ‘G_NORETURN’
   240 | extern G_NORETURN
       |        ^~~~~~~~~~
/mingw64/include/glib-2.0/glib/gmacros.h:1076:21: note: standard 
attributes must precede the decl-specifiers to apply to the declaration, 
or follow them to apply to the type
  1076 | # define G_NORETURN [[noreturn]]
       |                     ^
/home/stefan/src/qemu/repo.or.cz/qemu/ar7/include/qemu/osdep.h:240:8: 
note: in expansion of macro ‘G_NORETURN’
   240 | extern G_NORETURN
       |        ^~~~~~~~~~
/mingw64/include/glib-2.0/glib/gmacros.h:1076:21: warning: attribute 
ignored [-Wattributes]
  1076 | # define G_NORETURN [[noreturn]]
       |                     ^
/home/stefan/src/qemu/repo.or.cz/qemu/ar7/include/qemu/osdep.h:240:8: 
note: in expansion of macro ‘G_NORETURN’
   240 | extern G_NORETURN
       |        ^~~~~~~~~~
/mingw64/include/glib-2.0/glib/gmacros.h:1076:21: note: an attribute 
that appertains to a type-specifier is ignored
  1076 | # define G_NORETURN [[noreturn]]
       |                     ^
/home/stefan/src/qemu/repo.or.cz/qemu/ar7/include/qemu/osdep.h:240:8: 
note: in expansion of macro ‘G_NORETURN’
   240 | extern G_NORETURN
       |        ^~~~~~~~~~
../../../qga/vss-win32/requester.cpp: In function ‘HRESULT 
requester_init()’:
../../../qga/vss-win32/requester.cpp:72:34: warning: cast between 
incompatible function types from ‘FARPROC’ {aka ‘long long int (*)()’} 
to ‘t_CreateVssBackupComponents’ {aka ‘long int 
(*)(IVssBackupComponents**)’} [-Wcast-function-type]
    72 |     pCreateVssBackupComponents = (t_CreateVssBackupComponents)
       |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    73 |         GetProcAddress(hLib,
       |         ~~~~~~~~~~~~~~~~~~~~
    74 | #ifdef _WIN64 /* 64bit environment */
       | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    75 | 
"?CreateVssBackupComponents@@YAJPEAPEAVIVssBackupComponents@@@Z"
       | 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    76 | #else /* 32bit environment */
       | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    77 | 
"?CreateVssBackupComponents@@YGJPAPAVIVssBackupComponents@@@Z"
       | 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    78 | #endif
       | ~~~~~~
    79 |         );
       |         ~
../../../qga/vss-win32/requester.cpp:85:34: warning: cast between 
incompatible function types from ‘FARPROC’ {aka ‘long long int (*)()’} 
to ‘t_VssFreeSnapshotProperties’ {aka ‘void (*)(VSS_SNAPSHOT_PROP*)’} 
[-Wcast-function-type]
    85 |     pVssFreeSnapshotProperties = (t_VssFreeSnapshotProperties)
       |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    86 |         GetProcAddress(hLib, "VssFreeSnapshotProperties");
       |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ninja: build stopped: subcommand failed.


^ permalink raw reply	[flat|nested] 124+ messages in thread

* Re: [PATCH 19/41] compiler.h: replace QEMU_NORETURN with G_NORETURN
  2023-04-07 17:01   ` Stefan Weil via
@ 2023-04-07 17:15     ` Stefan Weil via
  0 siblings, 0 replies; 124+ messages in thread
From: Stefan Weil via @ 2023-04-07 17:15 UTC (permalink / raw)
  To: qemu-devel

Am 07.04.23 um 19:01 schrieb Stefan Weil:
> Please excuse the late report, but this old patch causes a build failure 
> for me:

I just noticed that this is already fixed in latest code (I tested the 
build with v8.0.0-rc0). So nothing to do. Sorry for the noise.

Stefan



^ permalink raw reply	[flat|nested] 124+ messages in thread

end of thread, other threads:[~2023-04-07 17:16 UTC | newest]

Thread overview: 124+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-20 13:25 [PATCH 00/41] Misc cleanups marcandre.lureau
2022-04-20 13:25 ` [PATCH 01/41] qga: use fixed-length for usecs formatting marcandre.lureau
2022-04-20 14:26   ` Daniel P. Berrangé
2022-04-20 13:25 ` [PATCH 02/41] glib-compat: isolate g_date_time_format_iso8601 version-bypass marcandre.lureau
2022-04-20 14:32   ` Daniel P. Berrangé
2022-04-20 13:25 ` [PATCH 03/41] scripts/analyze-inclusions: drop qemu-common.h from analysis marcandre.lureau
2022-04-20 14:32   ` Daniel P. Berrangé
2022-04-20 13:25 ` [PATCH 04/41] Simplify softmmu/main.c marcandre.lureau
2022-04-20 14:55   ` Daniel P. Berrangé
2022-04-20 13:25 ` [PATCH 05/41] hw/hyperv: remove needless qemu-common.h include marcandre.lureau
2022-04-20 15:01   ` Daniel P. Berrangé
2022-04-20 13:25 ` [PATCH 06/41] include: rename qemu-common.h qemu/copyright.h marcandre.lureau
2022-04-20 13:25   ` [Virtio-fs] " marcandre.lureau
2022-04-20 14:23   ` Warner Losh
2022-04-20 14:23     ` [Virtio-fs] " Warner Losh
2022-04-20 15:04   ` Daniel P. Berrangé
2022-04-20 15:04     ` [Virtio-fs] " Daniel P. Berrangé
2022-04-20 15:21     ` Marc-André Lureau
2022-04-20 15:21       ` [Virtio-fs] " Marc-André Lureau
2022-04-20 16:10     ` Peter Maydell
2022-04-20 16:10       ` [Virtio-fs] " Peter Maydell
2022-04-20 16:13       ` Daniel P. Berrangé
2022-04-20 16:13         ` [Virtio-fs] " Daniel P. Berrangé
2022-04-20 13:25 ` [PATCH 07/41] build-sys: remove MSI's QEMU_GA_MSI_MINGW_DLL_PATH marcandre.lureau
2022-04-20 15:00   ` Konstantin Kostiuk
2022-04-20 15:10   ` Daniel P. Berrangé
2022-04-20 15:12   ` Paolo Bonzini
2022-04-20 13:25 ` [PATCH 08/41] build-sys: simplify MSI's QEMU_GA_MANUFACTURER marcandre.lureau
2022-04-20 13:48   ` Konstantin Kostiuk
2022-04-20 15:14     ` Daniel P. Berrangé
2022-04-20 16:36       ` Paolo Bonzini
2022-04-20 13:25 ` [PATCH 09/41] build-sys: simplify MSI's QEMU_GA_VERSION marcandre.lureau
2022-04-20 13:25 ` [PATCH 10/41] build-sys: drop MSI's QEMU_GA_DISTRO marcandre.lureau
2022-04-20 13:25 ` [PATCH 11/41] qga: replace usleep() with g_usleep() marcandre.lureau
2022-04-20 15:16   ` Daniel P. Berrangé
2022-04-20 13:25 ` [PATCH 12/41] docs: trace-events-all is installed without renaming marcandre.lureau
2022-04-20 15:16   ` Daniel P. Berrangé
2022-04-20 13:25 ` [PATCH 13/41] arm/digic: replace snprintf() with g_strdup_printf() marcandre.lureau
2022-04-20 15:17   ` Daniel P. Berrangé
2022-04-20 13:25 ` [PATCH 14/41] arm/allwinner-a10: " marcandre.lureau
2022-04-20 15:17   ` Daniel P. Berrangé
2022-04-20 13:25 ` [PATCH 15/41] intc/exynos4210_gic: " marcandre.lureau
2022-04-20 15:19   ` Daniel P. Berrangé
2022-04-20 13:25 ` [PATCH 16/41] doc/style: CLang -> Clang marcandre.lureau
2022-04-20 15:20   ` Daniel P. Berrangé
2022-04-20 13:26 ` [PATCH 17/41] doc/build-platforms: document supported compilers marcandre.lureau
2022-04-20 14:10   ` Daniel P. Berrangé
2022-04-20 14:32     ` Marc-André Lureau
2022-04-20 14:36     ` Thomas Huth
2022-04-20 14:46       ` Marc-André Lureau
2022-04-20 14:50         ` Marc-André Lureau
2022-04-20 15:24           ` Daniel P. Berrangé
2022-04-20 15:32             ` Marc-André Lureau
2022-04-20 15:55               ` Daniel P. Berrangé
2022-04-20 16:47                 ` Marc-André Lureau
2022-04-20 18:53                   ` Daniel P. Berrangé
2022-04-20 16:11               ` Thomas Huth
2022-04-20 16:52                 ` Marc-André Lureau
2022-04-20 14:53         ` Thomas Huth
2022-04-20 14:57           ` Marc-André Lureau
2022-04-20 13:26 ` [PATCH 18/41] osdep.h: move qemu_build_not_reached() marcandre.lureau
2022-04-20 15:27   ` Daniel P. Berrangé
2022-04-20 13:26 ` [PATCH 19/41] compiler.h: replace QEMU_NORETURN with G_NORETURN marcandre.lureau
2022-04-20 13:26   ` marcandre.lureau
2022-04-20 14:24   ` Warner Losh
2022-04-20 14:24     ` Warner Losh
2022-04-20 15:29   ` Daniel P. Berrangé
2022-04-20 15:29     ` Daniel P. Berrangé
2023-04-07 17:01   ` Stefan Weil via
2023-04-07 17:15     ` Stefan Weil via
2022-04-20 13:26 ` [PATCH 20/41] include: move qemu_msync() to osdep marcandre.lureau
2022-04-20 15:33   ` Daniel P. Berrangé
2022-04-20 15:39     ` Marc-André Lureau
2022-04-20 13:26 ` [PATCH 21/41] include: move qemu_fdatasync() " marcandre.lureau
2022-04-20 15:34   ` Daniel P. Berrangé
2022-04-20 13:26 ` [PATCH 22/41] include: move qemu_*_exec_dir() to cutils marcandre.lureau
2022-04-20 15:36   ` Daniel P. Berrangé
2022-04-20 13:26 ` [PATCH 23/41] include: add qemu/keyval.h marcandre.lureau
2022-04-20 15:38   ` Daniel P. Berrangé
2022-04-20 13:26 ` [PATCH 24/41] include: move qdict_{crumple,flatten} declarations marcandre.lureau
2022-04-20 15:39   ` Daniel P. Berrangé
2022-04-20 13:26 ` [PATCH 25/41] tests: remove block/qdict checks from check-qobject.c marcandre.lureau
2022-04-20 15:39   ` Daniel P. Berrangé
2022-04-20 13:26 ` [PATCH 26/41] compiler.h: add QEMU_SANITIZE_{ADDRESS,THREAD} marcandre.lureau
2022-04-21 13:34   ` Daniel P. Berrangé
2022-04-20 13:26 ` [PATCH 27/41] Use QEMU_SANITIZE_THREAD marcandre.lureau
2022-04-21 13:43   ` Daniel P. Berrangé
2022-04-20 13:26 ` [PATCH 28/41] Use QEMU_SANITIZE_ADDRESS marcandre.lureau
2022-04-20 14:20   ` Thomas Huth
2022-04-20 14:35     ` Marc-André Lureau
2022-04-20 13:26 ` [PATCH 29/41] tests: run-time skip test-qga if TSAN is enabled marcandre.lureau
2022-04-20 15:41   ` Daniel P. Berrangé
2022-04-21 13:02     ` Marc-André Lureau
2022-04-20 13:26 ` [PATCH 30/41] Move error_printf_unless_qmp() with monitor unit marcandre.lureau
2022-04-20 15:42   ` Daniel P. Berrangé
2022-04-20 13:26 ` [PATCH 31/41] qga: move qga_get_host_name() marcandre.lureau
2022-04-20 13:51   ` Konstantin Kostiuk
2022-04-20 15:44   ` Daniel P. Berrangé
2022-04-20 13:26 ` [PATCH 32/41] qtest: simplify socket_send() marcandre.lureau
2022-04-20 14:24   ` Thomas Huth
2022-04-20 15:45   ` Daniel P. Berrangé
2022-04-21 13:07     ` Marc-André Lureau
2022-04-20 13:26 ` [PATCH 33/41] tests: move libqtest.c under libqos/ marcandre.lureau
2022-04-20 14:16   ` Thomas Huth
2022-04-20 15:48   ` Daniel P. Berrangé
2022-04-20 13:26 ` [PATCH 34/41] libqtest: split QMP part in libqmp marcandre.lureau
2022-04-20 14:29   ` Thomas Huth
2022-04-20 13:26 ` [PATCH 35/41] util: simplify write in signal handler marcandre.lureau
2022-04-20 15:49   ` Daniel P. Berrangé
2022-04-20 13:26 ` [PATCH 36/41] util: use qemu_write_full() in qemu_write_pidfile() marcandre.lureau
2022-04-20 15:49   ` Daniel P. Berrangé
2022-04-20 13:26 ` [PATCH 37/41] util: use qemu_create() " marcandre.lureau
2022-04-20 15:50   ` Daniel P. Berrangé
2022-04-20 13:26 ` [PATCH 38/41] util: replace qemu_get_local_state_pathname() marcandre.lureau
2022-04-20 13:26   ` [Virtio-fs] " marcandre.lureau
2022-04-20 15:51   ` Daniel P. Berrangé
2022-04-20 15:51     ` [Virtio-fs] " Daniel P. Berrangé
2022-04-20 13:26 ` [PATCH 39/41] qga: remove need for QEMU atomic.h marcandre.lureau
2022-04-20 15:51   ` Daniel P. Berrangé
2022-04-20 13:26 ` [PATCH 40/41] migration/ram: fix clang warning marcandre.lureau
2022-04-20 14:10   ` Dr. David Alan Gilbert
2022-04-20 13:26 ` [PATCH 41/41] tests/fuzz: fix warning marcandre.lureau
2022-04-20 14:30   ` Thomas Huth
2022-04-20 14:40 ` [PATCH 00/41] Misc cleanups Thomas Huth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.