summaryrefslogtreecommitdiffstats
path: root/backends/hostmem-memfd.c
diff options
context:
space:
mode:
authorMarc-André Lureau2018-09-10 15:49:46 +0200
committerPaolo Bonzini2018-11-28 11:51:24 +0100
commit86100290cb6600b3d65e0794b45c1b82ead99411 (patch)
treef8038870c6549b912e128976401c5f6521e98ee4 /backends/hostmem-memfd.c
parenthostmem-memfd: honour share=on/off property (diff)
downloadqemu-86100290cb6600b3d65e0794b45c1b82ead99411.tar.gz
qemu-86100290cb6600b3d65e0794b45c1b82ead99411.tar.xz
qemu-86100290cb6600b3d65e0794b45c1b82ead99411.zip
hostmem: no need to check for host_memory_backend_mr_inited() in alloc()
memfd_backend_memory_alloc/file_backend_memory_alloc both needlessly are are calling host_memory_backend_mr_inited() which creates an illusion that alloc could be called multiple times but it isn't, it's called once from UserCreatable complete(). Suggested-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'backends/hostmem-memfd.c')
-rw-r--r--backends/hostmem-memfd.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/backends/hostmem-memfd.c b/backends/hostmem-memfd.c
index 1c3579e8ab..2eb9c827a5 100644
--- a/backends/hostmem-memfd.c
+++ b/backends/hostmem-memfd.c
@@ -44,10 +44,6 @@ memfd_backend_memory_alloc(HostMemoryBackend *backend, Error **errp)
return;
}
- if (host_memory_backend_mr_inited(backend)) {
- return;
- }
-
backend->force_prealloc = mem_prealloc;
fd = qemu_memfd_create(TYPE_MEMORY_BACKEND_MEMFD, backend->size,
m->hugetlb, m->hugetlbsize, m->seal ?