On Wed, Nov 09, 2022 at 02:43:52PM -0600, Eric Blake wrote:
> @@ -51,7 +51,9 @@ typedef enum exit_code {
>    OK = 0,
>    ERROR = 1,           /* all script error codes are mapped to this */
>    MISSING = 2,         /* method missing */
> -  RET_FALSE = 3        /* script exited with code 3 meaning false */
> +  RET_FALSE = 3,       /* script exited with code 3 meaning false */
> +  /* Adjust methods.c:sh_dump_plugin when defining new codes */
> +  /* 4-7 is reserved since 1.8; handle like ERROR for now */
>  } exit_code;
> 
>  extern exit_code call (const char **argv)
> diff --git a/plugins/sh/methods.c b/plugins/sh/methods.c
> index 5c1ee5f8..4a75a3a0 100644
> --- a/plugins/sh/methods.c
> +++ b/plugins/sh/methods.c
> @@ -1,5 +1,5 @@
>  /* nbdkit
> - * Copyright (C) 2018-2021 Red Hat Inc.
> + * Copyright (C) 2018-2022 Red Hat Inc.
>   *
>   * Redistribution and use in source and binary forms, with or without
>   * modification, are permitted provided that the following conditions are
> @@ -58,6 +58,10 @@ sh_dump_plugin (void)
>    const char *args[] = { script, method, NULL };
>    CLEANUP_FREE_STRING string o = empty_vector;
> 
> +  /* Dump information about the sh/eval features */
> +  printf ("max_known_status=%d\n", RET_FALSE);

It also took me a double-take here to realise that this prints the
maximum known status number instead of a boolean of some kind.  So as
Laszlo suggests this might be better with some enum sentinel to record
the first reserved value.

Anyway it's all good so:

Reviewed-by: Richard W.M. Jones <rjo...@redhat.com>

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-builder quickly builds VMs from scratch
http://libguestfs.org/virt-builder.1.html
_______________________________________________
Libguestfs mailing list
Libguestfs@redhat.com
https://listman.redhat.com/mailman/listinfo/libguestfs

Reply via email to