exec: fetch the alignment of Linux devdax pmem character device nodes
commitce317be98db0dfdfae1d77b77e6b2575d7c59eeb
authorJingqi Liu <jingqi.liu@intel.com>
Wed, 29 Apr 2020 08:50:09 +0000 (29 16:50 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 26 Jun 2020 11:21:24 +0000 (26 07:21 -0400)
tree6dead93b9408d286e407f9a76027527a384a723a
parent21b2eca6fc48c6485f5c3b4ed813246839f0a4df
exec: fetch the alignment of Linux devdax pmem character device nodes

If the backend file is devdax pmem character device, the alignment
specified by the option 'align=NUM' in the '-object memory-backend-file'
needs to match the alignment requirement of the devdax pmem character device.

This patch uses the interfaces of libdaxctl to fetch the devdax pmem file
'align', so that we can compare it with the NUM of 'align=NUM'.
The NUM needs to be larger than or equal to the devdax pmem file 'align'.

It also fixes the problem that mmap() returns failure in qemu_ram_mmap()
when the NUM of 'align=NUM' is less than the devdax pmem file 'align'.

Suggested-by: Dan Williams <dan.j.williams@intel.com>
Reviewed-by: Joao Martins <joao.m.martins@oracle.com>
Signed-off-by: Jingqi Liu <jingqi.liu@intel.com>
Message-Id: <20200429085011.63752-2-jingqi.liu@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
exec.c