search for: add_meta_context

Displaying 20 results from an estimated 32 matches for "add_meta_context".

2020 Aug 10
5
[PATCH nbdkit] python: Implement can_extents + extents.
...h.can_cache() - # Not yet implemented: can_extents. + # In theory we could use a test like this, but nbdkit can + # always synthesize base:allocation block_status responses + # even if the plugin doesn't support them. + # + #def test_can_extents_true (self): + # self.h.add_meta_context ("base:allocation") + # self.connect ({"size": 512, "can_extents": True}) + # assert self.h.can_meta_context ("base:allocation") + # + #def test_can_extents_false (self): + # self.h.add_meta_context ("base:allocation") + #...
2020 Aug 10
0
Re: [PATCH nbdkit] python: Implement can_extents + extents.
...implemented: can_extents. > + # In theory we could use a test like this, but nbdkit can > + # always synthesize base:allocation block_status responses > + # even if the plugin doesn't support them. > + # > + #def test_can_extents_true (self): > + # self.h.add_meta_context ("base:allocation") > + # self.connect ({"size": 512, "can_extents": True}) > + # assert self.h.can_meta_context ("base:allocation") > + # > + #def test_can_extents_false (self): > + # self.h.add_meta_context ("base...
2020 Sep 28
2
[libnbd PATCH] nbdsh: Add --opt-mode command line option
...hub.com/NetworkBlockDevice/nbd/blob/master/doc/uri.md>. This is equivalent to the S<C<h.connect_uri(URI)>> command in the shell. +Note that the connection is created prior to processing any C<-c> +commands, which prevents the use of configuration commands such as +S<C<h.add_meta_context(>NAMEC<)>> from the command line when mixed +with this option. The options C<--opt-mode> and C<--base-allocation> +can be used to make this situation easier to manage. + =item B<-V> =item B<--version> diff --git a/python/nbdsh.py b/python/nbdsh.py index 083df...
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 ++++++++-
2020 Sep 28
0
[libnbd PATCH 1/3] api: Add get_nr_meta_contexts, clear_meta_contexts
...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...
2022 Nov 04
3
[libnbd PATCH v2 0/3] Improve nbdsh -u handling
v1 was here: https://listman.redhat.com/archives/libguestfs/2022-October/030216.html Since then, I've incorporated changes based on Rich's feedback: swap order of patches 2 and 3 less change in patch 1 (including no unsafe eval(%s) for --uri) in patch 2, include -c in list of snippets to store, and use dict of lambdas to map back to the desired action Eric Blake (3): nbdsh:
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
2020 Sep 28
0
[libnbd PATCH 3/3] api: Add nbd_opt_list_meta_context
...y 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...
2020 Feb 10
0
[libnbd PATCH 1/1] generator: Add support for NBD_INFO_INIT_STATE extension
.... *) +(* Flags. See also Constants below. *) let cmd_flags = { flag_prefix = "CMD_FLAG"; flags = [ @@ -1969,7 +1969,8 @@ are free to pass in other contexts." ^ non_blocking_test_call_description; see_also = [SectionLink "Flag calls"; Link "add_meta_context"; - Link "block_status"; Link "aio_block_status"]; + Link "block_status"; Link "aio_block_status"; + Link "get_init_flags"]; }; "get_protocol", { @@ -1990,6 +1991,30 @@ Most modern N...
2020 Sep 05
1
Re: libnbd completion callback question
...\(here\|resident\)' got here print("got here") Maximum resident set size (kbytes): 17796 Average resident set size (kbytes): 0 Ideally, increasing the loop iterations should have no effect on the max memory usage. Replacing the h.set_request_structured_replies(False) line with h.add_meta_context(nbd.CONTEXT_BASE_ALLOCATION) (so that the block status request succeeds instead) proves the point; after that change, I'm seeing 17296k with count=1 and 17284k with count=10000 (that is, the memory usage is higher and somewhat less deterministic because there is now server interactions, but...
2019 Jul 17
0
Re: [PATCH] Add Rust bindings
...call those APIs that are accessible at a current state (if that state > is > controllable by the client, of course), so for example you could use the > builder > pattern to create a handle prepared to be connected (or even connect it): > > let h = Nbd::new() > .add_meta_context("base:allocation") > .set.export_name("/") > .set_debug(true) > .connect_uri("nbd://") > > And then you would be able to do, e.g.: > > h.pread(); > h.set_debug(false) > > But not: > > h...
2019 Sep 12
2
[libnbd PATCH] nbdsh: Add -b option to simplify h.block_status
...nect to NBD URI") parser.add_argument ('-c', '--command', action='append', @@ -52,6 +54,8 @@ exit() or Ctrl-D # Quit the shell help (nbd) # Display documentation ''' + if args.base_allocation: + h.add_meta_context (nbd.CONTEXT_BASE_ALLOCATION) if args.connect is not None: h.connect_uri (args.connect) # If there are no -c or --command parameters, go interactive, diff --git a/sh/Makefile.am b/sh/Makefile.am index 8f70e69..415e241 100644 --- a/sh/Makefile.am +++ b/sh/Makefile.am @@ -21,6 +21,...
2019 Sep 05
0
[PATCH libnbd] generator: Move first_version fields to a single table.
..._tls_certificates", (1, 0);*) + "set_tls_verify_peer", (1, 0); + "get_tls_verify_peer", (1, 0); + "set_tls_username", (1, 0); + "get_tls_username", (1, 0); + "set_tls_psk_file", (1, 0); + (*"get_tls_psk_file", (1, 0);*) + "add_meta_context", (1, 0); + "connect_uri", (1, 0); + "connect_unix", (1, 0); + "connect_tcp", (1, 0); + "connect_command", (1, 0); + "is_read_only", (1, 0); + "can_flush", (1, 0); + "can_fua", (1, 0); + "is_rotational", (1...
2019 Sep 16
1
[libnbd PATCH] api: Add set_handshake_flags for integration
...urn value from +a newer library version may include bits that were undefined at +the time of compilation."; + see_also = ["L<nbd_set_handshake_flags(3)>"; + "L<nbd_aio_is_created(3)>"; "L<nbd_aio_is_ready(3)>"]; + }; + "add_meta_context", { default_call with args = [ String "name" ]; ret = RErr; @@ -2521,6 +2589,8 @@ let first_version = [ "can_fast_zero", (1, 2); "set_request_structured_replies", (1, 2); "get_request_structured_replies", (1, 2); + "set_handshake...
2019 Sep 05
3
[PATCH libnbd] generator: Move first_version fields to a single table.
This doesn't include Eric's new APIs, but if you push those then I can rebase this one on top. Rich.
2019 Sep 12
1
[libnbd PATCH v2] nbdsh: Prefer --uri over --connect
...and', action='append', help="run a command") parser.add_argument ('-V', '--version', action='version', @@ -56,8 +58,8 @@ help (nbd) # Display documentation if args.base_allocation: h.add_meta_context (nbd.CONTEXT_BASE_ALLOCATION) - if args.connect is not None: - h.connect_uri (args.connect) + if args.uri is not None: + h.connect_uri (args.uri) # If there are no -c or --command parameters, go interactive, # otherwise we run the commands and exit. if not args.co...
2020 Aug 19
3
[libnbd PATCH 0/2] NBD_OPT_INFO support
This replaces 13/13 of my v2 series; and now that it has pretty good testsuite coverage and demonstrable performance improvement to nbdinfo, I'm going ahead and pushing this now. We may still want to add further nbd_opt_* commands for other fine-grained tuning of negotiation, but for now, I think things have stabilized on this end, and I can return to polishing .list_exports on the nbdkit
2019 Jul 08
2
Re: [PATCH] Add Rust bindings
On Mon, Jul 08, 2019 at 10:10:10AM +0200, Pino Toscano wrote: >On Saturday, 6 July 2019 13:03:24 CEST Martin Kletzander wrote: >> Just one thing, the Cargo.toml includes a version under which the crate would be >> published. I presume the version would be the same as the one of the project >> itself, i.e. when releasing libguestfs-x.y.z, we publish guestfs-rs-x.y.z to
2020 Sep 05
2
libnbd completion callback question
I noticed while reading the code that we have a documentation hole that may cause memory leaks for clients that are unaware, in relation to completion callbacks. The situation arises as follows: for all commands with a completion callback, I checked that the code has clean semantics: either nbd_aio_FOO() returns -1 and we never call the callback cleanup, or nbd_aio_FOO() returns a cookie and
2019 Sep 04
2
[libnbd PATCH] api: Add way to avoid structured replies
...equest structured replies flag on this +handle. Note that this only reports whether the client attempts +to negotiate structured replies, and not whether the server was +able to honor that request"; + see_also = ["L<nbd_set_request_structured_replies(3)>"]; + }; + "add_meta_context", { default_call with args = [ String "name" ]; ret = RErr; diff --git a/generator/states-newstyle-opt-structured-reply.c b/generator/states-newstyle-opt-structured-reply.c index d932248..415f7e0 100644 --- a/generator/states-newstyle-opt-structured-reply.c +++ b/generator/...