cloud-hypervisor/virtio-devices/src
Sebastien Boeuf 85bbf75fe8 block_util: Align buffers for O_DIRECT
Whenever the backing file of our virtio-block device is opened with
O_DIRECT, there's a requirement about the buffer address and size to be
aligned to the sector size.

We know virtio-block requests are sector aligned in terms of size, but
we must still check if the buffer address is. In case it's not, we
create an intermediate buffer that will be passed through the system
call. In case of a write operation, the content of the non-aligned
buffer must be copied beforehand, and in case of a read operation, the
content of the aligned buffer must be copied to the non-aligned one
after the operation has been completed.

Fixes #3587

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2022-01-20 11:49:02 +00:00
..
transport virtio-queue: Update crate based on latest rust-vmm/vm-virtio 2022-01-06 10:02:40 +00:00
vhost_user virtio-queue: Update crate based on latest rust-vmm/vm-virtio 2022-01-06 10:02:40 +00:00
vsock virtio-devices: fix clippy::needless_range_loop 2022-01-18 17:23:27 -08:00
balloon.rs virtio-devices: add or adjust comments for impl ByteValued 2021-11-17 14:40:51 +00:00
block.rs block_util: Align buffers for O_DIRECT 2022-01-20 11:49:02 +00:00
console.rs virtio-devices: add or adjust comments for impl ByteValued 2021-11-17 14:40:51 +00:00
device.rs Move Cloud Hypervisor to virtio-queue crate 2021-10-22 11:38:55 +02:00
epoll_helper.rs virtio-devices: Update some comments in epoll_helper.rs 2021-11-23 14:03:05 +01:00
iommu.rs virtio-queue: Update crate based on latest rust-vmm/vm-virtio 2022-01-06 10:02:40 +00:00
lib.rs Move Cloud Hypervisor to virtio-queue crate 2021-10-22 11:38:55 +02:00
mem.rs virtio-queue: Update crate based on latest rust-vmm/vm-virtio 2022-01-06 10:02:40 +00:00
net.rs Revert "virtio-devices: net: Improve throughput with virtio features" 2021-12-13 08:33:27 +00:00
pmem.rs virtio-queue: Update crate based on latest rust-vmm/vm-virtio 2022-01-06 10:02:40 +00:00
rng.rs Move Cloud Hypervisor to virtio-queue crate 2021-10-22 11:38:55 +02:00
seccomp_filters.rs vmm, pci: Implement virtio-mem support for vfio-user 2021-09-21 15:42:49 +01:00
thread_helper.rs virtio-devices: Call closure directly rather than indirect 2021-10-19 19:42:36 +01:00
watchdog.rs Move Cloud Hypervisor to virtio-queue crate 2021-10-22 11:38:55 +02:00