diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2018-04-03 15:05:45 +1000 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2018-04-27 18:05:22 +1000 |
commit | 2b10808539d7ace3d9b1226a71a68e2431ef2176 (patch) | |
tree | 07bc8d753d710a7217bdd6ec69b59b89f417dab7 /target | |
parent | 0de6e2a3ca2e1215a2d62d8d796589d27eca91d0 (diff) | |
download | qemu-2b10808539d7ace3d9b1226a71a68e2431ef2176.zip qemu-2b10808539d7ace3d9b1226a71a68e2431ef2176.tar.gz qemu-2b10808539d7ace3d9b1226a71a68e2431ef2176.tar.bz2 |
Add host_memory_backend_pagesize() helper
There are a couple places (one generic, one target specific) where we need
to get the host page size associated with a particular memory backend. I
have some upcoming code which will add another place which wants this. So,
for convenience, add a helper function to calculate this.
host_memory_backend_pagesize() returns the host pagesize for a given
HostMemoryBackend object.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Greg Kurz <groug@kaod.org>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'target')
-rw-r--r-- | target/ppc/kvm.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c index e24fa50..f62f7ac 100644 --- a/target/ppc/kvm.c +++ b/target/ppc/kvm.c @@ -496,11 +496,7 @@ static void kvm_fixup_page_sizes(PowerPCCPU *cpu) bool kvmppc_is_mem_backend_page_size_ok(const char *obj_path) { Object *mem_obj = object_resolve_path(obj_path, NULL); - char *mempath = object_property_get_str(mem_obj, "mem-path", NULL); - long pagesize; - - pagesize = qemu_mempath_getpagesize(mempath); - g_free(mempath); + long pagesize = host_memory_backend_pagesize(MEMORY_BACKEND(mem_obj)); return pagesize >= max_cpu_page_size; } |