memory_region_register_iommu_notifier now returns an error in case of failure. Assert in such a case.
Signed-off-by: Eric Auger <[email protected]> --- v1 -> v2: - add assert(!ret) --- exec.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/exec.c b/exec.c index 8b998974f8..5be8db6253 100644 --- a/exec.c +++ b/exec.c @@ -663,7 +663,7 @@ static void tcg_register_iommu_notifier(CPUState *cpu, */ MemoryRegion *mr = MEMORY_REGION(iommu_mr); TCGIOMMUNotifier *notifier; - int i; + int i, ret; for (i = 0; i < cpu->iommu_notifiers->len; i++) { notifier = g_array_index(cpu->iommu_notifiers, TCGIOMMUNotifier *, i); @@ -692,7 +692,9 @@ static void tcg_register_iommu_notifier(CPUState *cpu, 0, HWADDR_MAX, iommu_idx); - memory_region_register_iommu_notifier(notifier->mr, ¬ifier->n); + ret = memory_region_register_iommu_notifier(notifier->mr, + ¬ifier->n); + assert(!ret); } if (!notifier->active) { -- 2.20.1
