diff mbox series

[3/3] block/gluster: update .help of BLOCK_OPT_PREALLOC option

Message ID 20190523152250.106717-4-sgarzare@redhat.com
State New
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' and 'full' among the allowed values of
'preallocation' option, only when they are supported
('falloc' is support if defined CONFIG_GLUSTERFS_FALLOCATE,
'full' is support if defined CONFIG_GLUSTERFS_ZEROFILL)

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

Comments

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

> Show 'falloc' and 'full' among the allowed values of
> 'preallocation' option, only when they are supported
> ('falloc' is support if defined CONFIG_GLUSTERFS_FALLOCATE,
> 'full' is support if defined CONFIG_GLUSTERFS_ZEROFILL)

You could mention that 'falloc' is missing before the patch.

> Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
> ---
>  block/gluster.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/block/gluster.c b/block/gluster.c
> index e664ca4462..682fe49912 100644
> --- a/block/gluster.c
> +++ b/block/gluster.c
> @@ -97,7 +97,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,

Reviewed-by: Markus Armbruster <armbru@redhat.com>
Stefano Garzarella May 24, 2019, 7:37 a.m. UTC | #2
On Thu, May 23, 2019 at 06:35:18PM +0200, Markus Armbruster wrote:
> Stefano Garzarella <sgarzare@redhat.com> writes:
> 
> > Show 'falloc' and 'full' among the allowed values of
> > 'preallocation' option, only when they are supported
> > ('falloc' is support if defined CONFIG_GLUSTERFS_FALLOCATE,
> > 'full' is support if defined CONFIG_GLUSTERFS_ZEROFILL)
> 
> You could mention that 'falloc' is missing before the patch.
> 

I'll fix the commit message.

> > Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
> > ---
> >  block/gluster.c | 9 ++++++++-
> >  1 file changed, 8 insertions(+), 1 deletion(-)
> >
> > diff --git a/block/gluster.c b/block/gluster.c
> > index e664ca4462..682fe49912 100644
> > --- a/block/gluster.c
> > +++ b/block/gluster.c
> > @@ -97,7 +97,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,
> 
> Reviewed-by: Markus Armbruster <armbru@redhat.com>

Thanks,
Stefano
diff mbox series

Patch

diff --git a/block/gluster.c b/block/gluster.c
index e664ca4462..682fe49912 100644
--- a/block/gluster.c
+++ b/block/gluster.c
@@ -97,7 +97,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,