Introduce a new flag to mark devices that require requests to be aligned and
replace the usage of BDRV_O_NOCACHE and O_DIRECT with this flag when
appropriate.
If a character device is used as a backend on a FreeBSD host set this flag
unconditionally.
Signed-off-by: Roger Pau Monné <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Cc: Kevin Wolf <address@hidden>
Cc: Stefan Hajnoczi <address@hidden>
---
Changes since v2:
- s/alignement/alignment/.
- Don't make needs_alignment a bit field.
- Add braces to single statement conditional block.
Changes since v1:
- Intead of appending BDRV_O_NOCACHE and O_DIRECT when a char dev is used
on FreeBSD introduce a new flag that is used to mark if a device needs
requests to be aligned.
---
block/raw-posix.c | 26 +++++++++++++++++++++-----
1 file changed, 21 insertions(+), 5 deletions(-)