• H
    hostmem-file: add "align" option · 98376843
    Haozhong Zhang 提交于
    When mmap(2) the backend files, QEMU uses the host page size
    (getpagesize(2)) by default as the alignment of mapping address.
    However, some backends may require alignments different than the page
    size. For example, mmap a device DAX (e.g., /dev/dax0.0) on Linux
    kernel 4.13 to an address, which is 4K-aligned but not 2M-aligned,
    fails with a kernel message like
    
    [617494.969768] dax dax0.0: qemu-system-x86: dax_mmap: fail, unaligned vma (0x7fa37c579000 - 0x7fa43c579000, 0x1fffff)
    
    Because there is no common approach to get such alignment requirement,
    we add the 'align' option to 'memory-backend-file', so that users or
    management utils, which have enough knowledge about the backend, can
    specify a proper alignment via this option.
    Signed-off-by: NHaozhong Zhang <haozhong.zhang@intel.com>
    Message-Id: <20171211072806.2812-2-haozhong.zhang@intel.com>
    Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
    Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
    [ehabkost: fixed typo, fixed error_setg() format string]
    Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
    98376843
memory.h 75.9 KB