With Direct I/O, file reads and writes go directly from the applications
to the storage device, bypassing the operating system read and write
caches. This is useful for applications that manage their own caches.
Open a disk image with O_DIRECT:
$ lkvm run -d ~/img/test.img,direct
The original readonly flag is still supported.
Open a disk image with O_DIRECT and readonly:
$ lkvm run -d ~/img/test.img,direct,ro
Signed-off-by: Asias He <asias.hejun@gmail.com>
Acked-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
We read and write in sectors by default. It makes little sense to add
the extra _sector string for read and write ops/function name.
Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Previously, we use mmaped host root partition as guest's root
filesystem. As virtio-9p based root filesystem is supported,
mmaped host root partition approach is not used anymore.
It is useful to use raw block device as guest's disk backend for some
user. e.g. bypass host's fs layer.
This patch makes raw block device work as disk image, user can do
read/write on raw block device, by using DISK_IMAGE_REGULAR instead of
DISK_IMAGE_MMAP for block device
Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
This patch renames:
raw_image__read_sector_ro_mmap to raw_image__read_sector
raw_image__write_sector_ro_mmap to raw_image__write_sector
raw_image__close_ro_mmap to raw_image__close
Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>