From 4728b5741040df8bd02a5ad8fd3c2beefae3dcb1 Mon Sep 17 00:00:00 2001 From: Peter Xu Date: Fri, 10 Mar 2017 21:09:29 +0800 Subject: hostmem: introduce host_memory_backend_mr_inited() We were checking this against memory region size of host memory backend's mr field to see whether the mr has been inited. This is efficient but less elegant. Let's make a helper for it to avoid confusions, along with some notes. Suggested-by: Peter Maydell Signed-off-by: Peter Xu Message-Id: <1489151370-15453-2-git-send-email-peterx@redhat.com> Reviewed-by: Eduardo Habkost Signed-off-by: Eduardo Habkost --- include/sysemu/hostmem.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/sysemu/hostmem.h') diff --git a/include/sysemu/hostmem.h b/include/sysemu/hostmem.h index ecae0cff19..ed6a437f4d 100644 --- a/include/sysemu/hostmem.h +++ b/include/sysemu/hostmem.h @@ -62,6 +62,7 @@ struct HostMemoryBackend { MemoryRegion mr; }; +bool host_memory_backend_mr_inited(HostMemoryBackend *backend); MemoryRegion *host_memory_backend_get_memory(HostMemoryBackend *backend, Error **errp); -- cgit v1.2.3