From: Chenyi Qiang <chenyi.qiang@intel.com>
To: "David Hildenbrand" <david@redhat.com>,
"Alexey Kardashevskiy" <aik@amd.com>,
"Peter Xu" <peterx@redhat.com>,
"Gupta Pankaj" <pankaj.gupta@amd.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Michael Roth" <michael.roth@amd.com>
Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org,
"Williams Dan J" <dan.j.williams@intel.com>,
"Zhao Liu" <zhao1.liu@intel.com>,
"Baolu Lu" <baolu.lu@linux.intel.com>,
"Gao Chao" <chao.gao@intel.com>, "Xu Yilun" <yilun.xu@intel.com>,
"Li Xiaoyao" <xiaoyao.li@intel.com>,
"Cédric Le Goater" <clg@kaod.org>,
"Alex Williamson" <alex.williamson@redhat.com>
Subject: Re: [PATCH v7 3/5] memory: Unify the definiton of ReplayRamPopulate() and ReplayRamDiscard()
Date: Thu, 19 Jun 2025 11:06:46 +0800 [thread overview]
Message-ID: <0de41d54-31da-466c-a6bb-f45ff919ced5@intel.com> (raw)
In-Reply-To: <20250612082747.51539-4-chenyi.qiang@intel.com>
On 6/12/2025 4:27 PM, Chenyi Qiang wrote:
> Update ReplayRamDiscard() function to return the result and unify the
> ReplayRamPopulate() and ReplayRamDiscard() to ReplayRamDiscardState() at
> the same time due to their identical definitions. This unification
> simplifies related structures, such as VirtIOMEMReplayData, which makes
> it cleaner.
>
> Reviewed-by: David Hildenbrand <david@redhat.com>
> Reviewed-by: Pankaj Gupta <pankaj.gupta@amd.com>
> Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>
> Signed-off-by: Chenyi Qiang <chenyi.qiang@intel.com>
> ---
> Changes in v7:
> - Add Reviewed-by from Xiaoyao and Pankaj.
>
> Changes in v6:
> - Add Reviewed-by from David
> - Add a documentation comment for the prototype change
>
> Changes in v5:
> - Rename ReplayRamStateChange to ReplayRamDiscardState (David)
> - return data->fn(s, data->opaque) instead of 0 in
> virtio_mem_rdm_replay_discarded_cb(). (Alexey)
>
> Changes in v4:
> - Modify the commit message. We won't use Replay() operation when
> doing the attribute change like v3.
> ---
> hw/virtio/virtio-mem.c | 21 +++++++-------
> include/system/memory.h | 64 ++++++++++++++++++++++++++++++-----------
> migration/ram.c | 5 ++--
> system/memory.c | 12 ++++----
> 4 files changed, 66 insertions(+), 36 deletions(-)
>
To fix the build error with --enable-docs configuration, Add the below fixup
======
From 41bf404651b180f886bd174d36ae62be2b0da61f Mon Sep 17 00:00:00 2001
From: Chenyi Qiang <chenyi.qiang@intel.com>
Date: Thu, 19 Jun 2025 10:49:46 +0800
Subject: [PATCH] fixup! memory: Unify the definiton of ReplayRamPopulate() and
ReplayRamDiscard()
Signed-off-by: Chenyi Qiang <chenyi.qiang@intel.com>
---
include/system/memory.h | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/include/system/memory.h b/include/system/memory.h
index eb2618e1b4..46248d4a52 100644
--- a/include/system/memory.h
+++ b/include/system/memory.h
@@ -577,7 +577,7 @@ static inline void ram_discard_listener_init(RamDiscardListener *rdl,
}
/**
- * ReplayRamDiscardState:
+ * typedef ReplayRamDiscardState:
*
* The callback handler for #RamDiscardManagerClass.replay_populated/
* #RamDiscardManagerClass.replay_discarded to invoke on populated/discarded
@@ -741,6 +741,11 @@ bool ram_discard_manager_is_populated(const RamDiscardManager *rdm,
* A wrapper to call the #RamDiscardManagerClass.replay_populated callback
* of the #RamDiscardManager.
*
+ * @rdm: the #RamDiscardManager
+ * @section: the #MemoryRegionSection
+ * @replay_fn: the #ReplayRamDiscardState callback
+ * @opaque: pointer to forward to the callback
+ *
* Returns 0 on success, or a negative error if any notification failed.
*/
int ram_discard_manager_replay_populated(const RamDiscardManager *rdm,
@@ -754,6 +759,11 @@ int ram_discard_manager_replay_populated(const RamDiscardManager *rdm,
* A wrapper to call the #RamDiscardManagerClass.replay_discarded callback
* of the #RamDiscardManager.
*
+ * @rdm: the #RamDiscardManager
+ * @section: the #MemoryRegionSection
+ * @replay_fn: the #ReplayRamDiscardState callback
+ * @opaque: pointer to forward to the callback
+ *
* Returns 0 on success, or a negative error if any notification failed.
*/
int ram_discard_manager_replay_discarded(const RamDiscardManager *rdm,
--
2.43.5
next prev parent reply other threads:[~2025-06-19 3:07 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-12 8:27 [PATCH v7 0/5] Enable shared device assignment Chenyi Qiang
2025-06-12 8:27 ` [PATCH v7 1/5] memory: Export a helper to get intersection of a MemoryRegionSection with a given range Chenyi Qiang
2025-06-12 8:27 ` [PATCH v7 2/5] memory: Change memory_region_set_ram_discard_manager() to return the result Chenyi Qiang
2025-06-12 8:27 ` [PATCH v7 3/5] memory: Unify the definiton of ReplayRamPopulate() and ReplayRamDiscard() Chenyi Qiang
2025-06-19 3:06 ` Chenyi Qiang [this message]
2025-06-19 14:29 ` Peter Xu
2025-06-20 4:04 ` Chenyi Qiang
2025-06-12 8:27 ` [PATCH v7 4/5] ram-block-attributes: Introduce RamBlockAttributes to manage RAMBlock with guest_memfd Chenyi Qiang
2025-06-20 2:53 ` Chenyi Qiang
2025-06-12 8:27 ` [PATCH v7 5/5] physmem: Support coordinated discarding of RAM " Chenyi Qiang
2025-06-18 21:58 ` [PATCH v7 0/5] Enable shared device assignment Peter Xu
2025-06-24 9:51 ` David Hildenbrand
2025-06-18 22:22 ` Peter Xu
2025-06-19 3:09 ` Chenyi Qiang
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=0de41d54-31da-466c-a6bb-f45ff919ced5@intel.com \
--to=chenyi.qiang@intel.com \
--cc=aik@amd.com \
--cc=alex.williamson@redhat.com \
--cc=baolu.lu@linux.intel.com \
--cc=chao.gao@intel.com \
--cc=clg@kaod.org \
--cc=dan.j.williams@intel.com \
--cc=david@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=michael.roth@amd.com \
--cc=pankaj.gupta@amd.com \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=xiaoyao.li@intel.com \
--cc=yilun.xu@intel.com \
--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).