Richard W.M. Jones
2020-Sep-29 11:47 UTC
[Libguestfs] [PATCH libnbd] DO NOT PUSH: Update api: Add get_nr_meta_contexts, clear_meta_contexts
--- generator/API.ml | 2 +- lib/handle.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/generator/API.ml b/generator/API.ml index 770f41e..fd6f033 100644 --- a/generator/API.ml +++ b/generator/API.ml @@ -1024,7 +1024,7 @@ what it actually supports, see L<nbd_can_meta_context(3)>."; "get_meta_context", { default_call with - args = [ Int "i" ]; ret = RString; + args = [ SizeT "i" ]; ret = RString; shortdesc = "return the i'th meta context request"; longdesc = "\ During connection libnbd can negotiate zero or more metadata diff --git a/lib/handle.c b/lib/handle.c index e0047b7..7adc6d1 100644 --- a/lib/handle.c +++ b/lib/handle.c @@ -320,12 +320,12 @@ nbd_unlocked_get_nr_meta_contexts (struct nbd_handle *h) } char * -nbd_unlocked_get_meta_context (struct nbd_handle *h, int i) +nbd_unlocked_get_meta_context (struct nbd_handle *h, size_t i) { size_t len = nbd_internal_string_list_length (h->request_meta_contexts); char *ret; - if (i < 0 || i >= len) { + if (i >= len) { set_error (EINVAL, "meta context request out of range"); return NULL; } -- 2.28.0.rc2
Reasonably Related Threads
- [libnbd PATCH 1/3] api: Add get_nr_meta_contexts, clear_meta_contexts
- Re: [libnbd PATCH 1/3] api: Add get_nr_meta_contexts, clear_meta_contexts
- Re: [libnbd PATCH 1/3] api: Add get_nr_meta_contexts, clear_meta_contexts
- [libnbd PATCH 0/3] opt_list_meta_context
- [libnbd PATCH 3/3] api: Add nbd_opt_list_meta_context