search for: libnbd_context_base_alloc

Displaying 20 results from an estimated 20 matches for "libnbd_context_base_alloc".

2019 Jun 27
0
Re: [libnbd PATCH] generator: Add support for namespace constants
...es: > Everything is up for a debate: > > - the names might need to be different so that they do not clash with other > constants in the scope later on, Yeah, could be a problem. We have until API stability freeze to change our minds. I'm guessing we might need: LIBNBD_CONTEXT_BASE_ALLOCATION_STATE_HOLE LIBNBD_CONTEXT_BASE_ALLOCATION_STATE_ZERO but yes, that's a mouthful to type. Keeping the short names LIBNBD_STATE_HOLE for now is okay. > > - the fact that "base" and "base:allocation" are even defined, which might be > useless, sin...
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"
2020 Oct 01
1
Re: [PATCH nbdinfo v2] info: Add a --map option for displaying allocation metadata.
...nbdsh -u "$uri" \ ...since you are depending on it. > +/* Callback handling --map. */ > +static const char * > +extent_description (const char *metacontext, uint32_t type) > +{ > + if (strcmp (metacontext, "base:allocation") == 0) { Should we favor the use of LIBNBD_CONTEXT_BASE_ALLOCATION instead of open-coding this? > + switch (type) { > + case 0: return "allocated"; > + case 1: return "zero"; > + case 2: return "hole"; > + case 3: return "hole,zero"; > + } > + } > + else if (strcmp (metaconte...
2019 Aug 15
3
[nbdkit PATCH] nbd: Another libnbd version bump
..., 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; - int i = nbd_read_only (h->nbd); + int i = nbd_is_read_only (h->nbd); if (i == -1) { nbdkit_error...
2019 Jun 25
4
Re: Few libnbd questions/concerns
...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 | libvirt.org
2019 Sep 16
2
[LIBNBD SECURITY PATCH 0/1] NBD Protocol Downgrade Attack in libnbd
...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.set_tls(nbd.TLS_REQUIRE)' \ -c 'h.connect_command(["nbdkit", "-o", "-s", "null"])' \ -c 'pri...
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 Jun 27
1
[libnbd PATCH] block-status: Make callback usage consistent with pread_structured
...const char *metacontext, uint64_t offset, * the fact that qemu-nbd is compliant. */ assert (offset == 0); + assert (!*error || (data->fail && data->count == 1 && *error == EPROTO)); assert (data->count-- > 0); /* [qemu-nbd] */ if (strcmp (metacontext, LIBNBD_CONTEXT_BASE_ALLOCATION) == 0) { @@ -91,7 +92,8 @@ cb (void *opaque, const char *metacontext, uint64_t offset, } if (data->fail) { - errno = EPROTO; /* Something NBD servers can't send */ + /* Something NBD servers can't send */ + *error = data->count == 1 ? EPROTO : ECONNREFUSED; r...
2019 Jun 27
0
Re: Few libnbd questions/concerns
...u: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 it notified the state machine about POLLIN or POLLOUT making progress. We probably want to switch it to return 0 on timeout and 1 when it made progress, so that a user can detect timeout...
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
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.
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 Aug 28
4
[nbdkit PATCH 0/3] .list_exports in nbd plugin
Another series on top of my exportname filter, marking off another todo bullet point. With this, you can now use the NBD plugin as a transparent passthrough of all export names served by the remote server in both directions (list advertisement server to client, and export name from client to server). Eric Blake (3): nbd: Implement .default_export, .export_description nbd: Add
2020 Sep 07
0
[libnbd PATCH 2/2] generator: Free closures on failure
...r from calling in wrong state or because of no server support. + */ + block_status_cb_called = block_status_cb_freed = + completion_cb_called = completion_cb_freed = 0; + nbd = nbd_create (); + if (nbd == NULL) NBD_ERROR; + /* Intentionally omit a call to: + * nbd_add_meta_context (nbd, LIBNBD_CONTEXT_BASE_ALLOCATION); + */ + cookie = nbd_aio_block_status (nbd, sizeof buf, 0, + (nbd_extent_callback) { .callback = block_status_cb, + .free = block_status_cb_free }, + (nbd_completion_call...
2019 Aug 06
5
[PATCH libnbd 0/3] One API and small documentation changes.
One API change, some small documentation changes.
2020 Sep 07
4
[libnbd PATCH 0/2] Fix memory leak with closures
As promised in my earlier thread on libnbd completion callback question. Eric Blake (2): generator: Refactor handling of closures in unlocked functions generator: Free closures on failure docs/libnbd.pod | 2 +- generator/C.ml | 48 +++++++++++------ generator/C.mli | 1 + lib/debug.c | 7 +-- lib/opt.c | 31 ++++++-----
2020 Sep 26
2
[PATCH nbdinfo v2] info: Add a --map option for displaying allocation metadata.
Fixes bugs with JSON output in the previous patch, and adds some tests. Rich.
2019 Oct 04
4
[PATCH libnbd 1/4] generator: Allow long ‘name - shortdesc’ in man pages.
For commands with long names and/or short descriptors, you can end up going over 72 characters in the first line of the man page (causing podwrapper to complain). Wrap these lines. --- generator/generator | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/generator/generator b/generator/generator index 7d3f656..ad1cb6b 100755 --- a/generator/generator +++ b/generator/generator
2020 Aug 14
18
[libnbd PATCH v2 00/13] Adding nbd_set_opt_mode to improve nbdinfo
Well, I'm not quite done (I still want to get nbdinfo to work on a single nbd connection for all cases when reading the heads of the file is not required), but I'm happy with patches 1-11, and 12-13 show where I'm headed for getting NBD_OPT_INFO to work. Posting now to see if some of the earlier patches are ready to commit while I continue working on the latter half. Eric Blake (13):
2020 Sep 21
18
[nbdkit PATCH v3 00/14] exportname filter
It's been several weeks since I posted v2 (I got distracted by improving libnbd to better test things, which in turn surfaced some major memory leak problems in nbdsh that are now fixed). Many of the patches are minor rebases from v2, with the biggest changes being fallout from: - patch 2: rename nbdkit_add_default_export to nbdkit_use_default_export - overall: this missed 1.22, so update