diff mbox series

[2/3] block/file-posix: update .help of BLOCK_OPT_PREALLOC option

Message ID 20190523152250.106717-3-sgarzare@redhat.com (mailing list archive)
State New, archived
Headers show
Series Update documentation and help related to the preallocation parameter | expand

Commit Message

Stefano Garzarella May 23, 2019, 3:22 p.m. UTC
Show 'falloc' among the allowed values of 'preallocation'
option, only when it is supported (if defined CONFIG_POSIX_FALLOCATE)

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
---
 block/file-posix.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Markus Armbruster May 23, 2019, 4:36 p.m. UTC | #1
Stefano Garzarella <sgarzare@redhat.com> writes:

> Show 'falloc' among the allowed values of 'preallocation'
> option, only when it is supported (if defined CONFIG_POSIX_FALLOCATE)
>
> Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
> ---
>  block/file-posix.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/block/file-posix.c b/block/file-posix.c
> index d018429672..9632e3a87b 100644
> --- a/block/file-posix.c
> +++ b/block/file-posix.c
> @@ -2751,7 +2751,11 @@ static QemuOptsList raw_create_opts = {
>          {
>              .name = BLOCK_OPT_PREALLOC,
>              .type = QEMU_OPT_STRING,
> -            .help = "Preallocation mode (allowed values: off, falloc, full)"
> +            .help = "Preallocation mode (allowed values: off"
> +#ifdef CONFIG_POSIX_FALLOCATE
> +                    ", falloc"
> +#endif
> +                    ", full)"
>          },
>          { /* end of list */ }
>      }

Reviewed-by: Markus Armbruster <armbru@redhat.com>
diff mbox series

Patch

diff --git a/block/file-posix.c b/block/file-posix.c
index d018429672..9632e3a87b 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -2751,7 +2751,11 @@  static QemuOptsList raw_create_opts = {
         {
             .name = BLOCK_OPT_PREALLOC,
             .type = QEMU_OPT_STRING,
-            .help = "Preallocation mode (allowed values: off, falloc, full)"
+            .help = "Preallocation mode (allowed values: off"
+#ifdef CONFIG_POSIX_FALLOCATE
+                    ", falloc"
+#endif
+                    ", full)"
         },
         { /* end of list */ }
     }