qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: manos.pitsidianakis@linaro.org, zhao1.liu@intel.com,
	junjie.mao@hotmail.com, berrange@redhat.com
Subject: [PATCH 01/23] rust: add definitions for vmstate
Date: Fri, 25 Oct 2024 18:01:46 +0200	[thread overview]
Message-ID: <20241025160209.194307-2-pbonzini@redhat.com> (raw)
In-Reply-To: <20241025160209.194307-1-pbonzini@redhat.com>

From: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>

Add a new qemu_api module, `vmstate`. Declare a bunch of Rust
macros declared that are equivalent in spirit to the C macros in
include/migration/vmstate.h.

For example the Rust of equivalent of the C macro:

  VMSTATE_UINT32(field_name, struct_name)

is:

  vmstate_uint32!(field_name, StructName)

This breathtaking development will allow us to reach feature parity between
the Rust and C pl011 implementations.

Extracted from a patch by Manos Pitsidianakis.

Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 rust/qemu-api/meson.build         |   1 +
 rust/qemu-api/src/device_class.rs |  21 --
 rust/qemu-api/src/lib.rs          |   3 +
 rust/qemu-api/src/vmstate.rs      | 358 ++++++++++++++++++++++++++++++
 rust/qemu-api/tests/tests.rs      |  11 +-
 5 files changed, 368 insertions(+), 26 deletions(-)
 create mode 100644 rust/qemu-api/src/vmstate.rs

diff --git a/rust/qemu-api/meson.build b/rust/qemu-api/meson.build
index 1b0fd406378..3b849f7c413 100644
--- a/rust/qemu-api/meson.build
+++ b/rust/qemu-api/meson.build
@@ -5,6 +5,7 @@ _qemu_api_rs = static_library(
       'src/lib.rs',
       'src/definitions.rs',
       'src/device_class.rs',
+      'src/vmstate.rs',
       'src/zeroable.rs',
     ],
     {'.' : bindings_rs},
diff --git a/rust/qemu-api/src/device_class.rs b/rust/qemu-api/src/device_class.rs
index aa6088d9d3d..3d40256f60f 100644
--- a/rust/qemu-api/src/device_class.rs
+++ b/rust/qemu-api/src/device_class.rs
@@ -62,24 +62,3 @@ macro_rules! declare_properties {
         ];
     };
 }
-
-#[macro_export]
-macro_rules! vm_state_description {
-    ($(#[$outer:meta])*
-     $name:ident,
-     $(name: $vname:expr,)*
-     $(unmigratable: $um_val:expr,)*
-    ) => {
-        #[used]
-        $(#[$outer])*
-        pub static $name: $crate::bindings::VMStateDescription = $crate::bindings::VMStateDescription {
-            $(name: {
-                #[used]
-                static VMSTATE_NAME: &::core::ffi::CStr = $vname;
-                $vname.as_ptr()
-            },)*
-            unmigratable: true,
-            ..$crate::zeroable::Zeroable::ZERO
-        };
-    }
-}
diff --git a/rust/qemu-api/src/lib.rs b/rust/qemu-api/src/lib.rs
index e94a15bb823..10ab3d7e639 100644
--- a/rust/qemu-api/src/lib.rs
+++ b/rust/qemu-api/src/lib.rs
@@ -26,9 +26,12 @@ unsafe impl Send for bindings::Property {}
 unsafe impl Sync for bindings::Property {}
 unsafe impl Sync for bindings::TypeInfo {}
 unsafe impl Sync for bindings::VMStateDescription {}
+unsafe impl Sync for bindings::VMStateField {}
+unsafe impl Sync for bindings::VMStateInfo {}
 
 pub mod definitions;
 pub mod device_class;
+pub mod vmstate;
 pub mod zeroable;
 
 use std::alloc::{GlobalAlloc, Layout};
diff --git a/rust/qemu-api/src/vmstate.rs b/rust/qemu-api/src/vmstate.rs
new file mode 100644
index 00000000000..3aa6ed2a781
--- /dev/null
+++ b/rust/qemu-api/src/vmstate.rs
@@ -0,0 +1,358 @@
+// Copyright 2024, Linaro Limited
+// Author(s): Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+//! Helper macros to declare migration state for device models.
+//!
+//! Some macros are direct equivalents to the C macros declared in
+//! `include/migration/vmstate.h` while [`vmstate_subsections`] and
+//! [`vmstate_fields`] are meant to be used when declaring a device model state
+//! struct.
+
+#[doc(alias = "VMSTATE_UNUSED_BUFFER")]
+#[macro_export]
+macro_rules! vmstate_unused_buffer {
+    ($field_exists_fn:expr, $version_id:expr, $size:expr) => {{
+        $crate::bindings::VMStateField {
+            name: c"unused".as_ptr(),
+            err_hint: ::core::ptr::null(),
+            offset: 0,
+            size: $size,
+            start: 0,
+            num: 0,
+            num_offset: 0,
+            size_offset: 0,
+            info: unsafe { ::core::ptr::addr_of!($crate::bindings::vmstate_info_unused_buffer) },
+            flags: VMStateFlags::VMS_BUFFER,
+            vmsd: ::core::ptr::null(),
+            version_id: $version_id,
+            struct_version_id: 0,
+            field_exists: $field_exists_fn,
+        }
+    }};
+}
+
+#[doc(alias = "VMSTATE_UNUSED_V")]
+#[macro_export]
+macro_rules! vmstate_unused_v {
+    ($version_id:expr, $size:expr) => {{
+        $crate::vmstate_unused_buffer!(None, $version_id, $size)
+    }};
+}
+
+#[doc(alias = "VMSTATE_UNUSED")]
+#[macro_export]
+macro_rules! vmstate_unused {
+    ($size:expr) => {{
+        $crate::vmstate_unused_v!(0, $size)
+    }};
+}
+
+#[doc(alias = "VMSTATE_SINGLE_TEST")]
+#[macro_export]
+macro_rules! vmstate_single_test {
+    ($field_name:ident, $struct_name:ty, $field_exists_fn:expr, $version_id:expr, $info:block, $size:expr) => {{
+        $crate::bindings::VMStateField {
+            name: ::core::concat!(::core::stringify!($field_name), 0)
+                .as_bytes()
+                .as_ptr() as *const ::core::ffi::c_char,
+            err_hint: ::core::ptr::null(),
+            offset: ::core::mem::offset_of!($struct_name, $field_name),
+            size: $size,
+            start: 0,
+            num: 0,
+            num_offset: 0,
+            size_offset: 0,
+            info: $info,
+            flags: VMStateFlags::VMS_SINGLE,
+            vmsd: ::core::ptr::null(),
+            version_id: $version_id,
+            struct_version_id: 0,
+            field_exists: $field_exists_fn,
+        }
+    }};
+}
+
+#[doc(alias = "VMSTATE_SINGLE")]
+#[macro_export]
+macro_rules! vmstate_single {
+    ($field_name:ident, $struct_name:ty, $version_id:expr, $info:block, $size:expr) => {{
+        $crate::vmstate_single_test!($field_name, $struct_name, None, $version_id, $info, $size)
+    }};
+}
+
+#[doc(alias = "VMSTATE_UINT32_V")]
+#[macro_export]
+macro_rules! vmstate_uint32_v {
+    ($field_name:ident, $struct_name:ty, $version_id:expr) => {{
+        $crate::vmstate_single!(
+            $field_name,
+            $struct_name,
+            $version_id,
+            { unsafe { ::core::ptr::addr_of!($crate::bindings::vmstate_info_uint32) } },
+            ::core::mem::size_of::<u32>()
+        )
+    }};
+}
+
+#[doc(alias = "VMSTATE_UINT32")]
+#[macro_export]
+macro_rules! vmstate_uint32 {
+    ($field_name:ident, $struct_name:ty) => {{
+        $crate::vmstate_uint32_v!($field_name, $struct_name, 0)
+    }};
+}
+
+#[doc(alias = "VMSTATE_INT32_V")]
+#[macro_export]
+macro_rules! vmstate_int32_v {
+    ($field_name:ident, $struct_name:ty, $version_id:expr) => {{
+        $crate::vmstate_single!(
+            $field_name,
+            $struct_name,
+            $version_id,
+            { unsafe { ::core::ptr::addr_of!($crate::bindings::vmstate_info_int32) } },
+            ::core::mem::size_of::<i32>()
+        )
+    }};
+}
+
+#[doc(alias = "VMSTATE_INT32")]
+#[macro_export]
+macro_rules! vmstate_int32 {
+    ($field_name:ident, $struct_name:ty) => {{
+        $crate::vmstate_int32_v!($field_name, $struct_name, 0)
+    }};
+}
+
+#[doc(alias = "VMSTATE_ARRAY")]
+#[macro_export]
+macro_rules! vmstate_array {
+    ($field_name:ident, $struct_name:ty, $length:expr, $version_id:expr, $info:block, $size:expr) => {{
+        $crate::bindings::VMStateField {
+            name: ::core::concat!(::core::stringify!($field_name), 0)
+                .as_bytes()
+                .as_ptr() as *const ::core::ffi::c_char,
+            err_hint: ::core::ptr::null(),
+            offset: ::core::mem::offset_of!($struct_name, $field_name),
+            size: $size,
+            start: 0,
+            num: $length as _,
+            num_offset: 0,
+            size_offset: 0,
+            info: $info,
+            flags: VMStateFlags::VMS_ARRAY,
+            vmsd: ::core::ptr::null(),
+            version_id: $version_id,
+            struct_version_id: 0,
+            field_exists: None,
+        }
+    }};
+}
+
+#[doc(alias = "VMSTATE_UINT32_ARRAY_V")]
+#[macro_export]
+macro_rules! vmstate_uint32_array_v {
+    ($field_name:ident, $struct_name:ty, $length:expr, $version_id:expr) => {{
+        $crate::vmstate_array!(
+            $field_name,
+            $struct_name,
+            $length,
+            $version_id,
+            { unsafe { ::core::ptr::addr_of!($crate::bindings::vmstate_info_uint32) } },
+            ::core::mem::size_of::<u32>()
+        )
+    }};
+}
+
+#[doc(alias = "VMSTATE_UINT32_ARRAY")]
+#[macro_export]
+macro_rules! vmstate_uint32_array {
+    ($field_name:ident, $struct_name:ty, $length:expr) => {{
+        $crate::vmstate_uint32_array_v!($field_name, $struct_name, $length, 0)
+    }};
+}
+
+#[doc(alias = "VMSTATE_STRUCT_POINTER_V")]
+#[macro_export]
+macro_rules! vmstate_struct_pointer_v {
+    ($field_name:ident, $struct_name:ty, $version_id:expr, $vmsd:expr, $type:ty) => {{
+        $crate::bindings::VMStateField {
+            name: ::core::concat!(::core::stringify!($field_name), 0)
+                .as_bytes()
+                .as_ptr() as *const ::core::ffi::c_char,
+            err_hint: ::core::ptr::null(),
+            offset: ::core::mem::offset_of!($struct_name, $field_name),
+            size: ::core::mem::size_of::<*const $type>(),
+            start: 0,
+            num: 0,
+            num_offset: 0,
+            size_offset: 0,
+            info: ::core::ptr::null(),
+            flags: VMStateFlags(VMStateFlags::VMS_STRUCT.0 | VMStateFlags::VMS_POINTER.0),
+            vmsd: $vmsd,
+            version_id: $version_id,
+            struct_version_id: 0,
+            field_exists: None,
+        }
+    }};
+}
+
+#[doc(alias = "VMSTATE_ARRAY_OF_POINTER")]
+#[macro_export]
+macro_rules! vmstate_array_of_pointer {
+    ($field_name:ident, $struct_name:ty, $num:expr, $version_id:expr, $info:expr, $type:ty) => {{
+        $crate::bindings::VMStateField {
+            name: ::core::concat!(::core::stringify!($field_name), 0)
+                .as_bytes()
+                .as_ptr() as *const ::core::ffi::c_char,
+            version_id: $version_id,
+            num: $num as _,
+            info: $info,
+            size: ::core::mem::size_of::<*const $type>(),
+            flags: VMStateFlags(VMStateFlags::VMS_ARRAY.0 | VMStateFlags::VMS_ARRAY_OF_POINTER.0),
+            offset: ::core::mem::offset_of!($struct_name, $field_name),
+            err_hint: ::core::ptr::null(),
+            start: 0,
+            num_offset: 0,
+            size_offset: 0,
+            vmsd: ::core::ptr::null(),
+            struct_version_id: 0,
+            field_exists: None,
+        }
+    }};
+}
+
+#[doc(alias = "VMSTATE_ARRAY_OF_POINTER_TO_STRUCT")]
+#[macro_export]
+macro_rules! vmstate_array_of_pointer_to_struct {
+    ($field_name:ident, $struct_name:ty, $num:expr, $version_id:expr, $vmsd:expr, $type:ty) => {{
+        $crate::bindings::VMStateField {
+            name: ::core::concat!(::core::stringify!($field_name), 0)
+                .as_bytes()
+                .as_ptr() as *const ::core::ffi::c_char,
+            version_id: $version_id,
+            num: $num as _,
+            vmsd: $vmsd,
+            size: ::core::mem::size_of::<*const $type>(),
+            flags: VMStateFlags(
+                VMStateFlags::VMS_ARRAY.0
+                    | VMStateFlags::VMS_STRUCT.0
+                    | VMStateFlags::VMS_ARRAY_OF_POINTER.0,
+            ),
+            offset: ::core::mem::offset_of!($struct_name, $field_name),
+            err_hint: ::core::ptr::null(),
+            start: 0,
+            num_offset: 0,
+            size_offset: 0,
+            vmsd: ::core::ptr::null(),
+            struct_version_id: 0,
+            field_exists: None,
+        }
+    }};
+}
+
+#[doc(alias = "VMSTATE_CLOCK_V")]
+#[macro_export]
+macro_rules! vmstate_clock_v {
+    ($field_name:ident, $struct_name:ty, $version_id:expr) => {{
+        $crate::vmstate_struct_pointer_v!(
+            $field_name,
+            $struct_name,
+            $version_id,
+            { unsafe { ::core::ptr::addr_of!($crate::bindings::vmstate_clock) } },
+            $crate::bindings::Clock
+        )
+    }};
+}
+
+#[doc(alias = "VMSTATE_CLOCK")]
+#[macro_export]
+macro_rules! vmstate_clock {
+    ($field_name:ident, $struct_name:ty) => {{
+        $crate::vmstate_clock_v!($field_name, $struct_name, 0)
+    }};
+}
+
+#[doc(alias = "VMSTATE_ARRAY_CLOCK_V")]
+#[macro_export]
+macro_rules! vmstate_array_clock_v {
+    ($field_name:ident, $struct_name:ty, $num:expr, $version_id:expr) => {{
+        $crate::vmstate_array_of_pointer_to_struct!(
+            $field_name,
+            $struct_name,
+            $num,
+            $version_id,
+            { unsafe { ::core::ptr::addr_of!($crate::bindings::vmstate_clock) } },
+            $crate::bindings::Clock
+        )
+    }};
+}
+
+#[doc(alias = "VMSTATE_ARRAY_CLOCK")]
+#[macro_export]
+macro_rules! vmstate_array_clock {
+    ($field_name:ident, $struct_name:ty, $num:expr) => {{
+        $crate::vmstate_array_clock_v!($field_name, $struct_name, $name, 0)
+    }};
+}
+
+/// Helper macro to declare a list of
+/// ([`VMStateField`](`crate::bindings::VMStateField`)) into a static and return
+/// a pointer to the array of values it created.
+#[macro_export]
+macro_rules! vmstate_fields {
+    ($($field:expr),*$(,)*) => {{
+        static _FIELDS: &[$crate::bindings::VMStateField] = &[
+            $($field),*,
+            $crate::bindings::VMStateField {
+                name: ::core::ptr::null(),
+                err_hint: ::core::ptr::null(),
+                offset: 0,
+                size: 0,
+                start: 0,
+                num: 0,
+                num_offset: 0,
+                size_offset: 0,
+                info: ::core::ptr::null(),
+                flags: VMStateFlags::VMS_END,
+                vmsd: ::core::ptr::null(),
+                version_id: 0,
+                struct_version_id: 0,
+                field_exists: None,
+            }
+        ];
+        _FIELDS.as_ptr()
+    }}
+}
+
+/// A transparent wrapper type for the `subsections` field of
+/// [`VMStateDescription`](crate::bindings::VMStateDescription).
+///
+/// This is necessary to be able to declare subsection descriptions as statics,
+/// because the only way to implement `Sync` for a foreign type (and `*const`
+/// pointers are foreign types in Rust) is to create a wrapper struct and
+/// `unsafe impl Sync` for it.
+///
+/// This struct is used in the [`vmstate_subsections`] macro implementation.
+#[repr(transparent)]
+pub struct VMStateSubsectionsWrapper(pub &'static [*const crate::bindings::VMStateDescription]);
+
+unsafe impl Sync for VMStateSubsectionsWrapper {}
+
+/// Helper macro to declare a list of subsections
+/// ([`VMStateDescription`](`crate::bindings::VMStateDescription`)) into a
+/// static and return a pointer to the array of pointers it created.
+#[macro_export]
+macro_rules! vmstate_subsections {
+    ($($subsection:expr),*$(,)*) => {{
+        static _SUBSECTIONS: $crate::vmstate::VMStateSubsectionsWrapper = $crate::vmstate::VMStateSubsectionsWrapper(&[
+            $({
+                static _SUBSECTION: $crate::bindings::VMStateDescription = $subsection;
+                ::core::ptr::addr_of!(_SUBSECTION)
+            }),*,
+            ::core::ptr::null()
+        ]);
+        _SUBSECTIONS.0.as_ptr()
+    }}
+}
diff --git a/rust/qemu-api/tests/tests.rs b/rust/qemu-api/tests/tests.rs
index aa1e0568c69..37c4dd44f81 100644
--- a/rust/qemu-api/tests/tests.rs
+++ b/rust/qemu-api/tests/tests.rs
@@ -8,17 +8,18 @@
     bindings::*,
     declare_properties, define_property,
     definitions::{Class, ObjectImpl},
-    device_class_init, vm_state_description,
+    device_class_init,
+    zeroable::Zeroable,
 };
 
 #[test]
 fn test_device_decl_macros() {
     // Test that macros can compile.
-    vm_state_description! {
-        VMSTATE,
-        name: c"name",
+    pub static VMSTATE: VMStateDescription = VMStateDescription {
+        name: c"name".as_ptr(),
         unmigratable: true,
-    }
+        ..Zeroable::ZERO
+    };
 
     #[repr(C)]
     #[derive(qemu_api_macros::Object)]
-- 
2.47.0



  reply	other threads:[~2024-10-25 16:08 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-25 16:01 [PATCH v3 00/23] rust: fix CI + allow older versions of rustc and bindgen Paolo Bonzini
2024-10-25 16:01 ` Paolo Bonzini [this message]
2024-10-25 16:01 ` [PATCH 02/23] rust/pl011: fix default value for migrate-clock Paolo Bonzini
2024-10-25 16:01 ` [PATCH 03/23] rust/pl011: add support for migration Paolo Bonzini
2024-10-25 16:01 ` [PATCH 04/23] rust/pl011: move CLK_NAME static to function scope Paolo Bonzini
2024-10-25 16:01 ` [PATCH 05/23] rust/pl011: add TYPE_PL011_LUMINARY device Paolo Bonzini
2024-10-31 14:58   ` Zhao Liu
2024-10-25 16:01 ` [PATCH 06/23] rust/pl011: remove commented out C code Paolo Bonzini
2024-10-25 16:01 ` [PATCH 07/23] rust/pl011: Use correct masks for IBRD and FBRD Paolo Bonzini
2024-10-25 16:01 ` [PATCH 08/23] rust: patch bilge-impl to allow compilation with 1.63.0 Paolo Bonzini
2024-10-25 16:01 ` [PATCH 09/23] rust: fix cfgs of proc-macro2 for 1.63.0 Paolo Bonzini
2024-10-25 16:01 ` [PATCH 10/23] rust: use std::os::raw instead of core::ffi Paolo Bonzini
2024-10-25 16:01 ` [PATCH 11/23] rust: introduce a c_str macro Paolo Bonzini
2024-10-31 10:39   ` Zhao Liu
2024-10-25 16:01 ` [PATCH 12/23] rust: silence unknown warnings for the sake of old compilers Paolo Bonzini
2024-10-25 16:01 ` [PATCH 13/23] rust: synchronize dependencies between subprojects and Cargo.lock Paolo Bonzini
2024-10-31 11:31   ` Zhao Liu
2024-11-01 10:14   ` Junjie Mao
2024-11-01 15:30     ` Paolo Bonzini
2024-11-02  2:13       ` Junjie Mao
2024-10-25 16:01 ` [PATCH 14/23] rust: create a cargo workspace Paolo Bonzini
2024-10-31 13:46   ` Zhao Liu
2024-11-01 10:21   ` Junjie Mao
2024-10-25 16:02 ` [PATCH 15/23] rust: introduce alternative implementation of offset_of! Paolo Bonzini
2024-11-03  9:54   ` Junjie Mao
2024-11-04 16:02     ` Paolo Bonzini
2024-11-04 16:03     ` Paolo Bonzini
2024-11-04 16:03     ` Paolo Bonzini
2024-11-05  2:07       ` Junjie Mao
2024-10-25 16:02 ` [PATCH 16/23] rust: do not use MaybeUninit::zeroed() Paolo Bonzini
2024-10-25 16:02 ` [PATCH 17/23] rust: clean up detection of the language Paolo Bonzini
2024-10-25 16:02 ` [PATCH 18/23] rust: allow version 1.63.0 of rustc Paolo Bonzini
2024-10-25 16:02 ` [PATCH 19/23] rust: do not use --generate-cstr Paolo Bonzini
2024-10-25 20:03   ` Michael Tokarev
2024-10-25 20:06     ` Pierrick Bouvier
2024-10-25 20:10       ` Michael Tokarev
2024-10-25 20:12         ` Pierrick Bouvier
2024-10-25 20:11     ` Paolo Bonzini
2024-10-25 16:02 ` [PATCH 20/23] rust: allow older version of bindgen Paolo Bonzini
2024-10-25 16:02 ` [PATCH 21/23] rust: make rustfmt optional Paolo Bonzini
2024-10-25 16:02 ` [PATCH 22/23] dockerfiles: install bindgen from cargo on Ubuntu 22.04 Paolo Bonzini
2024-10-25 18:51   ` Pierrick Bouvier
2024-10-25 19:35     ` Paolo Bonzini
2024-10-25 19:47       ` Pierrick Bouvier
2024-10-25 20:08         ` Paolo Bonzini
2024-10-25 20:14           ` Pierrick Bouvier
2024-10-25 20:21             ` Paolo Bonzini
2024-10-25 20:08   ` Pierrick Bouvier
2024-10-25 16:02 ` [PATCH 23/23] ci: enable rust in the Debian and Ubuntu system build job Paolo Bonzini
2024-10-25 18:55   ` Pierrick Bouvier
2024-10-25 18:58     ` Pierrick Bouvier
2024-10-25 19:27     ` Paolo Bonzini
2024-10-25 19:33       ` Pierrick Bouvier
2024-10-25 20:08   ` Pierrick Bouvier
2024-10-25 16:23 ` [PATCH v3 00/23] rust: fix CI + allow older versions of rustc and bindgen Manos Pitsidianakis
2024-10-31 16:28   ` Paolo Bonzini
2024-10-27  7:01 ` Michael Tokarev
2024-10-27  8:00   ` Paolo Bonzini
2024-10-27  9:38     ` Michael Tokarev
2024-10-27  9:42       ` Michael Tokarev
2024-10-27  9:57         ` Michael Tokarev
2024-10-27 12:39         ` Paolo Bonzini
2024-10-28  9:21   ` Daniel P. Berrangé
2024-10-28 12:26     ` Alex Bennée
2024-10-28 12:41       ` Paolo Bonzini
2024-10-30 16:52 ` Paolo Bonzini
2024-10-31 16:41 ` Zhao Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241025160209.194307-2-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=berrange@redhat.com \
    --cc=junjie.mao@hotmail.com \
    --cc=manos.pitsidianakis@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=zhao1.liu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).