On 20/5/25 12:28, Chenyi Qiang wrote:
So that the caller can check the result of NotifyRamDiscard() handler if
the operation fails.

Signed-off-by: Chenyi Qiang <chenyi.qi...@intel.com>
---
Changes in v5:
     - Revert to use of NotifyRamDiscard()

Changes in v4:
     - Newly added.
---
  hw/vfio/listener.c           | 6 ++++--
  include/system/memory.h      | 4 ++--
  system/ram-block-attribute.c | 3 +--
  3 files changed, 7 insertions(+), 6 deletions(-)


diff --git a/include/system/memory.h b/include/system/memory.h
index 83b28551c4..e5155120d9 100644
--- a/include/system/memory.h
+++ b/include/system/memory.h
@@ -518,8 +518,8 @@ struct IOMMUMemoryRegionClass {
  typedef struct RamDiscardListener RamDiscardListener;
  typedef int (*NotifyRamPopulate)(RamDiscardListener *rdl,
                                   MemoryRegionSection *section);
-typedef void (*NotifyRamDiscard)(RamDiscardListener *rdl,
-                                 MemoryRegionSection *section);
+typedef int (*NotifyRamDiscard)(RamDiscardListener *rdl,
+                                MemoryRegionSection *section);

Please document the return value.



Reply via email to