summaryrefslogtreecommitdiff
path: root/include/sysemu/hostmem.h
diff options
context:
space:
mode:
authorPeter Xu <peterx@redhat.com>2017-03-10 21:09:29 +0800
committerEduardo Habkost <ehabkost@redhat.com>2017-04-20 15:22:41 -0300
commit4728b5741040df8bd02a5ad8fd3c2beefae3dcb1 (patch)
tree86294e46f43683248c85313a53b05e6214100eaa /include/sysemu/hostmem.h
parent991db247745c1de161d665f847fd28618212f2e8 (diff)
downloadqemu-4728b5741040df8bd02a5ad8fd3c2beefae3dcb1.zip
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 <peter.maydell@linaro.org> Signed-off-by: Peter Xu <peterx@redhat.com> Message-Id: <1489151370-15453-2-git-send-email-peterx@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'include/sysemu/hostmem.h')
-rw-r--r--include/sysemu/hostmem.h1
1 files changed, 1 insertions, 0 deletions
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);