block/gluster: update .help of BLOCK_OPT_PREALLOC option
authorStefano Garzarella <sgarzare@redhat.com>
Fri, 24 May 2019 07:58:48 +0000 (09:58 +0200)
committerMarkus Armbruster <armbru@redhat.com>
Wed, 12 Jun 2019 16:32:32 +0000 (18:32 +0200)
Add missing 'falloc' among the allowed values of 'preallocation'
option; show it and 'full' only when they are supported.
('falloc' is supported if defined CONFIG_GLUSTERFS_FALLOCATE,
'full' is supported if defined CONFIG_GLUSTERFS_ZEROFILL)

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20190524075848.23781-4-sgarzare@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
block/gluster.c

index dc16f0c3293cf8013b30f2c2edfc940df2ad5af3..62f8ff2147e3bb554e8a4bc59030b64a02c127e6 100644 (file)
@@ -98,7 +98,14 @@ static QemuOptsList qemu_gluster_create_opts = {
         {
             .name = BLOCK_OPT_PREALLOC,
             .type = QEMU_OPT_STRING,
-            .help = "Preallocation mode (allowed values: off, full)"
+            .help = "Preallocation mode (allowed values: off"
+#ifdef CONFIG_GLUSTERFS_FALLOCATE
+                    ", falloc"
+#endif
+#ifdef CONFIG_GLUSTERFS_ZEROFILL
+                    ", full"
+#endif
+                    ")"
         },
         {
             .name = GLUSTER_OPT_DEBUG,