examples: Small updates to nbd.fio
authorRichard W.M. Jones <rjones@redhat.com>
Mon, 13 Feb 2023 13:23:27 +0000 (13:23 +0000)
committerVincent Fu <vincent.fu@samsung.com>
Tue, 14 Feb 2023 15:25:14 +0000 (10:25 -0500)
Improve the documentation, describing how to use nbdkit with a local
file.  Move the suggested test file to /var/tmp since /tmp might be a
tmpfs.  Use indenting to make it easier to read.

Use ${uri} instead of ${unixsocket} since nbdkit 1.14 was released
nearly 4 years ago.

Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
examples/nbd.fio

index 6900ebe7f019defc4c0fcabe2072749d5c20c14e..31629fad700b93c530c4d92686d6a59e3ab4337b 100644 (file)
@@ -1,21 +1,25 @@
-# To use fio to test nbdkit:
+# To use fio to test nbdkit + RAM disk:
 #
-# nbdkit -U - memory size=256M --run 'export unixsocket; fio examples/nbd.fio'
+#   nbdkit -U - memory size=256M --run 'export uri; fio examples/nbd.fio'
 #
-# To use fio to test qemu-nbd:
+# To use fio to test nbdkit + local file:
 #
-# rm -f /tmp/disk.img /tmp/socket
-# truncate -s 256M /tmp/disk.img
-# export unixsocket=/tmp/socket
-# qemu-nbd -t -k $unixsocket -f raw /tmp/disk.img &
-# fio examples/nbd.fio
-# killall qemu-nbd
+#   rm -f /var/tmp/disk.img
+#   truncate -s 256M /var/tmp/disk.img
+#   nbdkit -U - file /var/tmp/disk.img --run 'export uri; fio examples/nbd.fio'
+#
+# To use fio to test qemu-nbd + local file:
+#
+#   rm -f /var/tmp/disk.img /var/tmp/socket
+#   truncate -s 256M /var/tmp/disk.img
+#   export uri='nbd+unix:///?socket=/var/tmp/socket'
+#   qemu-nbd -t -k /var/tmp/socket -f raw /var/tmp/disk.img &
+#   fio examples/nbd.fio
+#   killall qemu-nbd
 
 [global]
 ioengine=nbd
-uri=nbd+unix:///?socket=${unixsocket}
-# Starting from nbdkit 1.14 the following will work:
-#uri=${uri}
+uri=${uri}
 rw=randrw
 time_based
 runtime=60