qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] contrib/vhost-user-blk: add missing GOptionEntry NULL terminator
@ 2022-04-11 15:00 Stefan Hajnoczi
  2022-04-11 15:47 ` Michael S. Tsirkin
  2022-04-12  8:15 ` Stefan Hajnoczi
  0 siblings, 2 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2022-04-11 15:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: Raphael Norwitz, Stefan Hajnoczi, Michael S. Tsirkin

The GLib documentation says "a NULL-terminated array of GOptionEntrys"
so we'd better make sure there is a terminator that lets
g_option_context_add_main_entries() know when the end of the array has
been reached.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 contrib/vhost-user-blk/vhost-user-blk.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/contrib/vhost-user-blk/vhost-user-blk.c b/contrib/vhost-user-blk/vhost-user-blk.c
index d14b2896bf..cd4a5d7335 100644
--- a/contrib/vhost-user-blk/vhost-user-blk.c
+++ b/contrib/vhost-user-blk/vhost-user-blk.c
@@ -593,7 +593,8 @@ static GOptionEntry entries[] = {
     {"blk-file", 'b', 0, G_OPTION_ARG_FILENAME, &opt_blk_file,
      "block device or file path", "PATH"},
     { "read-only", 'r', 0, G_OPTION_ARG_NONE, &opt_read_only,
-      "Enable read-only", NULL }
+      "Enable read-only", NULL },
+    { NULL, },
 };
 
 int main(int argc, char **argv)
-- 
2.35.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] contrib/vhost-user-blk: add missing GOptionEntry NULL terminator
  2022-04-11 15:00 [PATCH] contrib/vhost-user-blk: add missing GOptionEntry NULL terminator Stefan Hajnoczi
@ 2022-04-11 15:47 ` Michael S. Tsirkin
  2022-04-12  8:15 ` Stefan Hajnoczi
  1 sibling, 0 replies; 3+ messages in thread
From: Michael S. Tsirkin @ 2022-04-11 15:47 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: qemu-devel, Raphael Norwitz

On Mon, Apr 11, 2022 at 04:00:57PM +0100, Stefan Hajnoczi wrote:
> The GLib documentation says "a NULL-terminated array of GOptionEntrys"
> so we'd better make sure there is a terminator that lets
> g_option_context_add_main_entries() know when the end of the array has
> been reached.
> 
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>

Reviewed-by: Michael S. Tsirkin <mst@redhat.com>

feel free to merge

> ---
>  contrib/vhost-user-blk/vhost-user-blk.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/contrib/vhost-user-blk/vhost-user-blk.c b/contrib/vhost-user-blk/vhost-user-blk.c
> index d14b2896bf..cd4a5d7335 100644
> --- a/contrib/vhost-user-blk/vhost-user-blk.c
> +++ b/contrib/vhost-user-blk/vhost-user-blk.c
> @@ -593,7 +593,8 @@ static GOptionEntry entries[] = {
>      {"blk-file", 'b', 0, G_OPTION_ARG_FILENAME, &opt_blk_file,
>       "block device or file path", "PATH"},
>      { "read-only", 'r', 0, G_OPTION_ARG_NONE, &opt_read_only,
> -      "Enable read-only", NULL }
> +      "Enable read-only", NULL },
> +    { NULL, },
>  };
>  
>  int main(int argc, char **argv)
> -- 
> 2.35.1



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] contrib/vhost-user-blk: add missing GOptionEntry NULL terminator
  2022-04-11 15:00 [PATCH] contrib/vhost-user-blk: add missing GOptionEntry NULL terminator Stefan Hajnoczi
  2022-04-11 15:47 ` Michael S. Tsirkin
@ 2022-04-12  8:15 ` Stefan Hajnoczi
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2022-04-12  8:15 UTC (permalink / raw)
  To: qemu-devel; +Cc: Raphael Norwitz, Michael S. Tsirkin

[-- Attachment #1: Type: text/plain, Size: 566 bytes --]

On Mon, Apr 11, 2022 at 04:00:57PM +0100, Stefan Hajnoczi wrote:
> The GLib documentation says "a NULL-terminated array of GOptionEntrys"
> so we'd better make sure there is a terminator that lets
> g_option_context_add_main_entries() know when the end of the array has
> been reached.
> 
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
>  contrib/vhost-user-blk/vhost-user-blk.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Thanks, applied to my block-next tree:
https://gitlab.com/stefanha/qemu/commits/block-next

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-04-12  8:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-11 15:00 [PATCH] contrib/vhost-user-blk: add missing GOptionEntry NULL terminator Stefan Hajnoczi
2022-04-11 15:47 ` Michael S. Tsirkin
2022-04-12  8:15 ` Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).