On Wed, Sep 28, 2022 at 06:25:36PM +0100, Richard W.M. Jones wrote:
---
lib/internal.h | 75 +++++++++++++++++++++++++++++++++-----------------
1 file changed, 50 insertions(+), 25 deletions(-)
/* utils.c */
-extern void nbd_internal_hexdump (const void *data, size_t len, FILE *fp);
-extern int nbd_internal_copy_string_list (string_vector *v, char **in);
-extern int nbd_internal_set_argv (struct nbd_handle *h, char **argv);
-extern int nbd_internal_set_querylist (struct nbd_handle *h, char **queries);
-extern const char *nbd_internal_fork_safe_itoa (long v, char *buf, size_t len);
-extern void nbd_internal_fork_safe_perror (const char *s);
-extern char *nbd_internal_printable_buffer (const void *buf, size_t count);
-extern char *nbd_internal_printable_string (const char *str);
+extern void nbd_internal_hexdump (const void *data, size_t len, FILE *fp)
+ LIBNBD_ATTRIBUTE_NONNULL((1, 3));
+extern int nbd_internal_copy_string_list (string_vector *v, char **in)
+ LIBNBD_ATTRIBUTE_NONNULL((1, 2));
+extern int nbd_internal_set_argv (struct nbd_handle *h, char **argv)
+ LIBNBD_ATTRIBUTE_NONNULL((1, 2));
+extern int nbd_internal_set_querylist (struct nbd_handle *h, char **queries)
+ LIBNBD_ATTRIBUTE_NONNULL((1, 2));
The ', 2' is wrong here, based on my review of 1/6. This is one
helper where I wanted NULL to mean "copy the implicit
h->request_meta_contexts", and non-NULL to be "copy this explicit
list, even if it is empty".
The rest look good.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization:
qemu.org |
libvirt.org