Skip to content
  • Pavel Fedin's avatar
    8d31d6b6
    backends/hostmem-file: Allow to specify full pathname for backing file · 8d31d6b6
    Pavel Fedin authored
    
    
    This allows to explicitly specify file name to use with the backend. This
    is important when using it together with ivshmem in order to make it backed
    by hugetlbfs. By default filename is autogenerated using mkstemp(), and the
    file is unlink()ed after creation, effectively making it anonymous. This is
    not very useful with ivshmem because it ends up in a memory which cannot be
    accessed by something else.
    
    Distinction between directory and file name is done by stat() check. If an
    existing directory is given, the code keeps old behavior. Otherwise it
    creates or opens a file with the given pathname.
    
    Signed-off-by: default avatarPavel Fedin <p.fedin@samsung.com>
    Tested-by: default avatarIgor Skalkin <i.skalkin@samsung.com>
    Message-Id: <004301d11166$9672fe30$c358fa90$@samsung.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    8d31d6b6
    backends/hostmem-file: Allow to specify full pathname for backing file
    Pavel Fedin authored
    
    
    This allows to explicitly specify file name to use with the backend. This
    is important when using it together with ivshmem in order to make it backed
    by hugetlbfs. By default filename is autogenerated using mkstemp(), and the
    file is unlink()ed after creation, effectively making it anonymous. This is
    not very useful with ivshmem because it ends up in a memory which cannot be
    accessed by something else.
    
    Distinction between directory and file name is done by stat() check. If an
    existing directory is given, the code keeps old behavior. Otherwise it
    creates or opens a file with the given pathname.
    
    Signed-off-by: default avatarPavel Fedin <p.fedin@samsung.com>
    Tested-by: default avatarIgor Skalkin <i.skalkin@samsung.com>
    Message-Id: <004301d11166$9672fe30$c358fa90$@samsung.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
Loading