Skip to content

Commit 2a99ffb

Browse files
cristikleinThanos Makatos
authored and
Thanos Makatos
committed
Documented how to test for O_DIRECT support
Signed-off-by: Cristian Klein <[email protected]> Acked-by: Thanos Makatos <[email protected]> GitHub: closes #103 on xapi-project/blktap
1 parent 4fcd41e commit 2a99ffb

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

README

+28
Original file line numberDiff line numberDiff line change
@@ -122,3 +122,31 @@ Write I/O barriers
122122
By default write I/O barriers are enabled for all VBDs. To globally disable
123123
write I/O barriers, edit /etc/init.d/tapback and add the "-b" option to
124124
tapback.
125+
126+
127+
Testing for O_DIRECT Support
128+
============================
129+
130+
If the underlying file-system does not support O_DIRECT, utilities (e.g,
131+
`vhd-util`) may fail with error code 22 (EINVAL). Similarly, Xen may fail with a
132+
message as follows:
133+
134+
TapdiskException: ('create', '-avhd:/home/cklein/vms/vm-rubis-0/root.vhd') failed (5632 )
135+
136+
Examples of file-systems that do not support O_DIRECT include:
137+
138+
- ext4 with data=journal (until Linux version 3.1);
139+
- ecryptfs (likely all FUSE-based file-systems).
140+
141+
To test whether your file-system supports O_DIRECT, you may write to a file as
142+
follows:
143+
144+
dd if=/dev/zero of=file_in_filesystem.img count=1 oflag=direct
145+
146+
Remember to erase the test file when you are done. Otherwise, if you have an
147+
existing file that you can read, type:
148+
149+
dd if=existing_file of=/dev/zero count=1 iflag=direct
150+
151+
If any of the above commands fails with "Invalid argument", then you need to
152+
choose a different file-system where your virtual images should be stored.

0 commit comments

Comments
 (0)