search for: nbd_add_meta_context

Displaying 20 results from an estimated 36 matches for "nbd_add_meta_context".

2020 Sep 28
0
[libnbd PATCH 1/3] api: Add get_nr_meta_contexts, clear_meta_contexts
...hich describe information returned +by the L<nbd_block_status(3)> command (for C<\"base:allocation\"> +this is whether blocks of data are allocated, zero or sparse). + +This command returns how many meta contexts have been added to +the list to request from the server via L<nbd_add_meta_context(3)>. +The server is not obligated to honor all of the requests; to see +what it actually supports, see L<nbd_can_meta_context(3)>."; + see_also = [Link "block_status"; Link "can_meta_context"; + Link "add_meta_context"; Link "get_me...
2019 Jun 27
0
Re: [libnbd PATCH] generator: Add support for namespace constants
...(entries[6] == 458752); assert (entries[7] == 3); + assert (entries[6] == 458752); assert (entries[7] == (LIBNBD_STATE_HOLE| + LIBNBD_STATE_ZERO)); } } else if (strcmp (metacontext, bitmap) == 0) { @@ -117,7 +118,7 @@ main (int argc, char *argv[]) exit (EXIT_FAILURE); } - nbd_add_meta_context (nbd, base_allocation); + nbd_add_meta_context (nbd, LIBNBD_CONTEXT_BASE_ALLOCATION); nbd_add_meta_context (nbd, bitmap); if (nbd_connect_unix (nbd, unixsocket) == -1) { diff --git i/tests/meta-base-allocation.c w/tests/meta-base-allocation.c index b00aa50..a9ddbd0 100644 --- i/tests/meta-b...
2019 Jun 25
4
Re: Few libnbd questions/concerns
...e/nbd/blob/master/doc/proto.md We could add convenience #defines into libnbd.h if needed, which would work for the base:allocation context, but it would not help any other context (such as qemu:dirty-bitmap:FOO) which has other definitions for the returned bits. But the fact that you have to call nbd_add_meta_context(h, "base:allocation") is also awkward; if we add convenience macros for the results, we probably also want to support nbd_add_meta_context(h, LIBNBD_CONTEXT_BASE_ALLOCATION). -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | l...
2019 Jun 27
3
[libnbd PATCH] generator: Add support for namespace constants
This just defines the namespace, its contexts and related constants and the only supported one is currently base:allocation. The names of the constants are not very future-proof, but shorter than LIBNBD_META_NS_CONTEXT_BASE_ALLOCATION or similar. Currently the output looks like this: /* "base" namespace */ /* "base" namespace contexts */ /* "base:allocation"
2019 Aug 14
3
[libnbd PATCH 0/2] Drop generated file from git
Rich recently patched things to generate one man page per function rather than libnbd-api.3 (nice), but in doing so got stumped by a problem with a fresh git clone (automake fails for any 'include' directive that does not already exist). I've figured out how to hack around it, but the hack requires GNU make. We already use GNU make constructs elsewhere (such as $(wildcard)), but
2020 Sep 28
8
[libnbd PATCH 0/3] opt_list_meta_context
I'm posting this now, as I'm at the end of a workday and I got things working for manual experimentation. Still to do: - write interop tests for qemu-nbd and nbdkit (including my proposed patch addition of qemu-nbd -A to show qemu:allocation-depth) - figure out if we can make 'nbdinfo --map' use the new API to automatically select all contexts advertised by the server Eric Blake
2023 Aug 03
1
[libnbd PATCH v4 20/25] generator: Actually request extended headers
...vable (albeit uncommon) change in behavior to a specific corner case involving a meta-context with 64-bit flags (so far, no such meta-context exists, but I'll use "x-context:big" as a placeholder for such a meta-context). An application compiled and run with libnbd 1.16 that requests nbd_add_meta_context(h, "x-context:big") will fail to negotiate that context, but can still succeed at negotiating "base:allocation". What's more, that application was compiled at a time when the nbd_block_status_64() API did not exist, so it will necessarily be using the older 32-bit nbd_block_...
2019 Jun 27
0
Re: Few libnbd questions/concerns
...> > We could add convenience #defines into libnbd.h if needed, which would > work for the base:allocation context, but it would not help any other > context (such as qemu:dirty-bitmap:FOO) which has other definitions for > the returned bits. But the fact that you have to call > nbd_add_meta_context(h, "base:allocation") is also awkward; if we add > convenience macros for the results, we probably also want to support > nbd_add_meta_context(h, LIBNBD_CONTEXT_BASE_ALLOCATION). Still needs to be done. Another thing I just noticed: nbd_poll returns 0 both for timeout and for when...
2019 Sep 16
2
[LIBNBD SECURITY PATCH 0/1] NBD Protocol Downgrade Attack in libnbd
...e sure that an oldstyle server did not thwart encryption. Either of the following extension tests will prove that a newstyle server is present (unfortunately, this does not help for a newstyle server that does not support either extension): - If nbd_can_df(h) returns true. - If the client requests nbd_add_meta_context(h, context) prior to connection, then nbd_can_meta_context(h, context) returns true; the most commonly supported context is LIBNBD_CONTEXT_BASE_ALLOCATION. Test if libnbd is vulnerable ---------------------------- Run the following command (tested with nbdkit 1.12 or newer): $ nbdsh -c 'h.se...
2020 Sep 28
0
[libnbd PATCH 3/3] api: Add nbd_opt_list_meta_context
...only be +used if L<nbd_set_opt_mode(3)> enabled option mode. + +The NBD protocol allows a client to decide how many queries to ask +the server. Rather than taking that list of queries as a parameter +to this function, libnbd reuses the current list of requested meta +contexts as set by L<nbd_add_meta_context(3)>; you can use +L<nbd_clear_meta_contexts(3)> to set up a different list of queries. +When the list is empty, a server will typically reply with all +contexts that it supports; when the list is non-empty, the server +will reply only with supported contexts that match the client's +re...
2019 Jun 25
2
Few libnbd questions/concerns
Here are few things I found out when using libnbd that might be perfectly fine or maybe just an oversight, but I wanted to point them out. It's nothing major. When running a program with `nbdkit -U - --run ...`, the $nbd parameter gets expanded to nbd:unix:/path/to/socket. When this string is passed to nbd_connect_uri(), it does not return an error (even though it is not a valid URL), but
2020 Oct 02
4
[libnbd PATCH v2 0/2] opt_list_meta_context
In v2: ack'ed preliminary patches have been pushed, and I've added a lot of testsuite coverage as well as putting the new API to use in nbdinfo. Eric Blake (2): api: Add nbd_opt_list_meta_context info: List available meta-contexts lib/internal.h | 1 + generator/API.ml | 84 ++++++++-
2019 Oct 01
3
[PATCH libnbd 0/2] Change qemu-nbd interop tests to use socket activation.
Now that we have implemented systemd socket activation, we can use this to run qemu-nbd in tests. The first patch leaves some dead code around (the -DSERVE_OVER_TCP=1 path). It's possible we might want to use this to test against a putative future NBD server that only supports TCP, but on the other hand maybe we should just remove it. Tests & valgrind still pass for me. Rich.
2019 Aug 15
3
[nbdkit PATCH] nbd: Another libnbd version bump
...rans; +} + /* Register a cookie and kick the I/O thread. */ static void nbdplug_register (struct handle *h, struct transaction *trans, int64_t cookie) @@ -466,7 +468,7 @@ nbdplug_open_handle (int readonly) goto err; if (nbd_set_export_name (h->nbd, export) == -1) goto err; - if (nbd_add_meta_context (h->nbd, "base:allocation") == -1) + if (nbd_add_meta_context (h->nbd, LIBNBD_CONTEXT_BASE_ALLOCATION) == -1) goto err; if (nbd_set_tls (h->nbd, tls) == -1) goto err; @@ -570,7 +572,7 @@ static int nbdplug_can_write (void *handle) { struct handle *h = handle; -...
2019 Sep 17
2
[PATCH libnbd] docs: Document limits on export name.
This commit documents the limits on export name, encoding, etc. --- generator/generator | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/generator/generator b/generator/generator index a72f36c..87a8cdf 100755 --- a/generator/generator +++ b/generator/generator @@ -1066,10 +1066,16 @@ C<\"nbd2\">, etc."; longdesc = "\ For servers
2020 Sep 04
0
[libnbd PATCH 1/2] api: Add nbd_set_strict_mode
...->structured_replies) { + set_error (ENOTSUP, "server does not support structured replies"); + return -1; + } - if (h->meta_contexts == NULL) { - set_error (ENOTSUP, "did not negotiate any metadata contexts, " - "either you did not call nbd_add_meta_context before " - "connecting or the server does not support it"); - return -1; - } + if (h->meta_contexts == NULL) { + set_error (ENOTSUP, "did not negotiate any metadata contexts, " + "either you did not call nbd_add_meta_context...
2019 Aug 14
0
[libnbd PATCH 2/2] docs: Drop docs/Makefile.inc from git
...allback \ - nbd_set_handle_name \ - nbd_get_handle_name \ - nbd_set_export_name \ - nbd_get_export_name \ - nbd_set_tls \ - nbd_get_tls \ - nbd_set_tls_certificates \ - nbd_set_tls_verify_peer \ - nbd_get_tls_verify_peer \ - nbd_set_tls_username \ - nbd_get_tls_username \ - nbd_set_tls_psk_file \ - nbd_add_meta_context \ - nbd_connect_uri \ - nbd_connect_unix \ - nbd_connect_tcp \ - nbd_connect_command \ - nbd_is_read_only \ - nbd_can_flush \ - nbd_can_fua \ - nbd_is_rotational \ - nbd_can_trim \ - nbd_can_zero \ - nbd_can_df \ - nbd_can_multi_conn \ - nbd_can_cache \ - nbd_can_meta_context \ - nbd_get_size \ - n...
2019 Aug 15
1
[PATCH libnbd] docs: Change docs/Makefile.inc back to a regular include, readd to git.
...allback \ + nbd_set_handle_name \ + nbd_get_handle_name \ + nbd_set_export_name \ + nbd_get_export_name \ + nbd_set_tls \ + nbd_get_tls \ + nbd_set_tls_certificates \ + nbd_set_tls_verify_peer \ + nbd_get_tls_verify_peer \ + nbd_set_tls_username \ + nbd_get_tls_username \ + nbd_set_tls_psk_file \ + nbd_add_meta_context \ + nbd_connect_uri \ + nbd_connect_unix \ + nbd_connect_tcp \ + nbd_connect_command \ + nbd_is_read_only \ + nbd_can_flush \ + nbd_can_fua \ + nbd_is_rotational \ + nbd_can_trim \ + nbd_can_zero \ + nbd_can_df \ + nbd_can_multi_conn \ + nbd_can_cache \ + nbd_can_meta_context \ + nbd_get_size \ + n...
2020 Sep 11
0
[libnbd PATCH v2 3/5] api: Add nbd_set_strict_mode
...->structured_replies) { + set_error (ENOTSUP, "server does not support structured replies"); + return -1; + } - if (h->meta_contexts == NULL) { - set_error (ENOTSUP, "did not negotiate any metadata contexts, " - "either you did not call nbd_add_meta_context before " - "connecting or the server does not support it"); - return -1; + if (h->meta_contexts == NULL) { + set_error (ENOTSUP, "did not negotiate any metadata contexts, " + "either you did not call nbd_add_meta_context befo...
2019 Jul 27
3
[PATCH libnbd] lib: Use symbol versions.
...ome reason libvirt doesn’t use it. The change appears to be working in as much as I can see the symbol versions appearing, and the test/example programs continue to run. $ nm -D --with-symbol-versions lib/.libs/libnbd.so.0 | grep LIBNBD 0000000000000000 A LIBNBD_1.0@@LIBNBD_1.0 0000000000005470 T nbd_add_meta_context@@LIBNBD_1.0 00000000000085d0 T nbd_aio_block_status@@LIBNBD_1.0 0000000000008710 T nbd_aio_block_status_callback@@LIBNBD_1.0 0000000000008110 T nbd_aio_cache@@LIBNBD_1.0 0000000000008230 T nbd_aio_cache_callback@@LIBNBD_1.0 00000000000089e0 T nbd_aio_command_completed@@LIBNBD_1.0 0000000000006f20 T...