From 512fa40867e6118568756a81ddaf476a0fef0f32 Mon Sep 17 00:00:00 2001 From: Peter Xu Date: Fri, 7 Apr 2017 18:59:08 +0800 Subject: memory: provide IOMMU_NOTIFIER_FOREACH macro A new macro is provided to iterate all the IOMMU notifiers hooked under specific IOMMU memory region. Reviewed-by: David Gibson Reviewed-by: Eric Auger Reviewed-by: \"Michael S. Tsirkin\" Signed-off-by: Peter Xu Message-Id: <1491562755-23867-3-git-send-email-peterx@redhat.com> Signed-off-by: Eduardo Habkost --- include/exec/memory.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/exec/memory.h b/include/exec/memory.h index 0840c89489..07e43daf20 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -239,6 +239,9 @@ struct MemoryRegion { IOMMUNotifierFlag iommu_notify_flags; }; +#define IOMMU_NOTIFIER_FOREACH(n, mr) \ + QLIST_FOREACH((n), &(mr)->iommu_notify, node) + /** * MemoryListener: callbacks structure for updates to the physical memory map * -- cgit v1.2.3-55-g7522