hostmem-memfd: honour share=on/off property

The share=on/off property is used to modified mmap() MAP_SHARED
setting. Make it on by default for convenience and compatibility
reasons.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Marc-André Lureau
2018-08-28 17:38:40 +02:00
committed by Paolo Bonzini
parent 15ffb43cbf
commit 36ea397956
2 changed files with 6 additions and 2 deletions

View File

@ -59,7 +59,8 @@ memfd_backend_memory_alloc(HostMemoryBackend *backend, Error **errp)
name = object_get_canonical_path(OBJECT(backend));
memory_region_init_ram_from_fd(&backend->mr, OBJECT(backend),
name, backend->size, true, fd, errp);
name, backend->size,
backend->share, fd, errp);
g_free(name);
}
@ -131,6 +132,7 @@ memfd_backend_instance_init(Object *obj)
/* default to sealed file */
m->seal = true;
MEMORY_BACKEND(m)->share = true;
}
static void